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

Revision 1328, 3.0 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_edirolfa101ui import *
25
26 class EdirolFa101Control(EdirolFa101ControlUI):
27     def __init__(self, parent = None, name = None, fl = 0):
28         EdirolFa101ControlUI.__init__(self, parent, name, fl)
29
30     def setVolumeIn1(self, vol):
31             self.setVolume('in1', vol)
32
33     def setVolumeIn2(self, vol):
34             self.setVolume('in2', vol)
35
36     def setVolumeIn3(self, vol):
37             self.setVolume('in3', vol)
38
39     def setVolumeIn4(self, vol):
40             self.setVolume('in4', vol)
41
42     def setVolumeIn5(self, vol):
43             self.setVolume('in5', vol)
44
45     def setVolumeIn6(self, vol):
46             self.setVolume('in6', vol)
47
48     def setVolumeIn7(self, vol):
49             self.setVolume('in7', vol)
50
51     def setVolumeIn8(self, vol):
52             self.setVolume('in8', vol)
53            
54     def setVolumeIn9(self, vol):
55             self.setVolume('in9', vol)
56
57     def setVolumeIn10(self,vol):
58             self.setVolume('in10', vol)
59
60     def setVolume(self, name, vol):
61             vol = -vol
62             ctrl = self.VolumeControls[name]
63             print "setting %s volume to %d" % (name, vol)
64             self.hw.setContignuous(ctrl[0], vol, idx = ctrl[1])
65
66     def init(self):
67             print "Init Edirol FA-101 window"
68
69             self.VolumeControls = {
70                 #          feature name, channel, qt slider
71                 'in1'  :   ['/Mixer/Feature_5', 1, self.sldInput1],
72                 'in2'  :   ['/Mixer/Feature_5', 2, self.sldInput2],
73                 'in3'  :   ['/Mixer/Feature_1', 1, self.sldInput3],
74                 'in4'  :   ['/Mixer/Feature_1', 2, self.sldInput4],
75                 'in5'  :   ['/Mixer/Feature_2', 1, self.sldInput5],
76                 'in6'  :   ['/Mixer/Feature_2', 2, self.sldInput6],
77                 'in7'  :   ['/Mixer/Feature_3', 1, self.sldInput7],
78                 'in8'  :   ['/Mixer/Feature_3', 2, self.sldInput8],
79                 'in9'  :   ['/Mixer/Feature_4', 1, self.sldInput9],
80                 'in10' :   ['/Mixer/Feature_4', 2, self.sldInput10],
81                 }
82
83     def initValues(self):
84             for name, ctrl in self.VolumeControls.iteritems():
85                 vol = self.hw.getContignuous(ctrl[0], idx = ctrl[1])
86                 print "%s volume is %d" % (name , vol)
87                 ctrl[2].setValue(-vol)
Note: See TracBrowser for help on using the browser.