1 |
# |
---|
2 |
# Copyright (C) 2005-2008 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 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_quatafireui import * |
---|
25 |
|
---|
26 |
class QuataFireMixer(QuataFireMixerUI): |
---|
27 |
def __init__(self,parent = None,name = None,modal = 0,fl = 0): |
---|
28 |
QuataFireMixerUI.__init__(self,parent,name,modal,fl) |
---|
29 |
|
---|
30 |
def init(self): |
---|
31 |
print "Init Quatafire mixer window" |
---|
32 |
|
---|
33 |
self.VolumeControls={ |
---|
34 |
self.sldFeature1: ['/Mixer/Feature_1'], |
---|
35 |
self.sldFeature2: ['/Mixer/Feature_2'], |
---|
36 |
self.sldFeature3: ['/Mixer/Feature_3'], |
---|
37 |
self.sldFeature4: ['/Mixer/Feature_4'], |
---|
38 |
} |
---|
39 |
|
---|
40 |
def updateVolume(self,a0): |
---|
41 |
sender = self.sender() |
---|
42 |
vol = -a0 |
---|
43 |
print "setting %s volume to %d" % (self.VolumeControls[sender][0], vol) |
---|
44 |
self.hw.setContignuous(self.VolumeControls[sender][0], vol) |
---|
45 |
|
---|
46 |
def initValues(self): |
---|
47 |
for ctrl, info in self.VolumeControls.iteritems(): |
---|
48 |
vol = self.hw.getContignuous(self.VolumeControls[ctrl][0]) |
---|
49 |
|
---|
50 |
print "%s volume is %d" % (ctrl.name() , 0x7FFF-vol) |
---|
51 |
ctrl.setValue(0x7FFF-vol) |
---|
52 |
|
---|
53 |
# connect the UI element |
---|
54 |
QObject.connect(ctrl,SIGNAL('valueChanged(int)'),self.updateVolume) |
---|
55 |
|
---|