root/trunk/libffado/src/bebob/focusrite/focusrite_saffire.h

Revision 945, 10.9 kB (checked in by ppalmers, 15 years ago)

Add mixer application for the Saffire LE (untested)

Line 
1 /*
2  * Copyright (C) 2005-2008 by Daniel Wagner
3  * Copyright (C) 2005-2008 by Pieter Palmers
4  *
5  * This file is part of FFADO
6  * FFADO = Free Firewire (pro-)audio drivers for linux
7  *
8  * FFADO is based upon FreeBoB.
9  *
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.
14  *
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.
19  *
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/>.
22  *
23  */
24
25 #ifndef BEBOB_FOCUSRITE_SAFFIRE_DEVICE_H
26 #define BEBOB_FOCUSRITE_SAFFIRE_DEVICE_H
27
28 #include "debugmodule/debugmodule.h"
29 #include "focusrite_generic.h"
30
31 #include "libcontrol/BasicElements.h"
32 #include "libcontrol/MatrixMixer.h"
33
34 // -- Original Saffire --
35
36 // The ID's for the hardware input matrix mixer
37 #define FR_SAFFIRE_CMD_ID_IN1_TO_OUT1       1
38 #define FR_SAFFIRE_CMD_ID_IN1_TO_OUT3       2
39 #define FR_SAFFIRE_CMD_ID_IN1_TO_OUT5       3
40 #define FR_SAFFIRE_CMD_ID_IN1_TO_OUT7       4
41 #define FR_SAFFIRE_CMD_ID_IN1_TO_OUT9       0
42 #define FR_SAFFIRE_CMD_ID_IN2_TO_OUT2       16
43 #define FR_SAFFIRE_CMD_ID_IN2_TO_OUT4       17
44 #define FR_SAFFIRE_CMD_ID_IN2_TO_OUT6       18
45 #define FR_SAFFIRE_CMD_ID_IN2_TO_OUT8       19
46 #define FR_SAFFIRE_CMD_ID_IN2_TO_OUT10      15
47 #define FR_SAFFIRE_CMD_ID_IN3_TO_OUT1       6
48 #define FR_SAFFIRE_CMD_ID_IN3_TO_OUT3       7
49 #define FR_SAFFIRE_CMD_ID_IN3_TO_OUT5       8
50 #define FR_SAFFIRE_CMD_ID_IN3_TO_OUT7       9
51 #define FR_SAFFIRE_CMD_ID_IN3_TO_OUT9       5
52 #define FR_SAFFIRE_CMD_ID_IN4_TO_OUT2       21
53 #define FR_SAFFIRE_CMD_ID_IN4_TO_OUT4       22
54 #define FR_SAFFIRE_CMD_ID_IN4_TO_OUT6       23
55 #define FR_SAFFIRE_CMD_ID_IN4_TO_OUT8       24
56 #define FR_SAFFIRE_CMD_ID_IN4_TO_OUT10      20
57
58 // reverb return id's (part of hardware input mixer)
59 #define FR_SAFFIRE_CMD_ID_REV1_TO_OUT1       11
60 #define FR_SAFFIRE_CMD_ID_REV2_TO_OUT2       26
61 #define FR_SAFFIRE_CMD_ID_REV1_TO_OUT3       12
62 #define FR_SAFFIRE_CMD_ID_REV2_TO_OUT4       27
63 #define FR_SAFFIRE_CMD_ID_REV1_TO_OUT5       13
64 #define FR_SAFFIRE_CMD_ID_REV2_TO_OUT6       28
65 #define FR_SAFFIRE_CMD_ID_REV1_TO_OUT7       14
66 #define FR_SAFFIRE_CMD_ID_REV2_TO_OUT8       29
67 #define FR_SAFFIRE_CMD_ID_REV1_TO_OUT9       10
68 #define FR_SAFFIRE_CMD_ID_REV2_TO_OUT10      25
69
70 // The ID's for the playback matrix mixer
71 #define FR_SAFFIRE_CMD_ID_PC12_TO_OUT12     36
72 #define FR_SAFFIRE_CMD_ID_PC12_TO_OUT34     37
73 #define FR_SAFFIRE_CMD_ID_PC12_TO_OUT56     38
74 #define FR_SAFFIRE_CMD_ID_PC12_TO_OUT79     39
75 #define FR_SAFFIRE_CMD_ID_PC12_TO_OUT910    35
76 #define FR_SAFFIRE_CMD_ID_PC34_TO_OUT12     41
77 #define FR_SAFFIRE_CMD_ID_PC34_TO_OUT34     42
78 #define FR_SAFFIRE_CMD_ID_PC34_TO_OUT56     43
79 #define FR_SAFFIRE_CMD_ID_PC34_TO_OUT79     44
80 #define FR_SAFFIRE_CMD_ID_PC34_TO_OUT910    40
81 #define FR_SAFFIRE_CMD_ID_PC56_TO_OUT12     46
82 #define FR_SAFFIRE_CMD_ID_PC56_TO_OUT34     47
83 #define FR_SAFFIRE_CMD_ID_PC56_TO_OUT56     48
84 #define FR_SAFFIRE_CMD_ID_PC56_TO_OUT79     49
85 #define FR_SAFFIRE_CMD_ID_PC56_TO_OUT910    45
86 #define FR_SAFFIRE_CMD_ID_PC78_TO_OUT12     51
87 #define FR_SAFFIRE_CMD_ID_PC78_TO_OUT34     52
88 #define FR_SAFFIRE_CMD_ID_PC78_TO_OUT56     53
89 #define FR_SAFFIRE_CMD_ID_PC78_TO_OUT79     54
90 #define FR_SAFFIRE_CMD_ID_PC78_TO_OUT910    50
91 #define FR_SAFFIRE_CMD_ID_PC910_TO_OUT12    31
92 #define FR_SAFFIRE_CMD_ID_PC910_TO_OUT34    32
93 #define FR_SAFFIRE_CMD_ID_PC910_TO_OUT56    33
94 #define FR_SAFFIRE_CMD_ID_PC910_TO_OUT79    34
95 #define FR_SAFFIRE_CMD_ID_PC910_TO_OUT910   30
96
97 // the control ID's
98 #define FR_SAFFIRE_CMD_ID_BITFIELD_OUT12      55
99 #define FR_SAFFIRE_CMD_ID_BITFIELD_OUT34      56
100 #define FR_SAFFIRE_CMD_ID_BITFIELD_OUT56      57
101 #define FR_SAFFIRE_CMD_ID_BITFIELD_OUT78      58
102 #define FR_SAFFIRE_CMD_ID_BITFIELD_OUT910     59
103
104 #define FR_SAFFIRE_CMD_ID_BITFIELD_BIT_DIM       24
105 #define FR_SAFFIRE_CMD_ID_BITFIELD_BIT_MUTE      25
106 #define FR_SAFFIRE_CMD_ID_BITFIELD_BIT_HWCTRL    26
107
108 // other stuff
109 #define FR_SAFFIRE_CMD_ID_MONITOR_DIAL    61
110 #define FR_SAFFIRE_CMD_ID_SPDIF_SWITCH    62
111
112 #define FR_SAFFIRE_CMD_ID_METERING_IN1      64
113 #define FR_SAFFIRE_CMD_ID_METERING_IN2      65
114 #define FR_SAFFIRE_CMD_ID_METERING_IN3      66
115 #define FR_SAFFIRE_CMD_ID_METERING_IN4      67
116
117 #define FR_SAFFIRE_CMD_ID_SPDIF_DETECT    79
118
119 // -- Saffire LE --
120
121 // The ID's for the hardware input matrix mixer
122 #define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT1       0
123 #define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT2       1
124 #define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT3       2
125 #define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT4       3
126 #define FR_SAFFIRELE_CMD_ID_PC3_TO_OUT1       4
127 #define FR_SAFFIRELE_CMD_ID_PC3_TO_OUT2       5
128 #define FR_SAFFIRELE_CMD_ID_PC3_TO_OUT3       6
129 #define FR_SAFFIRELE_CMD_ID_PC3_TO_OUT4       7
130 #define FR_SAFFIRELE_CMD_ID_PC5_TO_OUT1       8
131 #define FR_SAFFIRELE_CMD_ID_PC5_TO_OUT2       9
132 #define FR_SAFFIRELE_CMD_ID_PC5_TO_OUT3       10
133 #define FR_SAFFIRELE_CMD_ID_PC5_TO_OUT4       11
134 #define FR_SAFFIRELE_CMD_ID_PC7_TO_OUT1       12
135 #define FR_SAFFIRELE_CMD_ID_PC7_TO_OUT2       13
136 #define FR_SAFFIRELE_CMD_ID_PC7_TO_OUT3       14
137 #define FR_SAFFIRELE_CMD_ID_PC7_TO_OUT4       15
138 #define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT1       16
139 #define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT2       17
140 #define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT3       18
141 #define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT4       19
142 #define FR_SAFFIRELE_CMD_ID_PC4_TO_OUT1       20
143 #define FR_SAFFIRELE_CMD_ID_PC4_TO_OUT2       21
144 #define FR_SAFFIRELE_CMD_ID_PC4_TO_OUT3       22
145 #define FR_SAFFIRELE_CMD_ID_PC4_TO_OUT4       23
146 #define FR_SAFFIRELE_CMD_ID_PC6_TO_OUT1       24
147 #define FR_SAFFIRELE_CMD_ID_PC6_TO_OUT2       25
148 #define FR_SAFFIRELE_CMD_ID_PC6_TO_OUT3       26
149 #define FR_SAFFIRELE_CMD_ID_PC6_TO_OUT4       27
150 #define FR_SAFFIRELE_CMD_ID_PC8_TO_OUT1       28
151 #define FR_SAFFIRELE_CMD_ID_PC8_TO_OUT2       29
152 #define FR_SAFFIRELE_CMD_ID_PC8_TO_OUT3       30
153 #define FR_SAFFIRELE_CMD_ID_PC8_TO_OUT4       31
154
155 #define FR_SAFFIRELE_CMD_ID_IN1_TO_OUT1       32
156 #define FR_SAFFIRELE_CMD_ID_IN1_TO_OUT2       33
157 #define FR_SAFFIRELE_CMD_ID_IN1_TO_OUT3       34
158 #define FR_SAFFIRELE_CMD_ID_IN1_TO_OUT4       35
159 #define FR_SAFFIRELE_CMD_ID_IN3_TO_OUT1       36
160 #define FR_SAFFIRELE_CMD_ID_IN3_TO_OUT2       37
161 #define FR_SAFFIRELE_CMD_ID_IN3_TO_OUT3       38
162 #define FR_SAFFIRELE_CMD_ID_IN3_TO_OUT4       39
163 #define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT1    40
164 #define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT2    41
165 #define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT3    42
166 #define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_OUT4    43
167 #define FR_SAFFIRELE_CMD_ID_IN2_TO_OUT1       44
168 #define FR_SAFFIRELE_CMD_ID_IN2_TO_OUT2       45
169 #define FR_SAFFIRELE_CMD_ID_IN2_TO_OUT3       46
170 #define FR_SAFFIRELE_CMD_ID_IN2_TO_OUT4       47
171 #define FR_SAFFIRELE_CMD_ID_IN4_TO_OUT1       48
172 #define FR_SAFFIRELE_CMD_ID_IN4_TO_OUT2       49
173 #define FR_SAFFIRELE_CMD_ID_IN4_TO_OUT3       50
174 #define FR_SAFFIRELE_CMD_ID_IN4_TO_OUT4       51
175 #define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT1    52
176 #define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT2    53
177 #define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT3    54
178 #define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_OUT4    55
179
180 #define FR_SAFFIRELE_CMD_ID_SWAP_OUT4_OUT1_48K   64
181
182 // 96kHz controls
183 #define FR_SAFFIRELE_CMD_ID_IN1_TO_RECMIX_96K        66
184 #define FR_SAFFIRELE_CMD_ID_IN3_TO_RECMIX_96K        67
185 #define FR_SAFFIRELE_CMD_ID_SPDIF1_TO_RECMIX_96K     68
186 #define FR_SAFFIRELE_CMD_ID_IN2_TO_RECMIX_96K        69
187 #define FR_SAFFIRELE_CMD_ID_IN4_TO_RECMIX_96K        70
188 #define FR_SAFFIRELE_CMD_ID_SPDIF2_TO_RECMIX_96K     71
189
190 #define FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT1_96K       72
191 #define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT1_96K          73
192 #define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT1_96K          74
193 #define FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT3_96K       75
194 #define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT3_96K          76
195 #define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT3_96K          77
196 #define FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT2_96K       78
197 #define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT2_96K          79
198 #define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT2_96K          80
199 #define FR_SAFFIRELE_CMD_ID_RECMIX_TO_OUT4_96K       81
200 #define FR_SAFFIRELE_CMD_ID_PC1_TO_OUT4_96K          82
201 #define FR_SAFFIRELE_CMD_ID_PC2_TO_OUT4_96K          83
202
203 #define FR_SAFFIRELE_CMD_ID_SWAP_OUT4_OUT1_96K   84
204
205 // metering
206 #define FR_SAFFIRELE_CMD_ID_METERING_IN1      90
207 #define FR_SAFFIRELE_CMD_ID_METERING_IN3      91
208 #define FR_SAFFIRELE_CMD_ID_METERING_SPDIF1   92
209 #define FR_SAFFIRELE_CMD_ID_METERING_IN2      93
210 #define FR_SAFFIRELE_CMD_ID_METERING_IN4      94
211 #define FR_SAFFIRELE_CMD_ID_METERING_SPDIF2   95
212
213 #define FR_SAFFIRELE_CMD_ID_METERING_OUT1      96
214 #define FR_SAFFIRELE_CMD_ID_METERING_OUT3      97
215 #define FR_SAFFIRELE_CMD_ID_METERING_OUT5      98
216 #define FR_SAFFIRELE_CMD_ID_METERING_OUT7      99
217 #define FR_SAFFIRELE_CMD_ID_METERING_OUT2      100
218 #define FR_SAFFIRELE_CMD_ID_METERING_OUT4      101
219 #define FR_SAFFIRELE_CMD_ID_METERING_OUT6      102
220 #define FR_SAFFIRELE_CMD_ID_METERING_OUT8      103
221
222 #define FR_SAFFIRELE_CMD_ID_METERING_PC1       104
223 #define FR_SAFFIRELE_CMD_ID_METERING_PC3       105
224 #define FR_SAFFIRELE_CMD_ID_METERING_PC2       106
225 #define FR_SAFFIRELE_CMD_ID_METERING_PC4       107
226
227 // other stuff
228 #define FR_SAFFIRELE_CMD_ID_HIGH_GAIN_LINE3   85
229 #define FR_SAFFIRELE_CMD_ID_HIGH_GAIN_LINE4   86
230
231 #define FR_SAFFIRELE_CMD_ID_BITFIELD_OUT12      87
232 #define FR_SAFFIRELE_CMD_ID_BITFIELD_OUT34      88
233 #define FR_SAFFIRELE_CMD_ID_BITFIELD_OUT56      89
234
235 #define FR_SAFFIRELE_CMD_ID_BITFIELD_BIT_MUTE      25
236 #define FR_SAFFIRELE_CMD_ID_BITFIELD_BIT_HWCTRL    26
237
238 #define FR_SAFFIRELE_CMD_ID_EXT_CLOCK_LOCK       108
239 #define FR_SAFFIRELE_CMD_ID_AUDIO_ON             109
240 #define FR_SAFFIRELE_CMD_ID_SAVE_SETTINGS        110
241 #define FR_SAFFIRELE_CMD_ID_MIDITHRU             111
242 #define FR_SAFFIRELE_CMD_ID_SPDIF_TRANSPARENT    112
243
244
245 namespace BeBoB {
246 namespace Focusrite {
247
248 class SaffireDevice;
249
250 class SaffireMatrixMixer : public FocusriteMatrixMixer
251 {
252 public:
253     enum eMatrixMixerType {
254         eMMT_InputMix,
255         eMMT_PCMix,
256         eMMT_LEMix48,
257         eMMT_LEMix96,
258     };
259 public:
260     SaffireMatrixMixer(SaffireDevice& parent, enum eMatrixMixerType type);
261     SaffireMatrixMixer(SaffireDevice& parent, enum eMatrixMixerType type, std::string n);
262     virtual ~SaffireMatrixMixer() {};
263
264     virtual void show();
265
266 protected:
267     void init();
268     enum eMatrixMixerType m_type;
269 };
270
271 class SaffireDevice : public FocusriteDevice {
272 public:
273     SaffireDevice(DeviceManager& d, std::auto_ptr<ConfigRom>( configRom ));
274     virtual ~SaffireDevice() {};
275
276     virtual void showDevice();
277     virtual void setVerboseLevel(int l);
278
279     virtual bool buildMixer();
280     virtual bool destroyMixer();
281
282 private:
283     Control::Container *m_MixerContainer;
284     bool m_isSaffireLE;
285 };
286
287 } // namespace Focusrite
288 } // namespace BeBoB
289
290 #endif
Note: See TracBrowser for help on using the browser.