root/trunk/libffado/support/mixer/mixer_phase88.ui.h

Revision 644, 3.2 kB (checked in by ppalmers, 15 years ago)

- Adapt the phase 88 mixer control application to the new DBUS control interface

Line 
1 /****************************************************************************
2 ** ui.h extension file, included from the uic-generated form implementation.
3 **
4 ** If you want to add, delete, or rename functions or slots, use
5 ** Qt Designer to update this file, preserving your code.
6 **
7 ** You should not define a constructor or destructor in this file.
8 ** Instead, write your code in functions called init() and destroy().
9 ** These will automatically be called by the form's constructor and
10 ** destructor.
11 *****************************************************************************/
12
13 void Phase88Control::switchFrontState( int )
14 {
15     self.setSelector('frontback', a0)
16 }
17
18 void Phase88Control::switchOutAssign( int )
19 {
20     self.setSelector('outassign', a0)
21 }
22
23 void Phase88Control::switchWaveInAssign( int )
24 {
25     self.setSelector('inassign', a0)
26 }
27
28 void Phase88Control::switchSyncSource( int )
29 {
30     self.setSelector('syncsource', a0)
31 }
32
33 void Phase88Control::switchExtSyncSource( int )
34 {
35     self.setSelector('externalsync', a0)
36 }
37
38 void Phase88Control::setVolume12( int )
39 {
40     self.setVolume('line12', a0)
41 }
42
43 void Phase88Control::setVolume34( int )
44 {
45     self.setVolume('line34', a0)
46 }
47
48 void Phase88Control::setVolume56( int )
49 {
50     self.setVolume('line56', a0)
51 }
52
53 void Phase88Control::setVolume78( int )
54 {
55     self.setVolume('line78', a0)
56 }
57
58 void Phase88Control::setVolumeSPDIF( int )
59 {
60     self.setVolume('spdif', a0)
61 }
62
63 void Phase88Control::setVolumeWavePlay( int )
64 {
65     self.setVolume('waveplay', a0)
66 }
67
68 void Phase88Control::setVolumeMaster( int )
69 {
70     self.setVolume('master', a0)
71 }
72
73 void Phase88Control::setVolume( QString, int )
74 {
75     name=a0
76     vol = -a1
77    
78     print "setting %s volume to %d" % (name, vol)
79     self.hw.setContignuous(self.VolumeControls[name][0], vol)
80 }
81
82 void Phase88Control::setSelector( QString, int )
83 {
84     name=a0
85     state = a1
86    
87     print "setting %s state to %d" % (name, state)
88     self.hw.setDiscrete(self.SelectorControls[name][0], state)
89 }
90
91 void Phase88Control::init()
92 {
93     print "Init Phase88 mixer window"
94
95     self.VolumeControls={
96         'master':    ['/Mixer/Feature_1', self.sldInputMaster],
97         'line12' :   ['/Mixer/Feature_2', self.sldInput12],
98         'line34' :   ['/Mixer/Feature_3', self.sldInput34],
99         'line56' :   ['/Mixer/Feature_4', self.sldInput56],
100         'line78' :   ['/Mixer/Feature_5', self.sldInput78],
101         'spdif' :    ['/Mixer/Feature_6', self.sldInputSPDIF],
102         'waveplay' : ['/Mixer/Feature_7', self.sldInputWavePlay],
103         }
104
105     self.SelectorControls={
106         'outassign':    ['/Mixer/Selector_6', self.comboOutAssign],
107         'inassign':     ['/Mixer/Selector_7', self.comboInAssign],
108         'externalsync': ['/Mixer/Selector_8', self.comboExtSync],
109         'syncsource':   ['/Mixer/Selector_9', self.comboSyncSource],
110         'frontback':    ['/Mixer/Selector_10', self.comboFrontBack],
111     }
112 }
113
114 void Phase88Control::initValues()
115 {
116     for name, ctrl in self.VolumeControls.iteritems():
117         vol = self.hw.getContignuous(ctrl[0])
118         print "%s volume is %d" % (name , vol)
119         ctrl[1].setValue(-vol)
120
121     for name, ctrl in self.SelectorControls.iteritems():
122         state = self.hw.getDiscrete(ctrl[0])
123         print "%s state is %d" % (name , state)
124         ctrl[1].setCurrentItem(state)   
125 }
Note: See TracBrowser for help on using the browser.