Clean up compiler warnings when compiling on 64-bit systems. These are mostly fixing...
[ffado.git] / libffado / src / fireworks / fireworks_control.h
blob7d798aab8cda1eccfe71c65232043886c9f1c527
1 /*
2 * Copyright (C) 2005-2008 by Daniel Wagner
3 * Copyright (C) 2005-2008 by Pieter Palmers
5 * This file is part of FFADO
6 * FFADO = Free Firewire (pro-)audio drivers for linux
8 * FFADO is based upon FreeBoB.
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 2 of the License, or
13 * (at your option) version 3 of the License.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #ifndef FIREWORKS_MATRIX_CONTROL_H
26 #define FIREWORKS_MATRIX_CONTROL_H
28 #include "debugmodule/debugmodule.h"
30 #include "efc/efc_cmd.h"
31 #include "efc/efc_cmds_hardware.h"
32 #include "efc/efc_cmds_mixer.h"
33 #include "efc/efc_cmds_monitor.h"
34 #include "efc/efc_cmds_ioconfig.h"
36 #include "libcontrol/BasicElements.h"
37 #include "libcontrol/MatrixMixer.h"
39 #include <pthread.h>
41 class ConfigRom;
42 class Ieee1394Service;
44 namespace FireWorks {
46 class MonitorControl : public Control::MatrixMixer
48 public:
49 enum eMonitorControl {
50 eMC_Gain,
51 eMC_Solo,
52 eMC_Mute,
53 eMC_Pan,
56 public:
57 MonitorControl(FireWorks::Device& parent, enum eMonitorControl);
58 MonitorControl(FireWorks::Device& parent, enum eMonitorControl, std::string n);
59 virtual ~MonitorControl() {};
61 virtual void show();
63 bool hasNames() const { return true; }
64 virtual std::string getRowName( const int );
65 virtual std::string getColName( const int );
66 virtual int canWrite( const int, const int );
67 virtual double setValue( const int, const int, const double );
68 virtual double getValue( const int, const int );
69 virtual int getRowCount( );
70 virtual int getColCount( );
72 bool canConnect() const { return false; }
74 // full map updates are unsupported
75 virtual bool getCoefficientMap(int &) {return false;};
76 virtual bool storeCoefficientMap(int &) {return false;};
78 protected:
79 enum eMonitorControl m_control;
80 FireWorks::Device& m_ParentDevice;
84 class SimpleControl : public Control::Continuous
87 public:
88 SimpleControl(FireWorks::Device& parent,
89 enum eMixerTarget, enum eMixerCommand,
90 int channel);
91 SimpleControl(FireWorks::Device& parent,
92 enum eMixerTarget, enum eMixerCommand,
93 int channel, std::string n);
94 virtual ~SimpleControl();
96 virtual void show();
98 virtual bool setValue( const double );
99 virtual double getValue( );
100 virtual bool setValue(int idx, double v)
101 {return setValue(v);};
102 virtual double getValue(int idx)
103 {return getValue();};
105 virtual double getMinimum() {return -100.0;};
106 virtual double getMaximum() {return 10.0;};
108 protected:
109 EfcGenericMixerCmd* m_Slave;
110 FireWorks::Device& m_ParentDevice;
113 // for on-off type of controls
115 class BinaryControl : public Control::Discrete
118 public:
119 BinaryControl(FireWorks::Device& parent,
120 enum eMixerTarget, enum eMixerCommand,
121 int channel, int bit);
122 BinaryControl(FireWorks::Device& parent,
123 enum eMixerTarget, enum eMixerCommand,
124 int channel, int bit, std::string n);
125 virtual ~BinaryControl();
127 virtual void show();
129 virtual bool setValue( const int );
130 virtual int getValue( );
131 virtual bool setValue(int idx, int v)
132 {return setValue(v);};
133 virtual int getValue(int idx)
134 {return getValue();};
136 virtual int getMinimum() {return 0;};
137 virtual int getMaximum() {return 1;};
138 protected:
139 int m_bit;
140 EfcGenericMixerCmd* m_Slave;
141 FireWorks::Device& m_ParentDevice;
144 class SpdifModeControl : public Control::Discrete
147 public:
148 SpdifModeControl(FireWorks::Device& parent);
149 SpdifModeControl(FireWorks::Device& parent,
150 std::string n);
151 virtual ~SpdifModeControl();
153 virtual void show();
155 virtual bool setValue( const int );
156 virtual int getValue( );
157 virtual bool setValue(int idx, int v)
158 {return setValue(v);};
159 virtual int getValue(int idx)
160 {return getValue();};
162 virtual int getMinimum() {return 0;};
163 virtual int getMaximum() {return 0;};
165 protected:
166 FireWorks::Device& m_ParentDevice;
170 // for on-off type of controls
172 class IOConfigControl : public Control::Discrete
175 public:
176 IOConfigControl(FireWorks::Device& parent,
177 enum eIOConfigRegister);
178 IOConfigControl(FireWorks::Device& parent,
179 enum eIOConfigRegister,
180 std::string n);
181 virtual ~IOConfigControl();
183 virtual void show();
185 virtual bool setValue( const int );
186 virtual int getValue( );
187 virtual bool setValue(int idx, int v)
188 {return setValue(v);};
189 virtual int getValue(int idx)
190 {return getValue();};
192 virtual int getMinimum() {return 0;};
193 virtual int getMaximum() {return 0;};
195 protected:
196 int m_bit;
197 EfcGenericIOConfigCmd* m_Slave;
198 FireWorks::Device& m_ParentDevice;
201 class PlaybackRoutingControl : public Control::Discrete
203 public:
204 PlaybackRoutingControl(FireWorks::Device& parent);
205 PlaybackRoutingControl(FireWorks::Device& parent, std::string n);
207 virtual ~PlaybackRoutingControl();
209 virtual void show();
211 virtual bool setValue(int idx, int v);
212 virtual int getValue(int idx);
214 // not used
215 virtual bool setValue(int v) {return 0;};
216 virtual int getValue() {return 0;};
217 virtual int getMinimum() {return 0;};
218 virtual int getMaximum() {return 0;};
219 private:
220 bool GetState(EfcIsocMapIOConfigCmd *cmd);
221 FireWorks::Device& m_ParentDevice;
224 class HwInfoControl : public Control::Discrete
226 public:
228 enum eHwInfoField {
229 eHIF_PhysicalAudioOutCount,
230 eHIF_PhysicalAudioInCount,
231 eHIF_1394PlaybackCount,
232 eHIF_1394RecordCount,
233 eHIF_GroupOutCount,
234 eHIF_GroupInCount,
235 eHIF_PhantomPower,
236 eHIF_OpticalInterface,
237 eHIF_PlaybackRouting
239 public:
240 HwInfoControl(FireWorks::Device& parent,
241 enum eHwInfoField);
242 HwInfoControl(FireWorks::Device& parent,
243 enum eHwInfoField, std::string n);
244 virtual ~HwInfoControl();
246 virtual void show();
248 virtual bool setValue( const int ) {return false;};
249 virtual int getValue( );
250 virtual bool setValue(int idx, int v)
251 {return setValue(v);};
252 virtual int getValue(int idx)
253 {return getValue();};
255 virtual int getMinimum() {return 0;};
256 virtual int getMaximum() {return 0;};
258 protected:
259 FireWorks::Device& m_ParentDevice;
260 enum eHwInfoField m_Field;
263 class MultiControl : public Control::Discrete
265 public:
267 enum eType {
268 eT_SaveSession,
269 eT_Identify,
271 public:
272 MultiControl(FireWorks::Device& parent, enum eType);
273 MultiControl(FireWorks::Device& parent, enum eType,
274 std::string n);
275 virtual ~MultiControl();
277 virtual void show();
279 virtual bool setValue( const int );
280 virtual int getValue( ) {return 0;};
281 virtual bool setValue(int idx, int v)
282 {return setValue(v);};
283 virtual int getValue(int idx)
284 {return getValue();};
286 virtual int getMinimum() {return 0;};
287 virtual int getMaximum() {return 0;};
289 protected:
290 FireWorks::Device& m_ParentDevice;
291 enum eType m_Type;
294 } // namespace FireWorks
296 #endif