root/trunk/libffado/support/mixer-qt4/ffado/mixer/saffire.py

Revision 1691, 27.0 kB (checked in by arnonym, 11 years ago)

Only load the mixerwidgets that are actually needed.

To automate this, a rules are imposed:

The filename has to be the lower-case variant of the mixer name

This should speed up loading time of ffado-mixer. Please everybody test this and report any errors as I don't have all the devices to test everything fully.

  • Property svn:mergeinfo set to
Line 
1 #
2 # Copyright (C) 2005-2008 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 program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 2 of the License, or
12 # (at your option) version 3 of the License.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 #
22
23 from PyQt4.QtCore import SIGNAL, SLOT, QObject
24 from PyQt4.QtGui import QWidget, QHBoxLayout
25 from ffado.config import *
26 from ffado.mixer.saffire_base import SaffireMixerBase
27
28 import logging
29 log = logging.getLogger('saffire')
30
31 #MIXER LAYOUT:
32 #
33 #   |-- Out9/10--| |-- Out1/2 --| |-- Out3/4 --| |-- Out5/6 --| |-- Out7/8 --|
34 #P5  0:    0/    0  1:  110/  110  2:    0/    0  3:    0/    0  4:    0/    0
35 #P1  5:    0/    0  6:32767/32767  7:    0/    0  8:    0/    0  9:    0/    0
36 #P2 10:    0/    0 11:    0/    0 12:32767/32767 13:    0/    0 14:    0/    0
37 #P3 15:    0/    0 16:    0/    0 17:    0/    0 18:32767/32767 19:    0/    0
38 #P4 20:    0/    0 21:    0/    0 22:    0/    0 23:    0/    0 24:32767/32767
39 #R1 25:    0/    0 26:    0/    0 27:    0/    0 28:    0/    0 29:    0/    0
40 #R2 30:    0/    0 31:    0/    0 32:    0/    0 33:    0/    0 34:    0/    0
41 #Fx 35:    0/    0 36:    0/    0 37:    0/    0 38:    0/    0 39:    0/    0
42 #
43 #P5: DAW ch 9/10
44 #P1: DAW ch 1/2
45 #P2: DAW ch 3/4
46 #P3: DAW ch 5/6
47 #P4: DAW ch 7/8
48 #R1: HW INPUT ch 1/2
49 #R2: HW INPUT ch 3/4
50 #Fx: reverb/fx return
51
52 class Saffire(QWidget):
53     def __init__(self,parent = None):
54         QWidget.__init__(self, parent)
55
56         self.mono_mode = False
57         self.is_saffire_le = False
58
59         # make a layout
60         self.layout = QHBoxLayout()
61         self.setLayout(self.layout)
62
63     def show(self):
64         self.selectCorrectMode()
65         QWidget.show(self)
66
67     def getMonoMode(self):
68         return self.hw.getDiscrete('/Mixer/MonoMode')
69     def setMonoMode(self, mode):
70         if mode:
71             self.hw.setDiscrete('/Mixer/MonoMode', 1)
72         else:
73             self.hw.setDiscrete('/Mixer/MonoMode', 0)
74         self.mono_mode = self.getMonoMode()
75
76     def getDisplayTitle(self):
77         if self.is_saffire_le:
78             return "SaffireLE"
79         else:
80             return "Saffire"
81
82     def selectCorrectMode(self):
83         if self.is_saffire_le:
84             if self.samplerate <= 48000:
85                 log.debug("large")
86                 self.small.hide()
87                 self.large.initValues()
88                 self.large.show()
89             else:
90                 log.debug("small")
91                 self.large.hide()
92                 self.small.initValues()
93                 self.small.show()
94         else:
95             if self.mono_mode:
96                 self.stereo.hide()
97                 self.mono.initValues()
98                 self.mono.show()
99             else:
100                 self.mono.hide()
101                 self.stereo.initValues()
102                 self.stereo.show()
103
104     def initValues(self):
105         selected = self.samplerateselect.selected()
106         self.samplerate = int(self.samplerateselect.getEnumLabel( selected ))
107
108         # Saffire:        0x130e010001????
109         # SaffireLE:    0x130e010004????
110         if int(self.configrom.getGUID(), 16) >= 0x130e0100040000:
111             self.is_saffire_le = True
112             log.debug("Found SaffireLE GUID")
113         else:
114             self.is_saffire_le = False
115             log.debug("Found Saffire GUID")
116
117         # init depending on what device we have
118         # and what mode it is in
119         if self.is_saffire_le:
120             # create the child widgets
121             self.small = SaffireLEMixerSmall(self)
122             self.layout.addWidget(self.small)
123             self.large = SaffireLEMixerLarge(self)
124             self.layout.addWidget(self.large)
125
126             self.small.hw = self.hw
127             self.small.configrom = self.configrom
128
129             self.large.hw = self.hw
130             self.large.configrom = self.configrom
131         else:
132             # create the child widgets
133             self.mono = SaffireMixerMono(self)
134             self.layout.addWidget(self.mono)
135             self.stereo = SaffireMixerStereo(self)
136             self.layout.addWidget(self.stereo)
137
138             self.mono_mode = self.getMonoMode()
139
140             self.mono.hw = self.hw
141             self.mono.configrom = self.configrom
142
143             self.stereo.hw = self.hw
144             self.stereo.configrom = self.configrom
145
146         self.selectCorrectMode()
147
148     def polledUpdate(self):
149         if self.is_saffire_le:
150             if self.samplerate <= 48000:
151                 self.large.polledUpdate()
152             else:
153                 self.small.polledUpdate()
154         else:
155             if self.mono_mode:
156                 self.mono.polledUpdate()
157             else:
158                 self.stereo.polledUpdate()
159
160 class SaffireMixerStereo(QWidget, SaffireMixerBase):
161     def __init__(self,parent = None):
162         self.my_parent = parent
163         QWidget.__init__(self,parent)
164         uicLoad("ffado/mixer/saffire_stereo", self)
165         SaffireMixerBase.__init__(self)
166         QObject.connect(self.btnRefresh, SIGNAL('clicked()'), self.updateValues)
167         QObject.connect(self.btnSwitchStereoMode, SIGNAL('clicked()'), self.switchStereoMode)
168
169         self.VolumeControls={
170                 self.sldPC910Out910: ['/Mixer/MatrixMixerStereo', 0, 0],
171                 self.sldPC910Out12: ['/Mixer/MatrixMixerStereo', 0, 1],
172                 self.sldPC910Out34: ['/Mixer/MatrixMixerStereo', 0, 2],
173                 self.sldPC910Out56: ['/Mixer/MatrixMixerStereo', 0, 3],
174                 self.sldPC910Out78: ['/Mixer/MatrixMixerStereo', 0, 4],
175                 self.sldPC12Out910: ['/Mixer/MatrixMixerStereo', 1, 0],
176                 self.sldPC12Out12: ['/Mixer/MatrixMixerStereo', 1, 1],
177                 self.sldPC12Out34: ['/Mixer/MatrixMixerStereo', 1, 2],
178                 self.sldPC12Out56: ['/Mixer/MatrixMixerStereo', 1, 3],
179                 self.sldPC12Out78: ['/Mixer/MatrixMixerStereo', 1, 4],
180                 self.sldPC34Out910: ['/Mixer/MatrixMixerStereo', 2, 0],
181                 self.sldPC34Out12: ['/Mixer/MatrixMixerStereo', 2, 1],
182                 self.sldPC34Out34: ['/Mixer/MatrixMixerStereo', 2, 2],
183                 self.sldPC34Out56: ['/Mixer/MatrixMixerStereo', 2, 3],
184                 self.sldPC34Out78: ['/Mixer/MatrixMixerStereo', 2, 4],
185                 self.sldPC56Out910: ['/Mixer/MatrixMixerStereo', 3, 0],
186                 self.sldPC56Out12: ['/Mixer/MatrixMixerStereo', 3, 1],
187                 self.sldPC56Out34: ['/Mixer/MatrixMixerStereo', 3, 2],
188                 self.sldPC56Out56: ['/Mixer/MatrixMixerStereo', 3, 3],
189                 self.sldPC56Out78: ['/Mixer/MatrixMixerStereo', 3, 4],
190                 self.sldPC78Out910: ['/Mixer/MatrixMixerStereo', 4, 0],
191                 self.sldPC78Out12: ['/Mixer/MatrixMixerStereo', 4, 1],
192                 self.sldPC78Out34: ['/Mixer/MatrixMixerStereo', 4, 2],
193                 self.sldPC78Out56: ['/Mixer/MatrixMixerStereo', 4, 3],
194                 self.sldPC78Out78: ['/Mixer/MatrixMixerStereo', 4, 4],
195
196                 self.sldIN12Out910: ['/Mixer/MatrixMixerStereo', 5, 0],
197                 self.sldIN12Out12: ['/Mixer/MatrixMixerStereo', 5, 1],
198                 self.sldIN12Out34: ['/Mixer/MatrixMixerStereo', 5, 2],
199                 self.sldIN12Out56: ['/Mixer/MatrixMixerStereo', 5, 3],
200                 self.sldIN12Out78: ['/Mixer/MatrixMixerStereo', 5, 4],
201                 self.sldIN34Out910: ['/Mixer/MatrixMixerStereo', 6, 0],
202                 self.sldIN34Out12: ['/Mixer/MatrixMixerStereo', 6, 1],
203                 self.sldIN34Out34: ['/Mixer/MatrixMixerStereo', 6, 2],
204                 self.sldIN34Out56: ['/Mixer/MatrixMixerStereo', 6, 3],
205                 self.sldIN34Out78: ['/Mixer/MatrixMixerStereo', 6, 4],
206
207                 self.sldFXOut910: ['/Mixer/MatrixMixerStereo', 7, 0],
208                 self.sldFXOut12: ['/Mixer/MatrixMixerStereo', 7, 1],
209                 self.sldFXOut34: ['/Mixer/MatrixMixerStereo', 7, 2],
210                 self.sldFXOut56: ['/Mixer/MatrixMixerStereo', 7, 3],
211                 self.sldFXOut78: ['/Mixer/MatrixMixerStereo', 7, 4],
212                 }
213
214
215         # First column is the DBUS subpath of the control.
216         # Second column is a list of linked controls that should
217         # be rewritten whenever this control is updated
218         self.SelectorControls={
219                 self.chkSpdifSwitch:    ['/Mixer/SpdifSwitch'],
220                 self.chkOut12Mute:      ['/Mixer/Out12Mute', [self.chkOut12HwCtrl]],
221                 self.chkOut12HwCtrl:    ['/Mixer/Out12HwCtrl'],
222                 self.chkOut12Dim:       ['/Mixer/Out12Dim'],
223                 self.chkOut34Mute:      ['/Mixer/Out34Mute', [self.chkOut34HwCtrl]],
224                 self.chkOut34HwCtrl:    ['/Mixer/Out34HwCtrl'],
225                 self.chkOut56Mute:      ['/Mixer/Out56Mute', [self.chkOut56HwCtrl]],
226                 self.chkOut56HwCtrl:    ['/Mixer/Out56HwCtrl'],
227                 self.chkOut78Mute:      ['/Mixer/Out78Mute', [self.chkOut78HwCtrl]],
228                 self.chkOut78HwCtrl:    ['/Mixer/Out78HwCtrl'],
229                 self.chkOut910Mute:     ['/Mixer/Out910Mute'],
230                 }
231
232         self.VolumeControlsLowRes={
233                 self.sldOut12Level:      ['/Mixer/Out12Level'],
234                 self.sldOut34Level:      ['/Mixer/Out34Level'],
235                 self.sldOut56Level:      ['/Mixer/Out56Level'],
236                 self.sldOut78Level:      ['/Mixer/Out78Level'],
237                 }
238
239         self.TriggerButtonControls={
240                 self.btnSaveSettings:      ['/Mixer/SaveSettings'],
241         }
242
243         self.TextControls={
244         }
245
246         self.saveTextControls={
247         }
248
249         self.ComboControls={
250         }
251
252     def polledUpdate(self):
253         self.polledUpdateHwCtrl(self.chkOut12HwCtrl, self.sldOut12Level)
254         self.polledUpdateHwCtrl(self.chkOut34HwCtrl, self.sldOut34Level)
255         self.polledUpdateHwCtrl(self.chkOut56HwCtrl, self.sldOut56Level)
256         self.polledUpdateHwCtrl(self.chkOut78HwCtrl, self.sldOut78Level)
257
258     def polledUpdateHwCtrl(self, selector, volctrl):
259         state = selector.isChecked()
260         if state:
261             self.polledUpdateVolumeLowRes('/Mixer/MonitorDial', volctrl, 64)
262             volctrl.setEnabled(False)
263         else:
264             volctrl.setEnabled(True)
265
266     def updateMatrixVolume(self,a0):
267         SaffireMixerBase.updateMatrixVolume(self,a0)
268     def updateLowResVolume(self,a0):
269         SaffireMixerBase.updateLowResVolume(self,a0)
270     def updateSelector(self,a0):
271         SaffireMixerBase.updateSelector(self,a0)
272     def triggerButton(self):
273         SaffireMixerBase.triggerButton(self)
274     def saveText(self):
275         SaffireMixerBase.saveText(self)
276     def initCombo(self, combo):
277         SaffireMixerBase.initCombo(self,combo)
278     def selectCombo(self, mode):
279         SaffireMixerBase.selectCombo(self,mode)
280
281     def updateValues(self):
282         SaffireMixerBase.updateValues(self)
283     def switchStereoMode(self):
284         log.debug("should switch to mono mode")
285         self.my_parent.setMonoMode(1)
286         self.my_parent.selectCorrectMode()
287
288 class SaffireMixerMono(QWidget, SaffireMixerBase):
289     def __init__(self,parent = None):
290         self.my_parent = parent
291         QWidget.__init__(self,parent)
292         uicLoad("ffado/mixer/saffire_stereo", self)
293         SaffireMixerBase.__init__(self)
294         QObject.connect(self.btnRefresh, SIGNAL('clicked()'), self.updateValues)
295         QObject.connect(self.btnSwitchStereoMode, SIGNAL('clicked()'), self.switchStereoMode)
296
297         self.VolumeControls={
298                 self.sldIN1Out910: ['/Mixer/MatrixMixerMono', 0, 0],
299                 self.sldIN1Out12: ['/Mixer/MatrixMixerMono', 0, 1],
300                 self.sldIN1Out34: ['/Mixer/MatrixMixerMono', 0, 2],
301                 self.sldIN1Out56: ['/Mixer/MatrixMixerMono', 0, 3],
302                 self.sldIN1Out78: ['/Mixer/MatrixMixerMono', 0, 4],
303                 self.sldIN3Out910: ['/Mixer/MatrixMixerMono', 1, 0],
304                 self.sldIN3Out12: ['/Mixer/MatrixMixerMono', 1, 1],
305                 self.sldIN3Out34: ['/Mixer/MatrixMixerMono', 1, 2],
306                 self.sldIN3Out56: ['/Mixer/MatrixMixerMono', 1, 3],
307                 self.sldIN3Out78: ['/Mixer/MatrixMixerMono', 1, 4],
308                 self.sldFX1Out910: ['/Mixer/MatrixMixerMono', 2, 0],
309                 self.sldFX1Out12: ['/Mixer/MatrixMixerMono', 2, 1],
310                 self.sldFX1Out34: ['/Mixer/MatrixMixerMono', 2, 2],
311                 self.sldFX1Out56: ['/Mixer/MatrixMixerMono', 2, 3],
312                 self.sldFX1Out78: ['/Mixer/MatrixMixerMono', 2, 4],
313                 self.sldIN2Out910: ['/Mixer/MatrixMixerMono', 3, 0],
314                 self.sldIN2Out12: ['/Mixer/MatrixMixerMono', 3, 1],
315                 self.sldIN2Out34: ['/Mixer/MatrixMixerMono', 3, 2],
316                 self.sldIN2Out56: ['/Mixer/MatrixMixerMono', 3, 3],
317                 self.sldIN2Out78: ['/Mixer/MatrixMixerMono', 3, 4],
318                 self.sldIN4Out910: ['/Mixer/MatrixMixerMono', 4, 0],
319                 self.sldIN4Out12: ['/Mixer/MatrixMixerMono', 4, 1],
320                 self.sldIN4Out34: ['/Mixer/MatrixMixerMono', 4, 2],
321                 self.sldIN4Out56: ['/Mixer/MatrixMixerMono', 4, 3],
322                 self.sldIN4Out78: ['/Mixer/MatrixMixerMono', 4, 4],
323                 self.sldFX2Out910: ['/Mixer/MatrixMixerMono', 5, 0],
324                 self.sldFX2Out12: ['/Mixer/MatrixMixerMono', 5, 1],
325                 self.sldFX2Out34: ['/Mixer/MatrixMixerMono', 5, 2],
326                 self.sldFX2Out56: ['/Mixer/MatrixMixerMono', 5, 3],
327                 self.sldFX2Out78: ['/Mixer/MatrixMixerMono', 5, 4],
328
329                 self.sldPC910Out910: ['/Mixer/MatrixMixerMono', 6, 0],
330                 self.sldPC910Out12: ['/Mixer/MatrixMixerMono', 6, 1],
331                 self.sldPC910Out34: ['/Mixer/MatrixMixerMono', 6, 2],
332                 self.sldPC910Out56: ['/Mixer/MatrixMixerMono', 6, 3],
333                 self.sldPC910Out78: ['/Mixer/MatrixMixerMono', 6, 4],
334                 self.sldPC12Out910: ['/Mixer/MatrixMixerMono', 7, 0],
335                 self.sldPC12Out12: ['/Mixer/MatrixMixerMono', 7, 1],
336                 self.sldPC12Out34: ['/Mixer/MatrixMixerMono', 7, 2],
337                 self.sldPC12Out56: ['/Mixer/MatrixMixerMono', 7, 3],
338                 self.sldPC12Out78: ['/Mixer/MatrixMixerMono', 7, 4],
339                 self.sldPC34Out910: ['/Mixer/MatrixMixerMono', 8, 0],
340                 self.sldPC34Out12: ['/Mixer/MatrixMixerMono', 8, 1],
341                 self.sldPC34Out34: ['/Mixer/MatrixMixerMono', 8, 2],
342                 self.sldPC34Out56: ['/Mixer/MatrixMixerMono', 8, 3],
343                 self.sldPC34Out78: ['/Mixer/MatrixMixerMono', 8, 4],
344                 self.sldPC56Out910: ['/Mixer/MatrixMixerMono', 9, 0],
345                 self.sldPC56Out12: ['/Mixer/MatrixMixerMono', 9, 1],
346                 self.sldPC56Out34: ['/Mixer/MatrixMixerMono', 9, 2],
347                 self.sldPC56Out56: ['/Mixer/MatrixMixerMono', 9, 3],
348                 self.sldPC56Out78: ['/Mixer/MatrixMixerMono', 9, 4],
349                 self.sldPC78Out910: ['/Mixer/MatrixMixerMono', 10, 0],
350                 self.sldPC78Out12: ['/Mixer/MatrixMixerMono', 10, 1],
351                 self.sldPC78Out34: ['/Mixer/MatrixMixerMono', 10, 2],
352                 self.sldPC78Out56: ['/Mixer/MatrixMixerMono', 10, 3],
353                 self.sldPC78Out78: ['/Mixer/MatrixMixerMono', 10, 4],
354
355
356                 }
357
358
359         # First column is the DBUS subpath of the control.
360         # Second column is a list of linked controls that should
361         # be rewritten whenever this control is updated
362         self.SelectorControls={
363                 self.chkSpdifSwitch:    ['/Mixer/SpdifSwitch'],
364                 self.chkOut12Mute:      ['/Mixer/Out12Mute', [self.chkOut12HwCtrl]],
365                 self.chkOut12HwCtrl:    ['/Mixer/Out12HwCtrl'],
366                 self.chkOut12Dim:       ['/Mixer/Out12Dim'],
367                 self.chkOut34Mute:      ['/Mixer/Out34Mute', [self.chkOut34HwCtrl]],
368                 self.chkOut34HwCtrl:    ['/Mixer/Out34HwCtrl'],
369                 self.chkOut56Mute:      ['/Mixer/Out56Mute', [self.chkOut56HwCtrl]],
370                 self.chkOut56HwCtrl:    ['/Mixer/Out56HwCtrl'],
371                 self.chkOut78Mute:      ['/Mixer/Out78Mute', [self.chkOut78HwCtrl]],
372                 self.chkOut78HwCtrl:    ['/Mixer/Out78HwCtrl'],
373                 self.chkOut910Mute:     ['/Mixer/Out910Mute'],
374                 }
375
376         self.VolumeControlsLowRes={
377                 self.sldOut12Level:      ['/Mixer/Out12Level'],
378                 self.sldOut34Level:      ['/Mixer/Out34Level'],
379                 self.sldOut56Level:      ['/Mixer/Out56Level'],
380                 self.sldOut78Level:      ['/Mixer/Out78Level'],
381                 }
382
383         self.TriggerButtonControls={
384                 self.btnSaveSettings:      ['/Mixer/SaveSettings'],
385         }
386
387         self.TextControls={
388         }
389
390         self.saveTextControls={
391         }
392
393         self.ComboControls={
394         }
395
396     def polledUpdate(self):
397         self.polledUpdateHwCtrl(self.chkOut12HwCtrl, self.sldOut12Level)
398         self.polledUpdateHwCtrl(self.chkOut34HwCtrl, self.sldOut34Level)
399         self.polledUpdateHwCtrl(self.chkOut56HwCtrl, self.sldOut56Level)
400         self.polledUpdateHwCtrl(self.chkOut78HwCtrl, self.sldOut78Level)
401
402     def polledUpdateHwCtrl(self, selector, volctrl):
403         state = selector.isChecked()
404         if state:
405             self.polledUpdateVolumeLowRes('/Mixer/MonitorDial', volctrl, 4)
406             volctrl.setEnabled(False)
407         else:
408             volctrl.setEnabled(True)
409
410     def updateMatrixVolume(self,a0):
411         SaffireMixerBase.updateMatrixVolume(self,a0)
412     def updateLowResVolume(self,a0):
413         SaffireMixerBase.updateLowResVolume(self,a0)
414     def updateSelector(self,a0):
415         SaffireMixerBase.updateSelector(self,a0)
416     def triggerButton(self):
417         SaffireMixerBase.triggerButton(self)
418     def saveText(self):
419         SaffireMixerBase.saveText(self)
420     def initCombo(self, combo):
421         SaffireMixerBase.initCombo(self,combo)
422     def selectCombo(self, mode):
423         SaffireMixerBase.selectCombo(self,mode)
424
425     def updateValues(self):
426         SaffireMixerBase.updateValues(self)
427
428     def switchStereoMode(self):
429         log.debug("should switch to stereo mode")
430         self.my_parent.setMonoMode(0)
431         self.my_parent.selectCorrectMode()
432
433 class SaffireLEMixerLarge(QWidget, SaffireMixerBase):
434     def __init__(self,parent = None):
435         self.my_parent = parent
436         QWidget.__init__(self,parent)
437         uicLoad("ffado/mixer/saffirele_large", self)
438         SaffireMixerBase.__init__(self)
439
440         log.debug("Init large Saffire LE mixer window")
441
442         self.VolumeControls={
443                 self.sldIN1Out1: ['/Mixer/LEMix48', 0, 0],
444                 self.sldIN1Out2: ['/Mixer/LEMix48', 0, 1],
445                 self.sldIN1Out3: ['/Mixer/LEMix48', 0, 2],
446                 self.sldIN1Out4: ['/Mixer/LEMix48', 0, 3],
447                 self.sldIN2Out1: ['/Mixer/LEMix48', 1, 0],
448                 self.sldIN2Out2: ['/Mixer/LEMix48', 1, 1],
449                 self.sldIN2Out3: ['/Mixer/LEMix48', 1, 2],
450                 self.sldIN2Out4: ['/Mixer/LEMix48', 1, 3],
451                 self.sldIN3Out1: ['/Mixer/LEMix48', 2, 0],
452                 self.sldIN3Out2: ['/Mixer/LEMix48', 2, 1],
453                 self.sldIN3Out3: ['/Mixer/LEMix48', 2, 2],
454                 self.sldIN3Out4: ['/Mixer/LEMix48', 2, 3],
455                 self.sldIN4Out1: ['/Mixer/LEMix48', 3, 0],
456                 self.sldIN4Out2: ['/Mixer/LEMix48', 3, 1],
457                 self.sldIN4Out3: ['/Mixer/LEMix48', 3, 2],
458                 self.sldIN4Out4: ['/Mixer/LEMix48', 3, 3],
459                 self.sldSPDIF1Out1: ['/Mixer/LEMix48', 4, 0],
460                 self.sldSPDIF1Out2: ['/Mixer/LEMix48', 4, 1],
461                 self.sldSPDIF1Out3: ['/Mixer/LEMix48', 4, 2],
462                 self.sldSPDIF1Out4: ['/Mixer/LEMix48', 4, 3],
463                 self.sldSPDIF2Out1: ['/Mixer/LEMix48', 5, 0],
464                 self.sldSPDIF2Out2: ['/Mixer/LEMix48', 5, 1],
465                 self.sldSPDIF2Out3: ['/Mixer/LEMix48', 5, 2],
466                 self.sldSPDIF2Out4: ['/Mixer/LEMix48', 5, 3],
467                
468                 self.sldPC1Out1: ['/Mixer/LEMix48', 6, 0],
469                 self.sldPC1Out2: ['/Mixer/LEMix48', 6, 1],
470                 self.sldPC1Out3: ['/Mixer/LEMix48', 6, 2],
471                 self.sldPC1Out4: ['/Mixer/LEMix48', 6, 3],
472                 self.sldPC2Out1: ['/Mixer/LEMix48', 7, 0],
473                 self.sldPC2Out2: ['/Mixer/LEMix48', 7, 1],
474                 self.sldPC2Out3: ['/Mixer/LEMix48', 7, 2],
475                 self.sldPC2Out4: ['/Mixer/LEMix48', 7, 3],
476                 self.sldPC3Out1: ['/Mixer/LEMix48', 8, 0],
477                 self.sldPC3Out2: ['/Mixer/LEMix48', 8, 1],
478                 self.sldPC3Out3: ['/Mixer/LEMix48', 8, 2],
479                 self.sldPC3Out4: ['/Mixer/LEMix48', 8, 3],
480                 self.sldPC4Out1: ['/Mixer/LEMix48', 9, 0],
481                 self.sldPC4Out2: ['/Mixer/LEMix48', 9, 1],
482                 self.sldPC4Out3: ['/Mixer/LEMix48', 9, 2],
483                 self.sldPC4Out4: ['/Mixer/LEMix48', 9, 3],
484                 self.sldPC5Out1: ['/Mixer/LEMix48', 10, 0],
485                 self.sldPC5Out2: ['/Mixer/LEMix48', 10, 1],
486                 self.sldPC5Out3: ['/Mixer/LEMix48', 10, 2],
487                 self.sldPC5Out4: ['/Mixer/LEMix48', 10, 3],
488                 self.sldPC6Out1: ['/Mixer/LEMix48', 11, 0],
489                 self.sldPC6Out2: ['/Mixer/LEMix48', 11, 1],
490                 self.sldPC6Out3: ['/Mixer/LEMix48', 11, 2],
491                 self.sldPC6Out4: ['/Mixer/LEMix48', 11, 3],
492                 self.sldPC7Out1: ['/Mixer/LEMix48', 12, 0],
493                 self.sldPC7Out2: ['/Mixer/LEMix48', 12, 1],
494                 self.sldPC7Out3: ['/Mixer/LEMix48', 12, 2],
495                 self.sldPC7Out4: ['/Mixer/LEMix48', 12, 3],
496                 self.sldPC8Out1: ['/Mixer/LEMix48', 13, 0],
497                 self.sldPC8Out2: ['/Mixer/LEMix48', 13, 1],
498                 self.sldPC8Out3: ['/Mixer/LEMix48', 13, 2],
499                 self.sldPC8Out4: ['/Mixer/LEMix48', 13, 3],
500                 }
501
502         self.SelectorControls={
503                 self.chkOut12Mute:          ['/Mixer/Out12Mute'],
504                 self.chkOut12HwCtrl:        ['/Mixer/Out12HwCtrl'],
505                 self.chkOut34Mute:          ['/Mixer/Out34Mute'],
506                 self.chkOut34HwCtrl:        ['/Mixer/Out34HwCtrl'],
507                 self.chkOut56Mute:          ['/Mixer/Out56Mute'],
508                 self.chkOut56HwCtrl:        ['/Mixer/Out56HwCtrl'],
509                 self.chkSPDIFTransparent:   ['/Mixer/SpdifTransparent'],
510                 self.chkMIDITru:            ['/Mixer/MidiThru'],
511                 self.chkHighGain3:          ['/Mixer/HighGainLine3'],
512                 self.chkHighGain4:          ['/Mixer/HighGainLine4'],
513                 }
514
515         self.VolumeControlsLowRes={
516                 self.sldOut12Level:      ['/Mixer/Out12Level'],
517                 self.sldOut34Level:      ['/Mixer/Out34Level'],
518                 self.sldOut56Level:      ['/Mixer/Out56Level'],
519                 }
520
521         self.TriggerButtonControls={
522             self.btnSaveSettings:        ['/Mixer/SaveSettings'],
523         }
524
525         self.TextControls={
526         }
527
528         self.saveTextControls={
529         }
530
531         self.ComboControls={
532         }
533
534     def polledUpdate(self):
535         #fixme do what it takes to make the gui follow the front panel dial
536         pass
537
538     def updateMatrixVolume(self,a0):
539         SaffireMixerBase.updateMatrixVolume(self,a0)
540     def updateLowResVolume(self,a0):
541         SaffireMixerBase.updateLowResVolume(self,a0)
542     def updateSelector(self,a0):
543         SaffireMixerBase.updateSelector(self,a0)
544     def triggerButton(self):
545         SaffireMixerBase.triggerButton(self)
546     def saveText(self):
547         SaffireMixerBase.saveText(self)
548     def initCombo(self, combo):
549         SaffireMixerBase.initCombo(self,combo)
550     def selectCombo(self, mode):
551         SaffireMixerBase.selectCombo(self,mode)
552
553     def updateValues(self):
554         SaffireMixerBase.updateValues(self)
555
556 class SaffireLEMixerSmall(QWidget, SaffireMixerBase):
557     def __init__(self,parent = None):
558         self.my_parent = parent
559         QWidget.__init__(self,parent)
560         uicLoad("ffado/mixer/saffirele_small", self)
561         SaffireMixerBase.__init__(self)
562
563         log.debug("Init small Saffire LE mixer window")
564
565         self.VolumeControls={
566                 self.sldIN1RecMix:    ['/Mixer/LEMix96', 0, 4],
567                 self.sldIN2RecMix:    ['/Mixer/LEMix96', 1, 4],
568                 self.sldIN3RecMix:    ['/Mixer/LEMix96', 2, 4],
569                 self.sldIN4RecMix:    ['/Mixer/LEMix96', 3, 4],
570                 self.sldSPDIF1RecMix: ['/Mixer/LEMix96', 4, 4],
571                 self.sldSPDIF2RecMix: ['/Mixer/LEMix96', 5, 4],
572
573                 self.sldPC1Out1: ['/Mixer/LEMix96', 6, 0],
574                 self.sldPC1Out2: ['/Mixer/LEMix96', 6, 1],
575                 self.sldPC1Out3: ['/Mixer/LEMix96', 6, 2],
576                 self.sldPC1Out4: ['/Mixer/LEMix96', 6, 3],
577                 self.sldPC2Out1: ['/Mixer/LEMix96', 7, 0],
578                 self.sldPC2Out2: ['/Mixer/LEMix96', 7, 1],
579                 self.sldPC2Out3: ['/Mixer/LEMix96', 7, 2],
580                 self.sldPC2Out4: ['/Mixer/LEMix96', 7, 3],
581                 }
582
583         self.SelectorControls={
584                 self.chkOut12Mute:          ['/Mixer/Out12Mute'],
585                 self.chkOut12HwCtrl:        ['/Mixer/Out12HwCtrl'],
586                 self.chkOut34Mute:          ['/Mixer/Out34Mute'],
587                 self.chkOut34HwCtrl:        ['/Mixer/Out34HwCtrl'],
588                 self.chkOut56Mute:          ['/Mixer/Out56Mute'],
589                 self.chkOut56HwCtrl:        ['/Mixer/Out56HwCtrl'],
590                 self.chkSPDIFTransparent:   ['/Mixer/SpdifTransparent'],
591                 self.chkMIDITru:            ['/Mixer/MidiThru'],
592                 self.chkHighGain3:          ['/Mixer/HighGainLine3'],
593                 self.chkHighGain4:          ['/Mixer/HighGainLine4'],
594                 }
595
596         self.VolumeControlsLowRes={
597                 self.sldOut12Level:      ['/Mixer/Out12Level'],
598                 self.sldOut34Level:      ['/Mixer/Out34Level'],
599                 self.sldOut56Level:      ['/Mixer/Out56Level'],
600                 }
601
602         self.TriggerButtonControls={
603             self.btnSaveSettings:        ['/Mixer/SaveSettings'],
604         }
605
606         self.TextControls={
607         }
608
609         self.saveTextControls={
610         }
611
612         self.ComboControls={
613         }
614
615     def polledUpdate(self):
616         #fixme do what it takes to make the gui follow the front panel dial
617         pass
618
619     def updateMatrixVolume(self,a0):
620         SaffireMixerBase.updateMatrixVolume(self,a0)
621     def updateLowResVolume(self,a0):
622         SaffireMixerBase.updateLowResVolume(self,a0)
623     def updateSelector(self,a0):
624         SaffireMixerBase.updateSelector(self,a0)
625     def triggerButton(self):
626         SaffireMixerBase.triggerButton(self)
627     def saveText(self):
628         SaffireMixerBase.saveText(self)
629     def initCombo(self, combo):
630         SaffireMixerBase.initCombo(self,combo)
631     def selectCombo(self, mode):
632         SaffireMixerBase.selectCombo(self,mode)
633
634     def updateValues(self):
635         SaffireMixerBase.updateValues(self)
636
637 # vim: et
Note: See TracBrowser for help on using the browser.