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

Revision 489, 1.9 kB (checked in by ppalmers, 16 years ago)

Mixer for the Phase24

Phase88 app adapted by andreas@sandberg.pp.se

Line 
1 # -*- coding: utf-8 -*-
2
3 import sys
4 from qt import *
5 from mixer_phase24ui import *
6
7 import osc
8
9 class mixer_phase24(mixer_phase24ui):
10     def __init__(self,parent = None,name = None,modal = 0,fl = 0):
11         mixer_phase24ui.__init__(self,parent,name,modal,fl)
12
13     def __set_volume(self, id, vol):
14         osc.Message("/devicemanager/dev0/GenericMixer/Feature/%i" % id,
15                     ["set", "volume", 0, vol]).sendlocal(17820)
16        
17     def __set_selector(self, id, val):
18         osc.Message("/devicemanager/dev0/GenericMixer/Selector/%i" % id,
19                     ["set", "value", val]).sendlocal(17820)
20        
21     # public slot
22     def setVolume12(self,a0):
23         self.__set_volume(3, -a0)
24
25     # public slot
26     def setVolume34(self,a0):
27         self.__set_volume(4, -a0)
28
29     # public slot
30     def setVolumeLineIn(self,a0):
31         self.__set_volume(6, -a0)
32
33     # public slot
34     def setVolumeSPDIFOut(self,a0):
35         self.__set_volume(5, -a0)
36
37     # public slot
38     def setVolumeSPDIFIn(self,a0):
39         self.__set_volume(7, -a0)
40
41     # public slot
42     def setVolumeMaster(self,a0):
43         self.__set_volume(1, -a0)
44
45     # public slot
46     def setLineLevel(self,a0):
47         self.__set_volume(2, a0 * -768)
48        
49     # public slot
50     def setFrontLevel(self,a0):
51         if(a0 == 0):
52             self.__set_volume(8, 0)
53         else:
54             self.__set_volume(8, 1536)
55
56     # public slot
57     def setOutSource12(self,a0):
58         self.__set_selector(1, a0)
59
60     # public slot
61     def setOutSource34(self,a0):
62         self.__set_selector(2, a0)
63
64     # public slot
65     def setOutSourceSPDIF(self,a0):
66         self.__set_selector(3, a0)
67
68     # public slot
69     def setSyncSource(self,a0):
70         self.__set_selector(4, a0)
71
72
73 if __name__ == "__main__":
74     a = QApplication(sys.argv)
75     QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
76     w = mixer_phase24()
77     a.setMainWidget(w)
78     w.show()
79     a.exec_loop()
Note: See TracBrowser for help on using the browser.