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

Revision 2018, 27.1 kB (checked in by jwoithe, 12 years ago)

Apply fix to mono Saffire mixer as suggested by John Vaites. Logically this seems like the correct thing to do but as I don't have a Saffire I can't test this myself. If this breaks other interfaces please revert and apply something more appropriate. The error this fixes in John's case is "AttributeError?: 'SaffireMixerMono?' object has no attribute 'sldIN1Out910'".

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