From: <tr...@ff...> - 2011-07-28 15:51:35
|
Author: adi Date: 2011-07-28 08:23:50 -0700 (Thu, 28 Jul 2011) New Revision: 1987 Added: trunk/libffado/support/mixer-qt4/ffado/mixer/ozonic.py trunk/libffado/support/mixer-qt4/ffado/mixer/ozonic.ui Log: Add mixer for M-Audio Ozonic Patch provided by Mark Brand (orania). Re: #341 Added: trunk/libffado/support/mixer-qt4/ffado/mixer/ozonic.py =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/mixer/ozonic.py (rev 0) +++ trunk/libffado/support/mixer-qt4/ffado/mixer/ozonic.py 2011-07-28 15:23:50 UTC (rev 1987) @@ -0,0 +1,118 @@ +# +# Copyright (C) 2005-2008 by Daniel Wagner +# +# This file is part of FFADO +# FFADO = Free Firewire (pro-)audio drivers for linux +# +# FFADO is based upon FreeBoB. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +from PyQt4.QtCore import SIGNAL, SLOT, QObject +from PyQt4.QtGui import QWidget +from ffado.config import * +import logging +log = logging.getLogger('panelmanager') + +class Ozonic(QWidget): + def __init__(self,parent = None): + QWidget.__init__(self,parent) + uicLoad("ffado/mixer/ozonic", self) + + self.Controls={ + 'fader1' : ['/Mixer/Feature_Volume_1', 1, self.fader1], + 'fader2' : ['/Mixer/Feature_Volume_1', 2, self.fader2], + 'fader3' : ['/Mixer/Feature_Volume_2', 1, self.fader3], + 'fader4' : ['/Mixer/Feature_Volume_2', 2, self.fader4], + 'fader5' : ['/Mixer/Feature_Volume_3', 1, self.fader5], + 'fader6' : ['/Mixer/Feature_Volume_3', 2, self.fader6], + 'fader7' : ['/Mixer/Feature_Volume_4', 1, self.fader7], + 'fader8' : ['/Mixer/Feature_Volume_4', 2, self.fader8], + 'pan1' : ['/Mixer/Feature_LRBalance_1', 1, self.pan1], + 'pan2' : ['/Mixer/Feature_LRBalance_1', 2, self.pan2], + 'pan3' : ['/Mixer/Feature_LRBalance_2', 1, self.pan3], + 'pan4' : ['/Mixer/Feature_LRBalance_2', 2, self.pan4], + 'pan5' : ['/Mixer/Feature_LRBalance_3', 1, self.pan5], + 'pan6' : ['/Mixer/Feature_LRBalance_3', 2, self.pan6], + 'pan7' : ['/Mixer/Feature_LRBalance_4', 1, self.pan7], + 'pan8' : ['/Mixer/Feature_LRBalance_4', 2, self.pan8], + } + + def setFader1(self,a0): + self.setValue('fader1', a0) + + def setFader2(self,a0): + self.setValue('fader2', a0) + + def setFader3(self,a0): + self.setValue('fader3', a0) + + def setFader4(self,a0): + self.setValue('fader4', a0) + + def setFader5(self,a0): + self.setValue('fader5', a0) + + def setFader6(self,a0): + self.setValue('fader6', a0) + + def setFader7(self,a0): + self.setValue('fader7', a0) + + def setFader8(self,a0): + self.setValue('fader8', a0) + + def setPan1(self,a0): + self.setValue('pan1', a0) + + def setPan2(self,a0): + self.setValue('pan2', a0) + + def setPan3(self,a0): + self.setValue('pan3', a0) + + def setPan4(self,a0): + self.setValue('pan4', a0) + + def setPan5(self,a0): + self.setValue('pan5', a0) + + def setPan6(self,a0): + self.setValue('pan6', a0) + + def setPan7(self,a0): + self.setValue('pan7', a0) + + def setPan8(self,a0): + self.setValue('pan8', a0) + + def setValue(self,a0,a1): + name = a0 + val = a1 + ctrl = self.Controls[name] + if name[0:3] == 'pan' : + val = -a1 + log.debug("setting %s to %d" % (name, val)) + self.hw.setContignuous(ctrl[0], val, idx = ctrl[1]) + + def initValues(self): + for name, ctrl in self.Controls.iteritems(): + val = self.hw.getContignuous(ctrl[0], idx = ctrl[1]) + if name[0:3] == 'pan' : + val = -val + log.debug("%s value is %d" % (name , val)) + ctrl[2].setValue(val) + +# vim: et Added: trunk/libffado/support/mixer-qt4/ffado/mixer/ozonic.ui =================================================================== --- trunk/libffado/support/mixer-qt4/ffado/mixer/ozonic.ui (rev 0) +++ trunk/libffado/support/mixer-qt4/ffado/mixer/ozonic.ui 2011-07-28 15:23:50 UTC (rev 1987) @@ -0,0 +1,687 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <comment>Copyright (C) 2005-2008 by Daniel Wagner + + This file is part of FFADO + FFADO = Free Firewire (pro-)audio drivers for linux + + FFADO is based upon FreeBoB. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) version 3 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. +</comment> + <class>OzonicUI</class> + <widget class="QWidget" name="OzonicUI"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>604</width> + <height>356</height> + </rect> + </property> + <property name="windowTitle"> + <string>Ozonic</string> + </property> + <layout class="QGridLayout"> + <item row="0" column="1" colspan="2"> + <layout class="QHBoxLayout"> + <item> + <widget class="QGroupBox" name="groupBox1"> + <property name="title"> + <string/> + </property> + <layout class="QGridLayout"> + <item row="0" column="5"> + <widget class="QSlider" name="fader5"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBothSides</enum> + </property> + <property name="tickInterval"> + <number>1000</number> + </property> + </widget> + </item> + <item row="0" column="6"> + <widget class="QSlider" name="fader6"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBothSides</enum> + </property> + <property name="tickInterval"> + <number>1000</number> + </property> + </widget> + </item> + <item row="0" column="7"> + <widget class="QSlider" name="fader7"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBothSides</enum> + </property> + <property name="tickInterval"> + <number>1000</number> + </property> + </widget> + </item> + <item row="0" column="8"> + <widget class="QSlider" name="fader8"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBothSides</enum> + </property> + <property name="tickInterval"> + <number>1000</number> + </property> + </widget> + </item> + <item row="1" column="5"> + <widget class="QDial" name="pan5"> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>32512</number> + </property> + <property name="notchTarget"> + <double>65.250000000000000</double> + </property> + <property name="notchesVisible"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="6"> + <widget class="QDial" name="pan6"> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>32512</number> + </property> + <property name="notchTarget"> + <double>65.250000000000000</double> + </property> + <property name="notchesVisible"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="7"> + <widget class="QDial" name="pan7"> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>32512</number> + </property> + <property name="notchTarget"> + <double>65.250000000000000</double> + </property> + <property name="notchesVisible"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="8"> + <widget class="QDial" name="pan8"> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>32512</number> + </property> + <property name="notchTarget"> + <double>65.250000000000000</double> + </property> + <property name="notchesVisible"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="4"> + <widget class="QSlider" name="fader4"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBothSides</enum> + </property> + <property name="tickInterval"> + <number>1000</number> + </property> + </widget> + </item> + <item row="1" column="3"> + <widget class="QDial" name="pan3"> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>32512</number> + </property> + <property name="notchTarget"> + <double>65.250000000000000</double> + </property> + <property name="notchesVisible"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="3"> + <widget class="QSlider" name="fader3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBothSides</enum> + </property> + <property name="tickInterval"> + <number>1000</number> + </property> + </widget> + </item> + <item row="1" column="2"> + <widget class="QDial" name="pan2"> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>32512</number> + </property> + <property name="invertedAppearance"> + <bool>false</bool> + </property> + <property name="notchTarget"> + <double>65.250000000000000</double> + </property> + <property name="notchesVisible"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="4"> + <widget class="QDial" name="pan4"> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>32512</number> + </property> + <property name="notchTarget"> + <double>65.250000000000000</double> + </property> + <property name="notchesVisible"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QDial" name="pan1"> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>32512</number> + </property> + <property name="value"> + <number>0</number> + </property> + <property name="invertedControls"> + <bool>false</bool> + </property> + <property name="wrapping"> + <bool>false</bool> + </property> + <property name="notchTarget"> + <double>65.250000000000000</double> + </property> + <property name="notchesVisible"> + <bool>true</bool> + </property> + </widget> + </item> + <item row="0" column="2"> + <widget class="QSlider" name="fader2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBothSides</enum> + </property> + <property name="tickInterval"> + <number>1000</number> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QSlider" name="fader1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimum"> + <number>-32512</number> + </property> + <property name="maximum"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBothSides</enum> + </property> + <property name="tickInterval"> + <number>1000</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <layoutdefault spacing="6" margin="11"/> + <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> + <resources/> + <connections> + <connection> + <sender>fader1</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setFader1()</slot> + <hints> + <hint type="sourcelabel"> + <x>45</x> + <y>55</y> + </hint> + <hint type="destinationlabel"> + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>fader2</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setFader2()</slot> + <hints> + <hint type="sourcelabel"> + <x>159</x> + <y>160</y> + </hint> + <hint type="destinationlabel"> + <x>20</x> + <y>20</y> + </hint> + </hints> + </connection> + <connection> + <sender>fader3</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setFader3()</slot> + <hints> + <hint type="sourcelabel"> + <x>229</x> + <y>228</y> + </hint> + <hint type="destinationlabel"> + <x>167</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>fader4</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setFader4()</slot> + <hints> + <hint type="sourcelabel"> + <x>299</x> + <y>228</y> + </hint> + <hint type="destinationlabel"> + <x>167</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>fader5</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setFader5()</slot> + <hints> + <hint type="sourcelabel"> + <x>369</x> + <y>228</y> + </hint> + <hint type="destinationlabel"> + <x>167</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>fader6</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setFader6()</slot> + <hints> + <hint type="sourcelabel"> + <x>438</x> + <y>228</y> + </hint> + <hint type="destinationlabel"> + <x>167</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>fader7</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setFader7()</slot> + <hints> + <hint type="sourcelabel"> + <x>508</x> + <y>228</y> + </hint> + <hint type="destinationlabel"> + <x>167</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>fader8</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setFader8()</slot> + <hints> + <hint type="sourcelabel"> + <x>578</x> + <y>228</y> + </hint> + <hint type="destinationlabel"> + <x>167</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>pan1</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setPan1()</slot> + <hints> + <hint type="sourcelabel"> + <x>58</x> + <y>284</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>pan2</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setPan2()</slot> + <hints> + <hint type="sourcelabel"> + <x>128</x> + <y>284</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>pan3</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setPan3()</slot> + <hints> + <hint type="sourcelabel"> + <x>197</x> + <y>284</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>pan4</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setPan4()</slot> + <hints> + <hint type="sourcelabel"> + <x>267</x> + <y>284</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>pan5</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setPan5()</slot> + <hints> + <hint type="sourcelabel"> + <x>337</x> + <y>284</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>pan6</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setPan6()</slot> + <hints> + <hint type="sourcelabel"> + <x>407</x> + <y>284</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>pan7</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setPan7()</slot> + <hints> + <hint type="sourcelabel"> + <x>476</x> + <y>284</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>177</y> + </hint> + </hints> + </connection> + <connection> + <sender>pan8</sender> + <signal>valueChanged(int)</signal> + <receiver>OzonicUI</receiver> + <slot>setPan8()</slot> + <hints> + <hint type="sourcelabel"> + <x>546</x> + <y>284</y> + </hint> + <hint type="destinationlabel"> + <x>301</x> + <y>177</y> + </hint> + </hints> + </connection> + </connections> + <slots> + <slot>setFader1()</slot> + <slot>setFader2()</slot> + <slot>setFader3()</slot> + <slot>setFader4()</slot> + <slot>setFader5()</slot> + <slot>setFader6()</slot> + <slot>setFader7()</slot> + <slot>setFader8()</slot> + <slot>setPan1()</slot> + <slot>setPan2()</slot> + <slot>setPan3()</slot> + <slot>setPan4()</slot> + <slot>setPan5()</slot> + <slot>setPan6()</slot> + <slot>setPan7()</slot> + <slot>setPan8()</slot> + <slot>setEnhMix1()</slot> + <slot>setEnhMix2()</slot> + <slot>setEnhMix3()</slot> + </slots> +</ui> |