From: <tr...@ff...> - 2008-05-29 20:05:25
|
Author: ppalmers Date: 2008-05-29 13:05:33 -0700 (Thu, 29 May 2008) New Revision: 1236 Modified: branches/libffado-2.0/support/mixer/ffadomixer.in branches/libffado-2.0/support/mixer/mixer_phase24.py branches/libffado-2.0/support/mixer/mixer_phase24.ui Log: (re: #123) implement separate mixer for Phase X24 and Phase 24, needs testing. Modified: branches/libffado-2.0/support/mixer/ffadomixer.in =================================================================== --- branches/libffado-2.0/support/mixer/ffadomixer.in 2008-05-29 19:46:13 UTC (rev 1235) +++ branches/libffado-2.0/support/mixer/ffadomixer.in 2008-05-29 20:05:33 UTC (rev 1236) @@ -62,8 +62,8 @@ SupportedDevices=[ [(0x000aac, 0x00000003),'Phase88Control'], - [(0x000aac, 0x00000004),'PhaseX24Control'], - [(0x000aac, 0x00000007),'PhaseX24Control'], + [(0x000aac, 0x00000004),'Phase24Control'], + [(0x000aac, 0x00000007),'Phase24Control'], [(0x00130e, 0x00000003),'SaffireProMixer'], [(0x00130e, 0x00000006),'SaffireProMixer'], [(0x00130e, 0x00000000),'SaffireMixer'], Modified: branches/libffado-2.0/support/mixer/mixer_phase24.py =================================================================== --- branches/libffado-2.0/support/mixer/mixer_phase24.py 2008-05-29 19:46:13 UTC (rev 1235) +++ branches/libffado-2.0/support/mixer/mixer_phase24.py 2008-05-29 20:05:33 UTC (rev 1236) @@ -23,9 +23,9 @@ from qt import * from mixer_phase24ui import * -class PhaseX24Control(PhaseX24ControlUI): +class Phase24Control(Phase24ControlUI): def __init__(self,parent = None,name = None,fl = 0): - PhaseX24ControlUI.__init__(self,parent,name,fl) + Phase24ControlUI.__init__(self,parent,name,fl) self.init() # public slot @@ -50,6 +50,8 @@ # public slot def setVolumeMaster(self,a0): + if self.isPhaseX24: + return self.setVolume('master', a0) # public slot @@ -59,6 +61,8 @@ # public slot def setFrontLevel(self,a0): + if self.isPhaseX24: + return if(a0 == 0): print "setting front level to %d" % (0) self.hw.setContignuous('/Mixer/Feature_8', 0) @@ -99,7 +103,6 @@ print "Init PhaseX24 mixer window" self.VolumeControls={ - 'master': ['/Mixer/Feature_1', self.sldMaster], 'analogin' : ['/Mixer/Feature_6', self.sldLineIn], 'spdifin' : ['/Mixer/Feature_7', self.sldSPDIFIn], 'out12' : ['/Mixer/Feature_3', self.sldInput12], @@ -115,6 +118,29 @@ } def initValues(self): + self.modelId = self.configrom.getModelId() + if self.modelId == 0x00000007: + self.isPhaseX24 = True + else: + self.isPhaseX24 = False + + if self.isPhaseX24: + self.setCaption("Terratec Phase X24 Control") + self.cmbFrontLevel.setEnabled(False) + self.sldMaster.setEnabled(False) + else: + self.setCaption("Terratec Phase 24 Control") + + self.VolumeControls['master'] = ['/Mixer/Feature_1', self.sldMaster] + self.sldMaster.setEnabled(True) + + self.cmbFrontLevel.setEnabled(True) + val=self.hw.getContignuous('/Mixer/Feature_8') + if val>0: + self.cmbFrontLevel.setCurrentItem(1) + else: + self.cmbFrontLevel.setCurrentItem(0) + for name, ctrl in self.VolumeControls.iteritems(): vol = self.hw.getContignuous(ctrl[0]) print "%s volume is %d" % (name , vol) @@ -127,12 +153,6 @@ val=self.hw.getContignuous('/Mixer/Feature_2')/-768 if val>4: - self.cmbFrontLevel.setCurrentItem(4) + self.cmbLineLevel.setCurrentItem(4) else: - self.cmbFrontLevel.setCurrentItem(val) - - val=self.hw.getContignuous('/Mixer/Feature_8') - if val>0: - self.cmbFrontLevel.setCurrentItem(1) - else: - self.cmbFrontLevel.setCurrentItem(0) + self.cmbLineLevel.setCurrentItem(val) Modified: branches/libffado-2.0/support/mixer/mixer_phase24.ui =================================================================== --- branches/libffado-2.0/support/mixer/mixer_phase24.ui 2008-05-29 19:46:13 UTC (rev 1235) +++ branches/libffado-2.0/support/mixer/mixer_phase24.ui 2008-05-29 20:05:33 UTC (rev 1236) @@ -1,5 +1,5 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> -<class>PhaseX24ControlUI</class> +<class>Phase24ControlUI</class> <comment>Copyright (C) 2005-2008 by Pieter Palmers This file is part of FFADO @@ -19,7 +19,7 @@ </comment> <widget class="QWidget"> <property name="name"> - <cstring>PhaseX24ControlUI</cstring> + <cstring>Phase24ControlUI</cstring> </property> <property name="geometry"> <rect> @@ -624,73 +624,73 @@ <connection> <sender>sldInput12</sender> <signal>valueChanged(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setVolume12(int)</slot> </connection> <connection> <sender>sldInput34</sender> <signal>valueChanged(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setVolume34(int)</slot> </connection> <connection> <sender>sldLineIn</sender> <signal>valueChanged(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setVolumeLineIn(int)</slot> </connection> <connection> <sender>sldSPDIFOut</sender> <signal>valueChanged(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setVolumeSPDIFOut(int)</slot> </connection> <connection> <sender>sldSPDIFIn</sender> <signal>valueChanged(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setVolumeSPDIFIn(int)</slot> </connection> <connection> <sender>sldMaster</sender> <signal>valueChanged(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setVolumeMaster(int)</slot> </connection> <connection> <sender>cmbFrontLevel</sender> <signal>activated(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setFrontLevel(int)</slot> </connection> <connection> <sender>cmbSetSyncSource</sender> <signal>activated(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setSyncSource(int)</slot> </connection> <connection> <sender>cmbOutSourceSPDIF</sender> <signal>activated(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setOutSourceSPDIF(int)</slot> </connection> <connection> <sender>cmbOutSource12</sender> <signal>activated(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setOutSource12(int)</slot> </connection> <connection> <sender>cmbOutSource34</sender> <signal>activated(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setOutSource34(int)</slot> </connection> <connection> <sender>cmbLineLevel</sender> <signal>activated(int)</signal> - <receiver>PhaseX24ControlUI</receiver> + <receiver>Phase24ControlUI</receiver> <slot>setLineLevel(int)</slot> </connection> </connections> |