BeBoB: rename 'presonus_avdevice' to 'firebox_avdevice'
[ffado.git] / libffado / src / bebob / presonus / inspire1394_avdevice.h
blob4818c1c6f1d6ff770bb3d2bf4843086b2799ebaa
1 /*
2 * Copyright (C) 2014 by Takashi Sakamoto
3 * Copyright (C) 2005-2008 by Daniel Wagner
4 * Copyright (C) 2005-2008 by Pieter Palmers
6 * This file is part of FFADO
7 * FFADO = Free Firewire (pro-)audio drivers for linux
9 * FFADO is based upon FreeBoB.
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation, either version 2 of the License, or
14 * (at your option) version 3 of the License.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #ifndef BEBOB_PRESONUS_INSPIRE1394_DEVICE_H
27 #define BEBOB_PRESONUS_INSPIRE1394_DEVICE_H
29 #include "debugmodule/debugmodule.h"
30 #include "bebob/bebob_avdevice.h"
32 namespace BeBoB {
33 namespace Presonus {
35 enum EInspire1394CmdSubFunc {
36 EInspire1394CmdSubFuncPhono,
37 EInspire1394CmdSubFuncPhantom,
38 EInspire1394CmdSubFuncBoost,
39 EInspire1394CmdSubFuncLimit
42 class Inspire1394VendorDependentCmd:: public AVC::VendorDependentCmd
44 public:
45 Inspire1394VendorDependentCmd( Ieee1394Service& ieee1394service );
46 virtual ~Inspire1394VendorDependentCmd;
48 virtual bool serialize( Util::Cmd::IOSSerialize& se);
49 virtual bool deserialize( Util::Cmd::IOSDeserialize& de );
51 virtual const char* getCmdName() const
52 { return "Inspire1394VendorDependentCmd"; }
54 virtual void setSubFunc(EInspire1394CmdSubFunc subfunc)
55 { m_subfunc = subfunc; }
56 virtual void setIdx(int idx)
57 { m_idx = idx; }
58 virtual void setArg(int arg)
59 { m_arg = arg; }
61 virtual int getArg(void)
62 { return m_arg; }
64 protected:
65 EInspire1394CmdSubFunc m_subfunc;
66 uint32_t m_idx;
67 uint32_t m_arg;
70 class BinaryControl
71 : public Control::Discrete
73 public:
74 BinaryControl(Inspire1394Device& parent,
75 EInspire1394CmdSubFunc subfunc,
76 std::string name, std::string label, std::string desc);
78 virtual bool setValue(int val) {
79 { return setValue(0, val); }
80 virtual int getValue() {
81 { return getValue(0); }
82 virtual bool setValue(int idx, int val);
83 virtual int getValue(int idx);
85 virtual int getMinimum() {return 0;};
86 virtual int getMaximum() {return 1;};
88 private:
89 Inspire1394Device& m_Parent;
90 EInspire1394CmdSubFuncm_subfunc;
93 class Inspire1394Device : public BeBoB::Device {
94 public:
95 Inspire1394Device( DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ));
96 virtual ~Inspire1394Device();
98 virtual void showDevice();
100 private:
101 bool getSpecificValue();
102 bool setSpecificValue();
105 } // namespace Presonus
106 } // namespace BeBoB
108 #endif