1 |
# |
---|
2 |
# Copyright (C) 2005-2007 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 3 of the License, or |
---|
12 |
# (at your option) any later version. |
---|
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_phase88ui import * |
---|
25 |
|
---|
26 |
class Phase88Control(Phase88ControlUI): |
---|
27 |
def __init__(self,parent = None,name = None,modal = 0,fl = 0): |
---|
28 |
Phase88ControlUI.__init__(self,parent,name,modal,fl) |
---|
29 |
|
---|
30 |
def switchFrontState(self,a0): |
---|
31 |
self.setSelector('frontback', a0) |
---|
32 |
|
---|
33 |
def switchOutAssign(self,a0): |
---|
34 |
self.setSelector('outassign', a0) |
---|
35 |
|
---|
36 |
def switchWaveInAssign(self,a0): |
---|
37 |
self.setSelector('inassign', a0) |
---|
38 |
|
---|
39 |
def switchSyncSource(self,a0): |
---|
40 |
self.setSelector('syncsource', a0) |
---|
41 |
|
---|
42 |
def switchExtSyncSource(self,a0): |
---|
43 |
self.setSelector('externalsync', a0) |
---|
44 |
|
---|
45 |
def setVolume12(self,a0): |
---|
46 |
self.setVolume('line12', a0) |
---|
47 |
|
---|
48 |
def setVolume34(self,a0): |
---|
49 |
self.setVolume('line34', a0) |
---|
50 |
|
---|
51 |
def setVolume56(self,a0): |
---|
52 |
self.setVolume('line56', a0) |
---|
53 |
|
---|
54 |
def setVolume78(self,a0): |
---|
55 |
self.setVolume('line78', a0) |
---|
56 |
|
---|
57 |
def setVolumeSPDIF(self,a0): |
---|
58 |
self.setVolume('spdif', a0) |
---|
59 |
|
---|
60 |
def setVolumeWavePlay(self,a0): |
---|
61 |
self.setVolume('waveplay', a0) |
---|
62 |
|
---|
63 |
def setVolumeMaster(self,a0): |
---|
64 |
self.setVolume('master', a0) |
---|
65 |
|
---|
66 |
def setVolume(self,a0,a1): |
---|
67 |
name=a0 |
---|
68 |
vol = -a1 |
---|
69 |
print "setting %s volume to %d" % (name, vol) |
---|
70 |
self.hw.setContignuous(self.VolumeControls[name][0], vol) |
---|
71 |
|
---|
72 |
def setSelector(self,a0,a1): |
---|
73 |
name=a0 |
---|
74 |
state = a1 |
---|
75 |
print "setting %s state to %d" % (name, state) |
---|
76 |
self.hw.setDiscrete(self.SelectorControls[name][0], state) |
---|
77 |
|
---|
78 |
def init(self): |
---|
79 |
print "Init Phase88 mixer window" |
---|
80 |
|
---|
81 |
self.VolumeControls={ |
---|
82 |
'master': ['/Mixer/Feature_1', self.sldInputMaster], |
---|
83 |
'line12' : ['/Mixer/Feature_2', self.sldInput12], |
---|
84 |
'line34' : ['/Mixer/Feature_3', self.sldInput34], |
---|
85 |
'line56' : ['/Mixer/Feature_4', self.sldInput56], |
---|
86 |
'line78' : ['/Mixer/Feature_5', self.sldInput78], |
---|
87 |
'spdif' : ['/Mixer/Feature_6', self.sldInputSPDIF], |
---|
88 |
'waveplay' : ['/Mixer/Feature_7', self.sldInputWavePlay], |
---|
89 |
} |
---|
90 |
|
---|
91 |
self.SelectorControls={ |
---|
92 |
'outassign': ['/Mixer/Selector_6', self.comboOutAssign], |
---|
93 |
'inassign': ['/Mixer/Selector_7', self.comboInAssign], |
---|
94 |
'externalsync': ['/Mixer/Selector_8', self.comboExtSync], |
---|
95 |
'syncsource': ['/Mixer/Selector_9', self.comboSyncSource], |
---|
96 |
'frontback': ['/Mixer/Selector_10', self.comboFrontBack], |
---|
97 |
} |
---|
98 |
|
---|
99 |
def initValues(self): |
---|
100 |
for name, ctrl in self.VolumeControls.iteritems(): |
---|
101 |
vol = self.hw.getContignuous(ctrl[0]) |
---|
102 |
print "%s volume is %d" % (name , vol) |
---|
103 |
ctrl[1].setValue(-vol) |
---|
104 |
|
---|
105 |
for name, ctrl in self.SelectorControls.iteritems(): |
---|
106 |
state = self.hw.getDiscrete(ctrl[0]) |
---|
107 |
print "%s state is %d" % (name , state) |
---|
108 |
ctrl[1].setCurrentItem(state) |
---|