1 |
/* |
---|
2 |
* Copyright (C) 2007 by Pieter Palmers |
---|
3 |
* |
---|
4 |
* This file is part of FFADO |
---|
5 |
* FFADO = Free Firewire (pro-)audio drivers for linux |
---|
6 |
* |
---|
7 |
* FFADO is based upon FreeBoB |
---|
8 |
* |
---|
9 |
* This library is free software; you can redistribute it and/or |
---|
10 |
* modify it under the terms of the GNU Lesser General Public |
---|
11 |
* License version 2.1, as published by the Free Software Foundation; |
---|
12 |
* |
---|
13 |
* This library is distributed in the hope that it will be useful, |
---|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 |
* Lesser General Public License for more details. |
---|
17 |
* |
---|
18 |
* You should have received a copy of the GNU Lesser General Public |
---|
19 |
* License along with this library; if not, write to the Free Software |
---|
20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
---|
21 |
* MA 02110-1301 USA |
---|
22 |
*/ |
---|
23 |
|
---|
24 |
#ifndef FIREWORKS_EFC_CMD_MIXER_H |
---|
25 |
#define FIREWORKS_EFC_CMD_MIXER_H |
---|
26 |
|
---|
27 |
#include "efc_cmd.h" |
---|
28 |
|
---|
29 |
namespace FireWorks { |
---|
30 |
|
---|
31 |
enum eMixerTarget { |
---|
32 |
eMT_PhysicalOutputMix, |
---|
33 |
eMT_PhysicalInputMix, |
---|
34 |
eMT_PlaybackMix, |
---|
35 |
eMT_RecordMix, |
---|
36 |
}; |
---|
37 |
enum eMixerCommand { |
---|
38 |
eMC_Gain, |
---|
39 |
eMC_Solo, |
---|
40 |
eMC_Mute, |
---|
41 |
eMC_Pan, |
---|
42 |
eMC_Nominal, |
---|
43 |
}; |
---|
44 |
|
---|
45 |
class EfcGenericMixerCmd : public EfcCmd |
---|
46 |
{ |
---|
47 |
public: |
---|
48 |
enum eCmdType { |
---|
49 |
eCT_Get, |
---|
50 |
eCT_Set, |
---|
51 |
}; |
---|
52 |
public: |
---|
53 |
EfcGenericMixerCmd(enum eCmdType, enum eMixerTarget, enum eMixerCommand); |
---|
54 |
virtual ~EfcGenericMixerCmd() {}; |
---|
55 |
|
---|
56 |
virtual bool serialize( Util::IOSSerialize& se ); |
---|
57 |
virtual bool deserialize( Util::IISDeserialize& de ); |
---|
58 |
|
---|
59 |
virtual void showEfcCmd(); |
---|
60 |
|
---|
61 |
int32_t m_channel; |
---|
62 |
uint32_t m_value; |
---|
63 |
|
---|
64 |
private: |
---|
65 |
enum eCmdType m_type; |
---|
66 |
enum eMixerTarget m_target; |
---|
67 |
enum eMixerCommand m_command; |
---|
68 |
}; |
---|
69 |
|
---|
70 |
// --- Specific implementations |
---|
71 |
class EfcGetGainCmd : public EfcGenericMixerCmd |
---|
72 |
{ |
---|
73 |
public: |
---|
74 |
EfcGetGainCmd(enum eMixerTarget t) |
---|
75 |
: EfcGenericMixerCmd(eCT_Get, t, eMC_Gain) {}; |
---|
76 |
virtual ~EfcGetGainCmd() {}; |
---|
77 |
|
---|
78 |
virtual const char* getCmdName() const |
---|
79 |
{ return "EfcGetGainCmd"; } |
---|
80 |
}; |
---|
81 |
class EfcSetGainCmd : public EfcGenericMixerCmd |
---|
82 |
{ |
---|
83 |
public: |
---|
84 |
EfcSetGainCmd(enum eMixerTarget t) |
---|
85 |
: EfcGenericMixerCmd(eCT_Set, t, eMC_Gain) {}; |
---|
86 |
virtual ~EfcSetGainCmd() {}; |
---|
87 |
|
---|
88 |
virtual const char* getCmdName() const |
---|
89 |
{ return "EfcSetGainCmd"; } |
---|
90 |
}; |
---|
91 |
|
---|
92 |
class EfcGetSoloCmd : public EfcGenericMixerCmd |
---|
93 |
{ |
---|
94 |
public: |
---|
95 |
EfcGetSoloCmd(enum eMixerTarget t) |
---|
96 |
: EfcGenericMixerCmd(eCT_Get, t, eMC_Solo) {}; |
---|
97 |
virtual ~EfcGetSoloCmd() {}; |
---|
98 |
|
---|
99 |
virtual const char* getCmdName() const |
---|
100 |
{ return "EfcGetSoloCmd"; } |
---|
101 |
}; |
---|
102 |
class EfcSetSoloCmd : public EfcGenericMixerCmd |
---|
103 |
{ |
---|
104 |
public: |
---|
105 |
EfcSetSoloCmd(enum eMixerTarget t) |
---|
106 |
: EfcGenericMixerCmd(eCT_Set, t, eMC_Solo) {}; |
---|
107 |
virtual ~EfcSetSoloCmd() {}; |
---|
108 |
|
---|
109 |
virtual const char* getCmdName() const |
---|
110 |
{ return "EfcSetSoloCmd"; } |
---|
111 |
}; |
---|
112 |
|
---|
113 |
class EfcGetMuteCmd : public EfcGenericMixerCmd |
---|
114 |
{ |
---|
115 |
public: |
---|
116 |
EfcGetMuteCmd(enum eMixerTarget t) |
---|
117 |
: EfcGenericMixerCmd(eCT_Get, t, eMC_Mute) {}; |
---|
118 |
virtual ~EfcGetMuteCmd() {}; |
---|
119 |
|
---|
120 |
virtual const char* getCmdName() const |
---|
121 |
{ return "EfcGetMuteCmd"; } |
---|
122 |
}; |
---|
123 |
class EfcSetMuteCmd : public EfcGenericMixerCmd |
---|
124 |
{ |
---|
125 |
public: |
---|
126 |
EfcSetMuteCmd(enum eMixerTarget t) |
---|
127 |
: EfcGenericMixerCmd(eCT_Set, t, eMC_Mute) {}; |
---|
128 |
virtual ~EfcSetMuteCmd() {}; |
---|
129 |
|
---|
130 |
virtual const char* getCmdName() const |
---|
131 |
{ return "EfcSetMuteCmd"; } |
---|
132 |
}; |
---|
133 |
|
---|
134 |
class EfcGetPanCmd : public EfcGenericMixerCmd |
---|
135 |
{ |
---|
136 |
public: |
---|
137 |
EfcGetPanCmd(enum eMixerTarget t) |
---|
138 |
: EfcGenericMixerCmd(eCT_Get, t, eMC_Pan) {}; |
---|
139 |
virtual ~EfcGetPanCmd() {}; |
---|
140 |
|
---|
141 |
virtual const char* getCmdName() const |
---|
142 |
{ return "EfcGetPanCmd"; } |
---|
143 |
}; |
---|
144 |
class EfcSetPanCmd : public EfcGenericMixerCmd |
---|
145 |
{ |
---|
146 |
public: |
---|
147 |
EfcSetPanCmd(enum eMixerTarget t) |
---|
148 |
: EfcGenericMixerCmd(eCT_Set, t, eMC_Pan) {}; |
---|
149 |
virtual ~EfcSetPanCmd() {}; |
---|
150 |
|
---|
151 |
virtual const char* getCmdName() const |
---|
152 |
{ return "EfcSetPanCmd"; } |
---|
153 |
}; |
---|
154 |
|
---|
155 |
class EfcGetNominalCmd : public EfcGenericMixerCmd |
---|
156 |
{ |
---|
157 |
public: |
---|
158 |
EfcGetNominalCmd(enum eMixerTarget t) |
---|
159 |
: EfcGenericMixerCmd(eCT_Get, t, eMC_Nominal) {}; |
---|
160 |
virtual ~EfcGetNominalCmd() {}; |
---|
161 |
|
---|
162 |
virtual const char* getCmdName() const |
---|
163 |
{ return "EfcGetNominalCmd"; } |
---|
164 |
}; |
---|
165 |
class EfcSetNominalCmd : public EfcGenericMixerCmd |
---|
166 |
{ |
---|
167 |
public: |
---|
168 |
EfcSetNominalCmd(enum eMixerTarget t) |
---|
169 |
: EfcGenericMixerCmd(eCT_Set, t, eMC_Nominal) {}; |
---|
170 |
virtual ~EfcSetNominalCmd() {}; |
---|
171 |
|
---|
172 |
virtual const char* getCmdName() const |
---|
173 |
{ return "EfcSetNominalCmd"; } |
---|
174 |
}; |
---|
175 |
|
---|
176 |
} // namespace FireWorks |
---|
177 |
|
---|
178 |
#endif // FIREWORKS_EFC_CMD_MIXER_H |
---|