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

Revision 2694, 27.0 kB (checked in by jwoithe, 7 years ago)

ffado-mixer: Centralise imports of PyQt? modules and make compatible with PyQt?5.

In Xavier Forestier's patch set submitted to ffado-devel in November 2016,
changes were required to every PyQt? import statement if PyQt?5 were to to be
used instead. Since the current intent is to retain compatiblity to both
PyQt?4 and PyQt?5 a slightly different approach was needed.

All PyQt? module imports are now handled by the newly added import_pyqt
module. This transparently loads PyQt?4 or PyQt?5 modules depending on what
is found on the system at runtime. Presently PyQt?4 is tried first with a
fallback to PyQt?5 if PyQt?4 is not found, but this could change in future.
The result is that the ffado-mixer code should now be very close to being
compatible with PyQt?5 without additional patches. Having said that, some
build system changes are still needed to make PyQt?5 an option, along with
some other minor fixes.

This is perhaps not the neatest way of achieving the desired result, but it
seems to work. It avoids the need to patch every ffado-mixer source file
depending on the PyQt? version in use, and allows ffado-mixer to adapt to the
PyQt? version found at runtime.

The import_pyqt module also sets two global version variables:
ffado_pyqt_version (the version of PyQt? in use) and ffado_python3 (true if
python3 is in use). These may be of use when addressing remaining
PtQt?4/PyQt5 and Python 2/3 issues.

This patch has been tested with PyQt?4 under Python 2.7.

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