root/trunk/libffado/support/mixer/mixer_edirolfa66.py

Revision 1328, 2.6 kB (checked in by wagi, 14 years ago)

merge r1327 back to trunk

Line 
1 #
2 # Copyright (C) 2005-2008 by Daniel Wagner
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 qt import *
24 from mixer_edirolfa66ui import *
25
26 class EdirolFa66Control(EdirolFa66ControlUI):
27     def __init__(self,parent = None,name = None,fl = 0):
28         EdirolFa66ControlUI.__init__(self, parent, name, fl)
29
30     def setComboMixSource(self, a0):
31             self.setSelector('line34source', a0)
32
33     def setVolumeIn1(self, vol):
34             self.setVolume('in1', vol)
35
36     def setVolumeIn2(self, vol):
37             self.setVolume('in2', vol)
38
39     def setVolumeIn3(self, vol):
40             self.setVolume('in3', vol)
41
42     def setVolumeIn4(self, vol):
43             self.setVolume('in4', vol)
44
45     def setVolumeIn5(self, vol):
46             self.setVolume('in5', vol)
47
48     def setVolumeIn6(self, vol):
49             self.setVolume('in6', vol)
50
51     def setVolume(self, name, vol):
52             vol = -vol
53             ctrl = self.VolumeControls[name]
54             print "setting %s volume to %d" % (name, vol)
55             self.hw.setContignuous(ctrl[0], vol, idx = ctrl[1])
56
57     def init(self):
58             print "Init Edirol FA-66 window"
59
60             self.VolumeControls = {
61                 #          feature name, channel, qt slider
62                 'in1'  :   ['/Mixer/Feature_1', 1, self.sldInput1],
63                 'in2'  :   ['/Mixer/Feature_1', 2, self.sldInput2],
64                 'in3'  :   ['/Mixer/Feature_2', 1, self.sldInput3],
65                 'in4'  :   ['/Mixer/Feature_2', 2, self.sldInput4],
66                 'in5'  :   ['/Mixer/Feature_3', 1, self.sldInput5],
67                 'in6'  :   ['/Mixer/Feature_3', 2, self.sldInput6],
68                 }
69
70     def initValues(self):
71             for name, ctrl in self.VolumeControls.iteritems():
72                 vol = self.hw.getContignuous(ctrl[0], idx = ctrl[1])
73                 print "%s volume is %d" % (name , vol)
74                 ctrl[2].setValue(-vol)
Note: See TracBrowser for help on using the browser.