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

Revision 2802, 23.7 kB (checked in by jwoithe, 3 years ago)

Cosmetic: "Firewire" becomes "FireWire?".

Officially both the "F" and "W" were capitalised in the FireWire? name, so
reflect this throughout FFADO's source tree. This mostly affects comments.

This patch originated from pander on the ffado-devel mailing list. To
maintain consistency, the committed version has been expanded to include
files not originally included in the original patch.

  • 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.QtGui import QWidget, QHBoxLayout, QMessageBox
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('saffirepro')
31
32 class SaffirePro(QWidget):
33     def __init__(self,parent = None):
34         QWidget.__init__(self, parent)
35
36         self.have_adat = False
37         self.samplerate = None
38         self.is_pro10 = None
39
40         # make a layout
41         self.layout = QHBoxLayout()
42         self.setLayout(self.layout)
43
44     def show(self):
45         self.selectCorrectMode()
46         QWidget.show(self)
47
48     def getDisplayTitle(self):
49         try:
50             return self.nickname.text()
51         except:
52             if self.is_pro10:
53                 return "SaffirePRO10"
54             else:
55                 return "SaffirePRO26"
56
57     def selectCorrectMode(self):
58         if self.samplerate <= 96000:
59             log.debug("large")
60             self.small.hide()
61             self.large.initValues()
62             self.large.show()
63         else:
64             log.debug("small")
65             self.large.hide()
66             self.small.initValues()
67             self.small.show()
68
69     def initValues(self):
70         self.is_not_streaming = self.samplerateselect.canChangeValue()
71         selected = self.samplerateselect.selected()
72         self.samplerate = int(self.samplerateselect.getEnumLabel( selected ))
73         log.debug("detected samplerate %d" % self.samplerate)
74
75         # adat on PRO26 makes a difference
76         modelId = self.configrom.getModelId()
77         if modelId == 0x00000003: # PRO26
78             self.is_pro10 = False
79             state = self.hw.getDiscrete('/Control/ADATDisable')
80             if state:
81                 self.have_adat = False
82                 log.debug("detected PRO26, ADAT disabled")
83             else:
84                 self.have_adat = True
85                 log.debug("detected PRO26, ADAT enabled")
86         elif modelId == 0x00000006: # PRO10
87             self.is_pro10 = True
88             self.have_adat = False
89
90         # create the child widgets
91         self.small = SaffireProMixerSmall(self)
92         self.layout.addWidget(self.small)
93         self.large = SaffireProMixerLarge(self)
94         self.layout.addWidget(self.large)
95
96         self.small.hw = self.hw
97         self.small.configrom = self.configrom
98
99         self.large.hw = self.hw
100         self.large.configrom = self.configrom
101
102         self.selectCorrectMode()
103
104     def polledUpdate(self):
105         self.is_not_streaming = self.samplerateselect.canChangeValue()
106         if self.samplerate <= 96000:
107             self.large.polledUpdate()
108         else:
109             self.small.polledUpdate()
110
111 class SaffireProMixerLarge(QWidget, SaffireMixerBase):
112     def __init__(self,parent = None):
113         self.my_parent = parent
114         QWidget.__init__(self,parent)
115         SaffireMixerBase.__init__(self)
116         uicLoad("ffado/mixer/saffirepro_large", self)
117         self.have_adat = False
118         log.debug("Init large Saffire Pro mixer window")
119
120         self.VolumeControls={
121             self.sldIMixAnalog1L: ['/Mixer/InputMix', 0, 0],
122             self.sldIMixAnalog1R: ['/Mixer/InputMix', 0, 1],
123             self.sldIMixAnalog2L: ['/Mixer/InputMix', 1, 0],
124             self.sldIMixAnalog2R: ['/Mixer/InputMix', 1, 1],
125             self.sldIMixAnalog3L: ['/Mixer/InputMix', 2, 0],
126             self.sldIMixAnalog3R: ['/Mixer/InputMix', 2, 1],
127             self.sldIMixAnalog4L: ['/Mixer/InputMix', 3, 0],
128             self.sldIMixAnalog4R: ['/Mixer/InputMix', 3, 1],
129             self.sldIMixAnalog5L: ['/Mixer/InputMix', 4, 0],
130             self.sldIMixAnalog5R: ['/Mixer/InputMix', 4, 1],
131             self.sldIMixAnalog6L: ['/Mixer/InputMix', 5, 0],
132             self.sldIMixAnalog6R: ['/Mixer/InputMix', 5, 1],
133             self.sldIMixAnalog7L: ['/Mixer/InputMix', 6, 0],
134             self.sldIMixAnalog7R: ['/Mixer/InputMix', 6, 1],
135             self.sldIMixAnalog8L: ['/Mixer/InputMix', 7, 0],
136             self.sldIMixAnalog8R: ['/Mixer/InputMix', 7, 1],
137             self.sldIMixAnalog9L: ['/Mixer/InputMix', 8, 0],
138             self.sldIMixAnalog9R: ['/Mixer/InputMix', 8, 1],
139             self.sldIMixAnalog10L: ['/Mixer/InputMix', 9, 0],
140             self.sldIMixAnalog10R: ['/Mixer/InputMix', 9, 1],
141             self.sldIMixADAT11L: ['/Mixer/InputMix', 10, 0],
142             self.sldIMixADAT11R: ['/Mixer/InputMix', 10, 1],
143             self.sldIMixADAT12L: ['/Mixer/InputMix', 11, 0],
144             self.sldIMixADAT12R: ['/Mixer/InputMix', 11, 1],
145             self.sldIMixADAT13L: ['/Mixer/InputMix', 12, 0],
146             self.sldIMixADAT13R: ['/Mixer/InputMix', 12, 1],
147             self.sldIMixADAT14L: ['/Mixer/InputMix', 13, 0],
148             self.sldIMixADAT14R: ['/Mixer/InputMix', 13, 1],
149             self.sldIMixADAT15L: ['/Mixer/InputMix', 14, 0],
150             self.sldIMixADAT15R: ['/Mixer/InputMix', 14, 1],
151             self.sldIMixADAT16L: ['/Mixer/InputMix', 15, 0],
152             self.sldIMixADAT16R: ['/Mixer/InputMix', 15, 1],
153             self.sldIMixADAT17L: ['/Mixer/InputMix', 16, 0],
154             self.sldIMixADAT17R: ['/Mixer/InputMix', 16, 1],
155             self.sldIMixADAT18L: ['/Mixer/InputMix', 17, 0],
156             self.sldIMixADAT18R: ['/Mixer/InputMix', 17, 1],
157             self.sldIMixADAT21L: ['/Mixer/InputMix', 18, 0],
158             self.sldIMixADAT21R: ['/Mixer/InputMix', 18, 1],
159             self.sldIMixADAT22L: ['/Mixer/InputMix', 19, 0],
160             self.sldIMixADAT22R: ['/Mixer/InputMix', 19, 1],
161             self.sldIMixADAT23L: ['/Mixer/InputMix', 20, 0],
162             self.sldIMixADAT23R: ['/Mixer/InputMix', 20, 1],
163             self.sldIMixADAT24L: ['/Mixer/InputMix', 21, 0],
164             self.sldIMixADAT24R: ['/Mixer/InputMix', 21, 1],
165             self.sldIMixADAT25L: ['/Mixer/InputMix', 22, 0],
166             self.sldIMixADAT25R: ['/Mixer/InputMix', 22, 1],
167             self.sldIMixADAT26L: ['/Mixer/InputMix', 23, 0],
168             self.sldIMixADAT26R: ['/Mixer/InputMix', 23, 1],
169             self.sldIMixADAT27L: ['/Mixer/InputMix', 24, 0],
170             self.sldIMixADAT27R: ['/Mixer/InputMix', 24, 1],
171             self.sldIMixADAT28L: ['/Mixer/InputMix', 25, 0],
172             self.sldIMixADAT28R: ['/Mixer/InputMix', 25, 1],
173            
174             self.sldOMixPC1O1: ['/Mixer/OutputMix', 0, 0],
175             self.sldOMixPC2O2: ['/Mixer/OutputMix', 1, 1],
176             self.sldOMixPC3O3: ['/Mixer/OutputMix', 2, 2],
177             self.sldOMixPC4O4: ['/Mixer/OutputMix', 3, 3],
178             self.sldOMixPC5O5: ['/Mixer/OutputMix', 4, 4],
179             self.sldOMixPC6O6: ['/Mixer/OutputMix', 5, 5],
180             self.sldOMixPC7O7: ['/Mixer/OutputMix', 6, 6],
181             self.sldOMixPC8O8: ['/Mixer/OutputMix', 7, 7],
182             self.sldOMixPC9O9: ['/Mixer/OutputMix', 8, 8],
183             self.sldOMixPC10O10: ['/Mixer/OutputMix', 9, 9],
184            
185             self.sldOMixPC1O3: ['/Mixer/OutputMix', 0, 2],
186             self.sldOMixPC2O4: ['/Mixer/OutputMix', 1, 3],
187             self.sldOMixPC1O5: ['/Mixer/OutputMix', 0, 4],
188             self.sldOMixPC2O6: ['/Mixer/OutputMix', 1, 5],
189             self.sldOMixPC1O7: ['/Mixer/OutputMix', 0, 6],
190             self.sldOMixPC2O8: ['/Mixer/OutputMix', 1, 7],
191             self.sldOMixPC1O9: ['/Mixer/OutputMix', 0, 8],
192             self.sldOMixPC2O10: ['/Mixer/OutputMix', 1, 9],
193            
194             self.sldOMixIMixO1: ['/Mixer/OutputMix', 10, 0],
195             self.sldOMixIMixO2: ['/Mixer/OutputMix', 11, 1],
196             self.sldOMixIMixO3: ['/Mixer/OutputMix', 10, 2],
197             self.sldOMixIMixO4: ['/Mixer/OutputMix', 11, 3],
198             self.sldOMixIMixO5: ['/Mixer/OutputMix', 10, 4],
199             self.sldOMixIMixO6: ['/Mixer/OutputMix', 11, 5],
200             self.sldOMixIMixO7: ['/Mixer/OutputMix', 10, 6],
201             self.sldOMixIMixO8: ['/Mixer/OutputMix', 11, 7],
202             self.sldOMixIMixO9: ['/Mixer/OutputMix', 10, 8],
203             self.sldOMixIMixO10: ['/Mixer/OutputMix', 11, 9],
204             }
205
206
207         self.SelectorControls={
208             # control elements
209             self.chkInsert1: ['/Control/Insert1'],
210             self.chkInsert2: ['/Control/Insert2'],
211             self.chkPhantom14: ['/Control/Phantom_1to4'],
212             self.chkPhantom58: ['/Control/Phantom_5to8'],
213             self.chkAC3: ['/Control/AC3pass'],
214             self.chkMidiThru: ['/Control/MidiTru'],
215             self.chkHighVoltage: ['/Control/UseHighVoltageRail'],
216             #self.chkEnableADAT1: ['/Control/EnableAdat1'],
217             #self.chkEnableADAT2: ['/Control/EnableAdat2'],
218             #self.chkEnableSPDIF1: ['/Control/EnableSPDIF1'],
219             self.chkMidiEnable: ['/Control/MIDIEnable'],
220             self.chkAdatDisable: ['/Control/ADATDisable'],
221             # Mixer switches
222             self.chkMute12: ['/Mixer/Out12Mute', [self.chkHwCtrl12]],
223             self.chkHwCtrl12: ['/Mixer/Out12HwCtrl'],
224             self.chkPad12: ['/Mixer/Out12Pad'],
225             self.chkDim12: ['/Mixer/Out12Dim'],
226             self.chkMute34: ['/Mixer/Out34Mute', [self.chkHwCtrl34]],
227             self.chkHwCtrl34: ['/Mixer/Out34HwCtrl'],
228             self.chkPad34: ['/Mixer/Out34Pad'],
229             self.chkDim34: ['/Mixer/Out34Dim'],
230             self.chkMute56: ['/Mixer/Out56Mute', [self.chkHwCtrl56]],
231             self.chkHwCtrl56: ['/Mixer/Out56HwCtrl'],
232             self.chkPad56: ['/Mixer/Out56Pad'],
233             self.chkDim56: ['/Mixer/Out56Dim'],
234             self.chkMute78: ['/Mixer/Out78Mute', [self.chkHwCtrl78]],
235             self.chkHwCtrl78: ['/Mixer/Out78HwCtrl'],
236             self.chkPad78: ['/Mixer/Out78Pad'],
237             self.chkDim78: ['/Mixer/Out78Dim'],
238             # direct monitoring
239             self.chkMonitor1: ['/Mixer/DirectMonitorCH1'],
240             self.chkMonitor2: ['/Mixer/DirectMonitorCH2'],
241             self.chkMonitor3: ['/Mixer/DirectMonitorCH3'],
242             self.chkMonitor4: ['/Mixer/DirectMonitorCH4'],
243             self.chkMonitor5: ['/Mixer/DirectMonitorCH5'],
244             self.chkMonitor6: ['/Mixer/DirectMonitorCH6'],
245             self.chkMonitor7: ['/Mixer/DirectMonitorCH7'],
246             self.chkMonitor8: ['/Mixer/DirectMonitorCH8'],
247         }
248
249         self.VolumeControlsLowRes={
250             self.sldOut12Level:      ['/Mixer/Out12Level'],
251             self.sldOut34Level:      ['/Mixer/Out34Level'],
252             self.sldOut56Level:      ['/Mixer/Out56Level'],
253             self.sldOut78Level:      ['/Mixer/Out78Level'],
254         }
255
256         self.TriggerButtonControls={
257             self.btnReboot:        ['/Control/Reboot'],
258             self.btnIdentify:      ['/Control/FlashLed'],
259             self.btnSaveSettings:  ['/Control/SaveSettings'],
260         }
261
262         self.TextControls={
263         }
264
265         self.saveTextControls={
266         }
267
268         self.ComboControls={
269             self.comboStandalone:        ['/Control/StandaloneConfig'],
270         }
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         sender = self.sender()
278         #if sender == self.chkAC3 and not self.my_parent.is_not_streaming:
279             #msg = QMessageBox()
280             #msg.question( msg, "Error", \
281                 #"<qt>Change not permitted. Is streaming active?</qt>", \
282                 #QMessageBox.Ok )
283             #self.chkAC3.setEnabled(False)
284             #if a0:
285                 #self.chkAC3.setChecked(False)
286             #else:
287                 #self.chkAC3.setChecked(True)
288             #return
289         if sender == self.chkMidiEnable and not self.my_parent.is_not_streaming:
290             msg = QMessageBox()
291             msg.question( msg, "Error", \
292                 "<qt>Change not permitted. Is streaming active?</qt>", \
293                 QMessageBox.Ok )
294             self.chkMidiEnable.setEnabled(False)
295             state = self.hw.getDiscrete(self.SelectorControls[self.chkMidiEnable][0])
296             if state:
297                 self.chkMidiEnable.setChecked(True)
298             else:
299                 self.chkMidiEnable.setChecked(False)
300             return
301         if sender == self.chkAdatDisable and not self.my_parent.is_not_streaming:
302             msg = QMessageBox()
303             msg.question( msg, "Error", \
304                 "<qt>Change not permitted. Is streaming active?</qt>", \
305                 QMessageBox.Ok )
306             self.chkAdatDisable.setEnabled(False)
307             state = self.hw.getDiscrete(self.SelectorControls[self.chkAdatDisable][0])
308             if state:
309                 self.chkAdatDisable.setChecked(True)
310             else:
311                 self.chkAdatDisable.setChecked(False)
312             return
313         SaffireMixerBase.updateSelector(self,a0)
314
315     def triggerButton(self):
316         sender = self.sender()
317         if sender == self.btnReboot and not self.my_parent.is_not_streaming:
318             msg = QMessageBox()
319             msg.question( msg, "Error", \
320                 "<qt>Operation not permitted. Is streaming active?</qt>", \
321                 QMessageBox.Ok )
322             self.btnReboot.setEnabled(False)
323             return
324         SaffireMixerBase.triggerButton(self)
325
326     def saveText(self):
327         SaffireMixerBase.saveText(self)
328     def initCombo(self, combo):
329         SaffireMixerBase.initCombo(self,combo)
330     def selectCombo(self, mode):
331         SaffireMixerBase.selectCombo(self,mode)
332
333     def updateValues(self):
334         for i in range(self.tabInputMix.count()):
335             self.tabInputMix.setTabEnabled(i, True)
336
337         if not self.my_parent.have_adat:
338             for i in range(self.tabInputMix.count()):
339                 page = self.tabInputMix.widget(i)
340                 name = page.objectName()
341                 if name[0:4] == "adat":
342                     self.tabInputMix.setTabEnabled(i, False)
343                 else:
344                     self.tabInputMix.setTabEnabled(i, True)
345
346         self.tabInputMix.setCurrentWidget(self.tabInputMix.widget(0))
347         SaffireMixerBase.updateValues(self)
348
349     def polledUpdate(self):
350         #log.debug("polled update (large)")
351         self.polledUpdateHwCtrl(self.chkHwCtrl12, self.sldOut12Level)
352         self.polledUpdateHwCtrl(self.chkHwCtrl34, self.sldOut34Level)
353         self.polledUpdateHwCtrl(self.chkHwCtrl56, self.sldOut56Level)
354         self.polledUpdateHwCtrl(self.chkHwCtrl78, self.sldOut78Level)
355
356         #make these inaccessible whenever streaming is running
357         #self.chkAC3.setEnabled(self.my_parent.is_not_streaming)
358         self.chkMidiEnable.setEnabled(self.my_parent.is_not_streaming)
359         self.chkAdatDisable.setEnabled(self.my_parent.is_not_streaming)
360         self.btnReboot.setEnabled(self.my_parent.is_not_streaming)
361
362     def polledUpdateHwCtrl(self, selector, volctrl):
363         state = selector.isChecked()
364         if state:
365             self.polledUpdateVolumeLowRes('/Mixer/MonitorDial', volctrl, 2)
366             volctrl.setEnabled(False)
367         else:
368             volctrl.setEnabled(True)
369
370 class SaffireProMixerSmall(QWidget, SaffireMixerBase):
371     def __init__(self,parent = None):
372         self.my_parent = parent
373         QWidget.__init__(self,parent)
374         SaffireMixerBase.__init__(self)
375         uicLoad("ffado/mixer/saffirepro_small", self)
376         log.debug("Init small Saffire Pro mixer window")
377
378         self.VolumeControls={
379
380             self.sldOMixPC1O1: ['/Mixer/OutputMix', 0, 0],
381             self.sldOMixPC2O2: ['/Mixer/OutputMix', 1, 1],
382             self.sldOMixPC3O3: ['/Mixer/OutputMix', 2, 2],
383             self.sldOMixPC4O4: ['/Mixer/OutputMix', 3, 3],
384             self.sldOMixPC5O5: ['/Mixer/OutputMix', 4, 4],
385             self.sldOMixPC6O6: ['/Mixer/OutputMix', 5, 5],
386             self.sldOMixPC7O7: ['/Mixer/OutputMix', 6, 6],
387             self.sldOMixPC8O8: ['/Mixer/OutputMix', 7, 7],
388             self.sldOMixPC9O9: ['/Mixer/OutputMix', 8, 8],
389             self.sldOMixPC10O10: ['/Mixer/OutputMix', 9, 9],
390            
391             self.sldOMixPC1O3: ['/Mixer/OutputMix', 0, 2],
392             self.sldOMixPC2O4: ['/Mixer/OutputMix', 1, 3],
393             self.sldOMixPC1O5: ['/Mixer/OutputMix', 0, 4],
394             self.sldOMixPC2O6: ['/Mixer/OutputMix', 1, 5],
395             self.sldOMixPC1O7: ['/Mixer/OutputMix', 0, 6],
396             self.sldOMixPC2O8: ['/Mixer/OutputMix', 1, 7],
397             self.sldOMixPC1O9: ['/Mixer/OutputMix', 0, 8],
398             self.sldOMixPC2O10: ['/Mixer/OutputMix', 1, 9],
399            
400             self.sldOMixIMixO1: ['/Mixer/OutputMix', 10, 0],
401             self.sldOMixIMixO2: ['/Mixer/OutputMix', 11, 1],
402             self.sldOMixIMixO3: ['/Mixer/OutputMix', 10, 2],
403             self.sldOMixIMixO4: ['/Mixer/OutputMix', 11, 3],
404             self.sldOMixIMixO5: ['/Mixer/OutputMix', 10, 4],
405             self.sldOMixIMixO6: ['/Mixer/OutputMix', 11, 5],
406             self.sldOMixIMixO7: ['/Mixer/OutputMix', 10, 6],
407             self.sldOMixIMixO8: ['/Mixer/OutputMix', 11, 7],
408             self.sldOMixIMixO9: ['/Mixer/OutputMix', 10, 8],
409             self.sldOMixIMixO10: ['/Mixer/OutputMix', 11, 9],
410             }
411
412
413         self.SelectorControls={
414             # control elements
415             self.chkInsert1: ['/Control/Insert1'],
416             self.chkInsert2: ['/Control/Insert2'],
417             self.chkPhantom14: ['/Control/Phantom_1to4'],
418             self.chkPhantom58: ['/Control/Phantom_5to8'],
419             self.chkAC3: ['/Control/AC3pass'],
420             self.chkMidiThru: ['/Control/MidiTru'],
421             self.chkHighVoltage: ['/Control/UseHighVoltageRail'],
422             #self.chkEnableADAT1: ['/Control/EnableAdat1'],
423             #self.chkEnableADAT2: ['/Control/EnableAdat2'],
424             #self.chkEnableSPDIF1: ['/Control/EnableSPDIF1'],
425             self.chkMidiEnable: ['/Control/MIDIEnable'],
426             self.chkAdatDisable: ['/Control/ADATDisable'],
427             # Mixer switches
428             self.chkMute12: ['/Mixer/Out12Mute'],
429             self.chkHwCtrl12: ['/Mixer/Out12HwCtrl'],
430             self.chkPad12: ['/Mixer/Out12Pad'],
431             self.chkDim12: ['/Mixer/Out12Dim'],
432             self.chkMute34: ['/Mixer/Out34Mute'],
433             self.chkHwCtrl34: ['/Mixer/Out34HwCtrl'],
434             self.chkPad34: ['/Mixer/Out34Pad'],
435             self.chkDim34: ['/Mixer/Out34Dim'],
436             self.chkMute56: ['/Mixer/Out56Mute'],
437             self.chkHwCtrl56: ['/Mixer/Out56HwCtrl'],
438             self.chkPad56: ['/Mixer/Out56Pad'],
439             self.chkDim56: ['/Mixer/Out56Dim'],
440             self.chkMute78: ['/Mixer/Out78Mute'],
441             self.chkHwCtrl78: ['/Mixer/Out78HwCtrl'],
442             self.chkPad78: ['/Mixer/Out78Pad'],
443             self.chkDim78: ['/Mixer/Out78Dim'],
444             # direct monitoring
445             self.chkMonitor1: ['/Mixer/DirectMonitorCH1'],
446             self.chkMonitor2: ['/Mixer/DirectMonitorCH2'],
447             self.chkMonitor3: ['/Mixer/DirectMonitorCH3'],
448             self.chkMonitor4: ['/Mixer/DirectMonitorCH4'],
449             self.chkMonitor5: ['/Mixer/DirectMonitorCH5'],
450             self.chkMonitor6: ['/Mixer/DirectMonitorCH6'],
451             self.chkMonitor7: ['/Mixer/DirectMonitorCH7'],
452             self.chkMonitor8: ['/Mixer/DirectMonitorCH8'],
453         }
454
455         self.VolumeControlsLowRes={
456             self.sldOut12Level:      ['/Mixer/Out12Level'],
457             self.sldOut34Level:      ['/Mixer/Out34Level'],
458             self.sldOut56Level:      ['/Mixer/Out56Level'],
459             self.sldOut78Level:      ['/Mixer/Out78Level'],
460         }
461
462         self.TriggerButtonControls={
463             self.btnReboot:        ['/Control/Reboot'],
464             self.btnIdentify:      ['/Control/FlashLed'],
465             self.btnSaveSettings:  ['/Control/SaveSettings'],
466         }
467
468         self.TextControls={
469         }
470
471         self.saveTextControls={
472         }
473
474         self.ComboControls={
475             self.comboStandalone:        ['/Control/StandaloneConfig'],
476         }
477
478     def updateMatrixVolume(self,a0):
479         SaffireMixerBase.updateMatrixVolume(self,a0)
480     def updateLowResVolume(self,a0):
481         SaffireMixerBase.updateLowResVolume(self,a0)
482     def updateSelector(self,a0):
483         sender = self.sender()
484         #if sender == self.chkAC3 and not self.my_parent.is_not_streaming:
485             #msg = QMessageBox()
486             #msg.question( msg, "Error", \
487                 #"<qt>Change not permitted. Is streaming active?</qt>", \
488                 #QMessageBox.Ok )
489             #self.chkAC3.setEnabled(False)
490             #if a0:
491                 #self.chkAC3.setChecked(False)
492             #else:
493                 #self.chkAC3.setChecked(True)
494             #return
495         if sender == self.chkMidiEnable and not self.my_parent.is_not_streaming:
496             msg = QMessageBox()
497             msg.question( msg, "Error", \
498                 "<qt>Change not permitted. Is streaming active?</qt>", \
499                 QMessageBox.Ok )
500             self.chkMidiEnable.setEnabled(False)
501             state = self.hw.getDiscrete(self.SelectorControls[self.chkMidiEnable][0])
502             if state:
503                 self.chkMidiEnable.setChecked(True)
504             else:
505                 self.chkMidiEnable.setChecked(False)
506             return
507         if sender == self.chkAdatDisable and not self.my_parent.is_not_streaming:
508             msg = QMessageBox()
509             msg.question( msg, "Error", \
510                 "<qt>Change not permitted. Is streaming active?</qt>", \
511                 QMessageBox.Ok )
512             self.chkAdatDisable.setEnabled(False)
513             state = self.hw.getDiscrete(self.SelectorControls[self.chkAdatDisable][0])
514             if state:
515                 self.chkAdatDisable.setChecked(True)
516             else:
517                 self.chkAdatDisable.setChecked(False)
518             return
519         SaffireMixerBase.updateSelector(self,a0)
520
521     def triggerButton(self):
522         sender = self.sender()
523         if sender == self.btnReboot and not self.my_parent.is_not_streaming:
524             msg = QMessageBox()
525             msg.question( msg, "Error", \
526                 "<qt>Operation not permitted. Is streaming active?</qt>", \
527                 QMessageBox.Ok )
528             self.btnReboot.setEnabled(False)
529             return
530         SaffireMixerBase.triggerButton(self)
531
532     def saveText(self):
533         SaffireMixerBase.saveText(self)
534     def initCombo(self, combo):
535         SaffireMixerBase.initCombo(self,combo)
536     def selectCombo(self, mode):
537         SaffireMixerBase.selectCombo(self,mode)
538
539     def updateValues(self):
540         SaffireMixerBase.updateValues(self)
541
542     def polledUpdate(self):
543         #log.debug("polled update (small)")
544         self.polledUpdateHwCtrl(self.chkHwCtrl12, self.sldOut12Level)
545         self.polledUpdateHwCtrl(self.chkHwCtrl34, self.sldOut34Level)
546         self.polledUpdateHwCtrl(self.chkHwCtrl56, self.sldOut56Level)
547         self.polledUpdateHwCtrl(self.chkHwCtrl78, self.sldOut78Level)
548
549         #make these inaccessible whenever streaming is running
550         #self.chkAC3.setEnabled(self.my_parent.is_not_streaming)
551         self.chkMidiEnable.setEnabled(self.my_parent.is_not_streaming)
552         self.chkAdatDisable.setEnabled(self.my_parent.is_not_streaming)
553         self.btnReboot.setEnabled(self.my_parent.is_not_streaming)
554
555     def polledUpdateHwCtrl(self, selector, volctrl):
556         state = selector.isChecked()
557         if state:
558             self.polledUpdateVolumeLowRes('/Mixer/MonitorDial', volctrl, 2)
559             volctrl.setEnabled(False)
560         else:
561             volctrl.setEnabled(True)
562
563 # vim: et
Note: See TracBrowser for help on using the browser.