| 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 PyQt4.QtCore import SIGNAL, SLOT, QObject |
|---|
| 24 |
from PyQt4.QtGui import QWidget, QHBoxLayout |
|---|
| 25 |
from mixer_saffire_base import SaffireMixerBase |
|---|
| 26 |
from mixer_saffire_stereoui import Ui_SaffireMixerStereoUI |
|---|
| 27 |
from mixer_saffire_monoui import Ui_SaffireMixerMonoUI |
|---|
| 28 |
from mixer_saffirele_smallui import Ui_SaffireLEMixerSmallUI |
|---|
| 29 |
from mixer_saffirele_largeui import Ui_SaffireLEMixerLargeUI |
|---|
| 30 |
|
|---|
| 31 |
import logging |
|---|
| 32 |
log = logging.getLogger('saffire') |
|---|
| 33 |
|
|---|
| 34 |
#MIXER LAYOUT: |
|---|
| 35 |
# |
|---|
| 36 |
# |-- Out9/10--| |-- Out1/2 --| |-- Out3/4 --| |-- Out5/6 --| |-- Out7/8 --| |
|---|
| 37 |
#P5 0: 0/ 0 1: 110/ 110 2: 0/ 0 3: 0/ 0 4: 0/ 0 |
|---|
| 38 |
#P1 5: 0/ 0 6:32767/32767 7: 0/ 0 8: 0/ 0 9: 0/ 0 |
|---|
| 39 |
#P2 10: 0/ 0 11: 0/ 0 12:32767/32767 13: 0/ 0 14: 0/ 0 |
|---|
| 40 |
#P3 15: 0/ 0 16: 0/ 0 17: 0/ 0 18:32767/32767 19: 0/ 0 |
|---|
| 41 |
#P4 20: 0/ 0 21: 0/ 0 22: 0/ 0 23: 0/ 0 24:32767/32767 |
|---|
| 42 |
#R1 25: 0/ 0 26: 0/ 0 27: 0/ 0 28: 0/ 0 29: 0/ 0 |
|---|
| 43 |
#R2 30: 0/ 0 31: 0/ 0 32: 0/ 0 33: 0/ 0 34: 0/ 0 |
|---|
| 44 |
#Fx 35: 0/ 0 36: 0/ 0 37: 0/ 0 38: 0/ 0 39: 0/ 0 |
|---|
| 45 |
# |
|---|
| 46 |
#P5: DAW ch 9/10 |
|---|
| 47 |
#P1: DAW ch 1/2 |
|---|
| 48 |
#P2: DAW ch 3/4 |
|---|
| 49 |
#P3: DAW ch 5/6 |
|---|
| 50 |
#P4: DAW ch 7/8 |
|---|
| 51 |
#R1: HW INPUT ch 1/2 |
|---|
| 52 |
#R2: HW INPUT ch 3/4 |
|---|
| 53 |
#Fx: reverb/fx return |
|---|
| 54 |
|
|---|
| 55 |
class SaffireMixer(QWidget): |
|---|
| 56 |
def __init__(self,parent = None): |
|---|
| 57 |
QWidget.__init__(self, parent) |
|---|
| 58 |
|
|---|
| 59 |
self.mono_mode = False |
|---|
| 60 |
self.is_saffire_le = False |
|---|
| 61 |
|
|---|
| 62 |
# make a layout |
|---|
| 63 |
self.layout = QHBoxLayout() |
|---|
| 64 |
self.setLayout(self.layout) |
|---|
| 65 |
|
|---|
| 66 |
def show(self): |
|---|
| 67 |
self.selectCorrectMode() |
|---|
| 68 |
QWidget.show(self) |
|---|
| 69 |
|
|---|
| 70 |
def getMonoMode(self): |
|---|
| 71 |
return self.hw.getDiscrete('/Mixer/MonoMode') |
|---|
| 72 |
def setMonoMode(self, mode): |
|---|
| 73 |
if mode: |
|---|
| 74 |
self.hw.setDiscrete('/Mixer/MonoMode', 1) |
|---|
| 75 |
else: |
|---|
| 76 |
self.hw.setDiscrete('/Mixer/MonoMode', 0) |
|---|
| 77 |
self.mono_mode = self.getMonoMode() |
|---|
| 78 |
|
|---|
| 79 |
def getDisplayTitle(self): |
|---|
| 80 |
if self.is_saffire_le: |
|---|
| 81 |
return "SaffireLE" |
|---|
| 82 |
else: |
|---|
| 83 |
return "Saffire" |
|---|
| 84 |
|
|---|
| 85 |
def selectCorrectMode(self): |
|---|
| 86 |
if self.is_saffire_le: |
|---|
| 87 |
if self.samplerate <= 48000: |
|---|
| 88 |
log.debug("large") |
|---|
| 89 |
self.small.hide() |
|---|
| 90 |
self.large.initValues() |
|---|
| 91 |
self.large.show() |
|---|
| 92 |
else: |
|---|
| 93 |
log.debug("small") |
|---|
| 94 |
self.large.hide() |
|---|
| 95 |
self.small.initValues() |
|---|
| 96 |
self.small.show() |
|---|
| 97 |
else: |
|---|
| 98 |
if self.mono_mode: |
|---|
| 99 |
self.stereo.hide() |
|---|
| 100 |
self.mono.initValues() |
|---|
| 101 |
self.mono.show() |
|---|
| 102 |
else: |
|---|
| 103 |
self.mono.hide() |
|---|
| 104 |
self.stereo.initValues() |
|---|
| 105 |
self.stereo.show() |
|---|
| 106 |
|
|---|
| 107 |
def initValues(self): |
|---|
| 108 |
selected = self.samplerateselect.selected() |
|---|
| 109 |
label = self.samplerateselect.getEnumLabel( selected ) |
|---|
| 110 |
try: |
|---|
| 111 |
self.samplerate = int(label) |
|---|
| 112 |
except: |
|---|
| 113 |
# FIXME: this should be handled properly |
|---|
| 114 |
self.samplerate = 44100 |
|---|
| 115 |
|
|---|
| 116 |
# Saffire: 0x130e010001???? |
|---|
| 117 |
# SaffireLE: 0x130e010004???? |
|---|
| 118 |
if int(self.configrom.getGUID(), 16) >= 0x130e0100040000: |
|---|
| 119 |
self.is_saffire_le = True |
|---|
| 120 |
log.debug("Found SaffireLE GUID") |
|---|
| 121 |
else: |
|---|
| 122 |
self.is_saffire_le = False |
|---|
| 123 |
log.debug("Found Saffire GUID") |
|---|
| 124 |
|
|---|
| 125 |
# init depending on what device we have |
|---|
| 126 |
# and what mode it is in |
|---|
| 127 |
if self.is_saffire_le: |
|---|
| 128 |
# create the child widgets |
|---|
| 129 |
self.small = SaffireLEMixerSmall(self) |
|---|
| 130 |
self.layout.addWidget(self.small) |
|---|
| 131 |
self.large = SaffireLEMixerLarge(self) |
|---|
| 132 |
self.layout.addWidget(self.large) |
|---|
| 133 |
|
|---|
| 134 |
self.small.hw = self.hw |
|---|
| 135 |
self.small.configrom = self.configrom |
|---|
| 136 |
|
|---|
| 137 |
self.large.hw = self.hw |
|---|
| 138 |
self.large.configrom = self.configrom |
|---|
| 139 |
else: |
|---|
| 140 |
# create the child widgets |
|---|
| 141 |
self.mono = SaffireMixerMono(self) |
|---|
| 142 |
self.layout.addWidget(self.mono) |
|---|
| 143 |
self.stereo = SaffireMixerStereo(self) |
|---|
| 144 |
self.layout.addWidget(self.stereo) |
|---|
| 145 |
|
|---|
| 146 |
self.mono_mode = self.getMonoMode() |
|---|
| 147 |
|
|---|
| 148 |
self.mono.hw = self.hw |
|---|
| 149 |
self.mono.configrom = self.configrom |
|---|
| 150 |
|
|---|
| 151 |
self.stereo.hw = self.hw |
|---|
| 152 |
self.stereo.configrom = self.configrom |
|---|
| 153 |
|
|---|
| 154 |
self.selectCorrectMode() |
|---|
| 155 |
|
|---|
| 156 |
def polledUpdate(self): |
|---|
| 157 |
if self.is_saffire_le: |
|---|
| 158 |
if self.samplerate <= 48000: |
|---|
| 159 |
self.large.polledUpdate() |
|---|
| 160 |
else: |
|---|
| 161 |
self.small.polledUpdate() |
|---|
| 162 |
else: |
|---|
| 163 |
if self.mono_mode: |
|---|
| 164 |
self.mono.polledUpdate() |
|---|
| 165 |
else: |
|---|
| 166 |
self.stereo.polledUpdate() |
|---|
| 167 |
|
|---|
| 168 |
class SaffireMixerStereo(QWidget, Ui_SaffireMixerStereoUI, SaffireMixerBase): |
|---|
| 169 |
def __init__(self,parent = None): |
|---|
| 170 |
self.my_parent = parent |
|---|
| 171 |
QWidget.__init__(self,parent) |
|---|
| 172 |
self.setupUi(self) |
|---|
| 173 |
SaffireMixerBase.__init__(self) |
|---|
| 174 |
QObject.connect(self.btnRefresh, SIGNAL('clicked()'), self.updateValues) |
|---|
| 175 |
QObject.connect(self.btnSwitchStereoMode, SIGNAL('clicked()'), self.switchStereoMode) |
|---|
| 176 |
|
|---|
| 177 |
self.VolumeControls={ |
|---|
| 178 |
self.sldPC910Out910: ['/Mixer/MatrixMixerStereo', 0, 0], |
|---|
| 179 |
self.sldPC910Out12: ['/Mixer/MatrixMixerStereo', 0, 1], |
|---|
| 180 |
self.sldPC910Out34: ['/Mixer/MatrixMixerStereo', 0, 2], |
|---|
| 181 |
self.sldPC910Out56: ['/Mixer/MatrixMixerStereo', 0, 3], |
|---|
| 182 |
self.sldPC910Out78: ['/Mixer/MatrixMixerStereo', 0, 4], |
|---|
| 183 |
self.sldPC12Out910: ['/Mixer/MatrixMixerStereo', 1, 0], |
|---|
| 184 |
self.sldPC12Out12: ['/Mixer/MatrixMixerStereo', 1, 1], |
|---|
| 185 |
self.sldPC12Out34: ['/Mixer/MatrixMixerStereo', 1, 2], |
|---|
| 186 |
self.sldPC12Out56: ['/Mixer/MatrixMixerStereo', 1, 3], |
|---|
| 187 |
self.sldPC12Out78: ['/Mixer/MatrixMixerStereo', 1, 4], |
|---|
| 188 |
self.sldPC34Out910: ['/Mixer/MatrixMixerStereo', 2, 0], |
|---|
| 189 |
self.sldPC34Out12: ['/Mixer/MatrixMixerStereo', 2, 1], |
|---|
| 190 |
self.sldPC34Out34: ['/Mixer/MatrixMixerStereo', 2, 2], |
|---|
| 191 |
self.sldPC34Out56: ['/Mixer/MatrixMixerStereo', 2, 3], |
|---|
| 192 |
self.sldPC34Out78: ['/Mixer/MatrixMixerStereo', 2, 4], |
|---|
| 193 |
self.sldPC56Out910: ['/Mixer/MatrixMixerStereo', 3, 0], |
|---|
| 194 |
self.sldPC56Out12: ['/Mixer/MatrixMixerStereo', 3, 1], |
|---|
| 195 |
self.sldPC56Out34: ['/Mixer/MatrixMixerStereo', 3, 2], |
|---|
| 196 |
self.sldPC56Out56: ['/Mixer/MatrixMixerStereo', 3, 3], |
|---|
| 197 |
self.sldPC56Out78: ['/Mixer/MatrixMixerStereo', 3, 4], |
|---|
| 198 |
self.sldPC78Out910: ['/Mixer/MatrixMixerStereo', 4, 0], |
|---|
| 199 |
self.sldPC78Out12: ['/Mixer/MatrixMixerStereo', 4, 1], |
|---|
| 200 |
self.sldPC78Out34: ['/Mixer/MatrixMixerStereo', 4, 2], |
|---|
| 201 |
self.sldPC78Out56: ['/Mixer/MatrixMixerStereo', 4, 3], |
|---|
| 202 |
self.sldPC78Out78: ['/Mixer/MatrixMixerStereo', 4, 4], |
|---|
| 203 |
|
|---|
| 204 |
self.sldIN12Out910: ['/Mixer/MatrixMixerStereo', 5, 0], |
|---|
| 205 |
self.sldIN12Out12: ['/Mixer/MatrixMixerStereo', 5, 1], |
|---|
| 206 |
self.sldIN12Out34: ['/Mixer/MatrixMixerStereo', 5, 2], |
|---|
| 207 |
self.sldIN12Out56: ['/Mixer/MatrixMixerStereo', 5, 3], |
|---|
| 208 |
self.sldIN12Out78: ['/Mixer/MatrixMixerStereo', 5, 4], |
|---|
| 209 |
self.sldIN34Out910: ['/Mixer/MatrixMixerStereo', 6, 0], |
|---|
| 210 |
self.sldIN34Out12: ['/Mixer/MatrixMixerStereo', 6, 1], |
|---|
| 211 |
self.sldIN34Out34: ['/Mixer/MatrixMixerStereo', 6, 2], |
|---|
| 212 |
self.sldIN34Out56: ['/Mixer/MatrixMixerStereo', 6, 3], |
|---|
| 213 |
self.sldIN34Out78: ['/Mixer/MatrixMixerStereo', 6, 4], |
|---|
| 214 |
|
|---|
| 215 |
self.sldFXOut910: ['/Mixer/MatrixMixerStereo', 7, 0], |
|---|
| 216 |
self.sldFXOut12: ['/Mixer/MatrixMixerStereo', 7, 1], |
|---|
| 217 |
self.sldFXOut34: ['/Mixer/MatrixMixerStereo', 7, 2], |
|---|
| 218 |
self.sldFXOut56: ['/Mixer/MatrixMixerStereo', 7, 3], |
|---|
| 219 |
self.sldFXOut78: ['/Mixer/MatrixMixerStereo', 7, 4], |
|---|
| 220 |
} |
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 |
# First column is the DBUS subpath of the control. |
|---|
| 224 |
# Second column is a list of linked controls that should |
|---|
| 225 |
# be rewritten whenever this control is updated |
|---|
| 226 |
self.SelectorControls={ |
|---|
| 227 |
self.chkSpdifSwitch: ['/Mixer/SpdifSwitch'], |
|---|
| 228 |
self.chkOut12Mute: ['/Mixer/Out12Mute', [self.chkOut12HwCtrl]], |
|---|
| 229 |
self.chkOut12HwCtrl: ['/Mixer/Out12HwCtrl'], |
|---|
| 230 |
self.chkOut12Dim: ['/Mixer/Out12Dim'], |
|---|
| 231 |
self.chkOut34Mute: ['/Mixer/Out34Mute', [self.chkOut34HwCtrl]], |
|---|
| 232 |
self.chkOut34HwCtrl: ['/Mixer/Out34HwCtrl'], |
|---|
| 233 |
self.chkOut56Mute: ['/Mixer/Out56Mute', [self.chkOut56HwCtrl]], |
|---|
| 234 |
self.chkOut56HwCtrl: ['/Mixer/Out56HwCtrl'], |
|---|
| 235 |
self.chkOut78Mute: ['/Mixer/Out78Mute', [self.chkOut78HwCtrl]], |
|---|
| 236 |
self.chkOut78HwCtrl: ['/Mixer/Out78HwCtrl'], |
|---|
| 237 |
self.chkOut910Mute: ['/Mixer/Out910Mute'], |
|---|
| 238 |
} |
|---|
| 239 |
|
|---|
| 240 |
self.VolumeControlsLowRes={ |
|---|
| 241 |
self.sldOut12Level: ['/Mixer/Out12Level'], |
|---|
| 242 |
self.sldOut34Level: ['/Mixer/Out34Level'], |
|---|
| 243 |
self.sldOut56Level: ['/Mixer/Out56Level'], |
|---|
| 244 |
self.sldOut78Level: ['/Mixer/Out78Level'], |
|---|
| 245 |
} |
|---|
| 246 |
|
|---|
| 247 |
self.TriggerButtonControls={ |
|---|
| 248 |
self.btnSaveSettings: ['/Mixer/SaveSettings'], |
|---|
| 249 |
} |
|---|
| 250 |
|
|---|
| 251 |
self.TextControls={ |
|---|
| 252 |
} |
|---|
| 253 |
|
|---|
| 254 |
self.saveTextControls={ |
|---|
| 255 |
} |
|---|
| 256 |
|
|---|
| 257 |
self.ComboControls={ |
|---|
| 258 |
} |
|---|
| 259 |
|
|---|
| 260 |
def polledUpdate(self): |
|---|
| 261 |
self.polledUpdateHwCtrl(self.chkOut12HwCtrl, self.sldOut12Level) |
|---|
| 262 |
self.polledUpdateHwCtrl(self.chkOut34HwCtrl, self.sldOut34Level) |
|---|
| 263 |
self.polledUpdateHwCtrl(self.chkOut56HwCtrl, self.sldOut56Level) |
|---|
| 264 |
self.polledUpdateHwCtrl(self.chkOut78HwCtrl, self.sldOut78Level) |
|---|
| 265 |
|
|---|
| 266 |
def polledUpdateHwCtrl(self, selector, volctrl): |
|---|
| 267 |
state = selector.isChecked() |
|---|
| 268 |
if state: |
|---|
| 269 |
self.polledUpdateVolumeLowRes('/Mixer/MonitorDial', volctrl, 64) |
|---|
| 270 |
volctrl.setEnabled(False) |
|---|
| 271 |
else: |
|---|
| 272 |
volctrl.setEnabled(True) |
|---|
| 273 |
|
|---|
| 274 |
def updateMatrixVolume(self,a0): |
|---|
| 275 |
SaffireMixerBase.updateMatrixVolume(self,a0) |
|---|
| 276 |
def updateLowResVolume(self,a0): |
|---|
| 277 |
SaffireMixerBase.updateLowResVolume(self,a0) |
|---|
| 278 |
def updateSelector(self,a0): |
|---|
| 279 |
SaffireMixerBase.updateSelector(self,a0) |
|---|
| 280 |
def triggerButton(self): |
|---|
| 281 |
SaffireMixerBase.triggerButton(self) |
|---|
| 282 |
def saveText(self): |
|---|
| 283 |
SaffireMixerBase.saveText(self) |
|---|
| 284 |
def initCombo(self, combo): |
|---|
| 285 |
SaffireMixerBase.initCombo(self,combo) |
|---|
| 286 |
def selectCombo(self, mode): |
|---|
| 287 |
SaffireMixerBase.selectCombo(self,mode) |
|---|
| 288 |
|
|---|
| 289 |
def updateValues(self): |
|---|
| 290 |
SaffireMixerBase.updateValues(self) |
|---|
| 291 |
def switchStereoMode(self): |
|---|
| 292 |
log.debug("should switch to mono mode") |
|---|
| 293 |
self.my_parent.setMonoMode(1) |
|---|
| 294 |
self.my_parent.selectCorrectMode() |
|---|
| 295 |
|
|---|
| 296 |
class SaffireMixerMono(QWidget, Ui_SaffireMixerMonoUI, SaffireMixerBase): |
|---|
| 297 |
def __init__(self,parent = None): |
|---|
| 298 |
self.my_parent = parent |
|---|
| 299 |
QWidget.__init__(self,parent) |
|---|
| 300 |
self.setupUi(self) |
|---|
| 301 |
SaffireMixerBase.__init__(self) |
|---|
| 302 |
QObject.connect(self.btnRefresh, SIGNAL('clicked()'), self.updateValues) |
|---|
| 303 |
QObject.connect(self.btnSwitchStereoMode, SIGNAL('clicked()'), self.switchStereoMode) |
|---|
| 304 |
|
|---|
| 305 |
self.VolumeControls={ |
|---|
| 306 |
self.sldIN1Out910: ['/Mixer/MatrixMixerMono', 0, 0], |
|---|
| 307 |
self.sldIN1Out12: ['/Mixer/MatrixMixerMono', 0, 1], |
|---|
| 308 |
self.sldIN1Out34: ['/Mixer/MatrixMixerMono', 0, 2], |
|---|
| 309 |
self.sldIN1Out56: ['/Mixer/MatrixMixerMono', 0, 3], |
|---|
| 310 |
self.sldIN1Out78: ['/Mixer/MatrixMixerMono', 0, 4], |
|---|
| 311 |
self.sldIN3Out910: ['/Mixer/MatrixMixerMono', 1, 0], |
|---|
| 312 |
self.sldIN3Out12: ['/Mixer/MatrixMixerMono', 1, 1], |
|---|
| 313 |
self.sldIN3Out34: ['/Mixer/MatrixMixerMono', 1, 2], |
|---|
| 314 |
self.sldIN3Out56: ['/Mixer/MatrixMixerMono', 1, 3], |
|---|
| 315 |
self.sldIN3Out78: ['/Mixer/MatrixMixerMono', 1, 4], |
|---|
| 316 |
self.sldFX1Out910: ['/Mixer/MatrixMixerMono', 2, 0], |
|---|
| 317 |
self.sldFX1Out12: ['/Mixer/MatrixMixerMono', 2, 1], |
|---|
| 318 |
self.sldFX1Out34: ['/Mixer/MatrixMixerMono', 2, 2], |
|---|
| 319 |
self.sldFX1Out56: ['/Mixer/MatrixMixerMono', 2, 3], |
|---|
| 320 |
self.sldFX1Out78: ['/Mixer/MatrixMixerMono', 2, 4], |
|---|
| 321 |
self.sldIN2Out910: ['/Mixer/MatrixMixerMono', 3, 0], |
|---|
| 322 |
self.sldIN2Out12: ['/Mixer/MatrixMixerMono', 3, 1], |
|---|
| 323 |
self.sldIN2Out34: ['/Mixer/MatrixMixerMono', 3, 2], |
|---|
| 324 |
self.sldIN2Out56: ['/Mixer/MatrixMixerMono', 3, 3], |
|---|
| 325 |
self.sldIN2Out78: ['/Mixer/MatrixMixerMono', 3, 4], |
|---|
| 326 |
self.sldIN4Out910: ['/Mixer/MatrixMixerMono', 4, 0], |
|---|
| 327 |
self.sldIN4Out12: ['/Mixer/MatrixMixerMono', 4, 1], |
|---|
| 328 |
self.sldIN4Out34: ['/Mixer/MatrixMixerMono', 4, 2], |
|---|
| 329 |
self.sldIN4Out56: ['/Mixer/MatrixMixerMono', 4, 3], |
|---|
| 330 |
self.sldIN4Out78: ['/Mixer/MatrixMixerMono', 4, 4], |
|---|
| 331 |
self.sldFX2Out910: ['/Mixer/MatrixMixerMono', 5, 0], |
|---|
| 332 |
self.sldFX2Out12: ['/Mixer/MatrixMixerMono', 5, 1], |
|---|
| 333 |
self.sldFX2Out34: ['/Mixer/MatrixMixerMono', 5, 2], |
|---|
| 334 |
self.sldFX2Out56: ['/Mixer/MatrixMixerMono', 5, 3], |
|---|
| 335 |
self.sldFX2Out78: ['/Mixer/MatrixMixerMono', 5, 4], |
|---|
| 336 |
|
|---|
| 337 |
self.sldPC910Out910: ['/Mixer/MatrixMixerMono', 6, 0], |
|---|
| 338 |
self.sldPC910Out12: ['/Mixer/MatrixMixerMono', 6, 1], |
|---|
| 339 |
self.sldPC910Out34: ['/Mixer/MatrixMixerMono', 6, 2], |
|---|
| 340 |
self.sldPC910Out56: ['/Mixer/MatrixMixerMono', 6, 3], |
|---|
| 341 |
self.sldPC910Out78: ['/Mixer/MatrixMixerMono', 6, 4], |
|---|
| 342 |
self.sldPC12Out910: ['/Mixer/MatrixMixerMono', 7, 0], |
|---|
| 343 |
self.sldPC12Out12: ['/Mixer/MatrixMixerMono', 7, 1], |
|---|
| 344 |
self.sldPC12Out34: ['/Mixer/MatrixMixerMono', 7, 2], |
|---|
| 345 |
self.sldPC12Out56: ['/Mixer/MatrixMixerMono', 7, 3], |
|---|
| 346 |
self.sldPC12Out78: ['/Mixer/MatrixMixerMono', 7, 4], |
|---|
| 347 |
self.sldPC34Out910: ['/Mixer/MatrixMixerMono', 8, 0], |
|---|
| 348 |
self.sldPC34Out12: ['/Mixer/MatrixMixerMono', 8, 1], |
|---|
| 349 |
self.sldPC34Out34: ['/Mixer/MatrixMixerMono', 8, 2], |
|---|
| 350 |
self.sldPC34Out56: ['/Mixer/MatrixMixerMono', 8, 3], |
|---|
| 351 |
self.sldPC34Out78: ['/Mixer/MatrixMixerMono', 8, 4], |
|---|
| 352 |
self.sldPC56Out910: ['/Mixer/MatrixMixerMono', 9, 0], |
|---|
| 353 |
self.sldPC56Out12: ['/Mixer/MatrixMixerMono', 9, 1], |
|---|
| 354 |
self.sldPC56Out34: ['/Mixer/MatrixMixerMono', 9, 2], |
|---|
| 355 |
self.sldPC56Out56: ['/Mixer/MatrixMixerMono', 9, 3], |
|---|
| 356 |
self.sldPC56Out78: ['/Mixer/MatrixMixerMono', 9, 4], |
|---|
| 357 |
self.sldPC78Out910: ['/Mixer/MatrixMixerMono', 10, 0], |
|---|
| 358 |
self.sldPC78Out12: ['/Mixer/MatrixMixerMono', 10, 1], |
|---|
| 359 |
self.sldPC78Out34: ['/Mixer/MatrixMixerMono', 10, 2], |
|---|
| 360 |
self.sldPC78Out56: ['/Mixer/MatrixMixerMono', 10, 3], |
|---|
| 361 |
self.sldPC78Out78: ['/Mixer/MatrixMixerMono', 10, 4], |
|---|
| 362 |
|
|---|
| 363 |
|
|---|
| 364 |
} |
|---|
| 365 |
|
|---|
| 366 |
|
|---|
| 367 |
# First column is the DBUS subpath of the control. |
|---|
| 368 |
# Second column is a list of linked controls that should |
|---|
| 369 |
# be rewritten whenever this control is updated |
|---|
| 370 |
self.SelectorControls={ |
|---|
| 371 |
self.chkSpdifSwitch: ['/Mixer/SpdifSwitch'], |
|---|
| 372 |
self.chkOut12Mute: ['/Mixer/Out12Mute', [self.chkOut12HwCtrl]], |
|---|
| 373 |
self.chkOut12HwCtrl: ['/Mixer/Out12HwCtrl'], |
|---|
| 374 |
self.chkOut12Dim: ['/Mixer/Out12Dim'], |
|---|
| 375 |
self.chkOut34Mute: ['/Mixer/Out34Mute', [self.chkOut34HwCtrl]], |
|---|
| 376 |
self.chkOut34HwCtrl: ['/Mixer/Out34HwCtrl'], |
|---|
| 377 |
self.chkOut56Mute: ['/Mixer/Out56Mute', [self.chkOut56HwCtrl]], |
|---|
| 378 |
self.chkOut56HwCtrl: ['/Mixer/Out56HwCtrl'], |
|---|
| 379 |
self.chkOut78Mute: ['/Mixer/Out78Mute', [self.chkOut78HwCtrl]], |
|---|
| 380 |
self.chkOut78HwCtrl: ['/Mixer/Out78HwCtrl'], |
|---|
| 381 |
self.chkOut910Mute: ['/Mixer/Out910Mute'], |
|---|
| 382 |
} |
|---|
| 383 |
|
|---|
| 384 |
self.VolumeControlsLowRes={ |
|---|
| 385 |
self.sldOut12Level: ['/Mixer/Out12Level'], |
|---|
| 386 |
self.sldOut34Level: ['/Mixer/Out34Level'], |
|---|
| 387 |
self.sldOut56Level: ['/Mixer/Out56Level'], |
|---|
| 388 |
self.sldOut78Level: ['/Mixer/Out78Level'], |
|---|
| 389 |
} |
|---|
| 390 |
|
|---|
| 391 |
self.TriggerButtonControls={ |
|---|
| 392 |
self.btnSaveSettings: ['/Mixer/SaveSettings'], |
|---|
| 393 |
} |
|---|
| 394 |
|
|---|
| 395 |
self.TextControls={ |
|---|
| 396 |
} |
|---|
| 397 |
|
|---|
| 398 |
self.saveTextControls={ |
|---|
| 399 |
} |
|---|
| 400 |
|
|---|
| 401 |
self.ComboControls={ |
|---|
| 402 |
} |
|---|
| 403 |
|
|---|
| 404 |
def polledUpdate(self): |
|---|
| 405 |
self.polledUpdateHwCtrl(self.chkOut12HwCtrl, self.sldOut12Level) |
|---|
| 406 |
self.polledUpdateHwCtrl(self.chkOut34HwCtrl, self.sldOut34Level) |
|---|
| 407 |
self.polledUpdateHwCtrl(self.chkOut56HwCtrl, self.sldOut56Level) |
|---|
| 408 |
self.polledUpdateHwCtrl(self.chkOut78HwCtrl, self.sldOut78Level) |
|---|
| 409 |
|
|---|
| 410 |
def polledUpdateHwCtrl(self, selector, volctrl): |
|---|
| 411 |
state = selector.isChecked() |
|---|
| 412 |
if state: |
|---|
| 413 |
self.polledUpdateVolumeLowRes('/Mixer/MonitorDial', volctrl, 4) |
|---|
| 414 |
volctrl.setEnabled(False) |
|---|
| 415 |
else: |
|---|
| 416 |
volctrl.setEnabled(True) |
|---|
| 417 |
|
|---|
| 418 |
def updateMatrixVolume(self,a0): |
|---|
| 419 |
SaffireMixerBase.updateMatrixVolume(self,a0) |
|---|
| 420 |
def updateLowResVolume(self,a0): |
|---|
| 421 |
SaffireMixerBase.updateLowResVolume(self,a0) |
|---|
| 422 |
def updateSelector(self,a0): |
|---|
| 423 |
SaffireMixerBase.updateSelector(self,a0) |
|---|
| 424 |
def triggerButton(self): |
|---|
| 425 |
SaffireMixerBase.triggerButton(self) |
|---|
| 426 |
def saveText(self): |
|---|
| 427 |
SaffireMixerBase.saveText(self) |
|---|
| 428 |
def initCombo(self, combo): |
|---|
| 429 |
SaffireMixerBase.initCombo(self,combo) |
|---|
| 430 |
def selectCombo(self, mode): |
|---|
| 431 |
SaffireMixerBase.selectCombo(self,mode) |
|---|
| 432 |
|
|---|
| 433 |
def updateValues(self): |
|---|
| 434 |
SaffireMixerBase.updateValues(self) |
|---|
| 435 |
|
|---|
| 436 |
def switchStereoMode(self): |
|---|
| 437 |
log.debug("should switch to stereo mode") |
|---|
| 438 |
self.my_parent.setMonoMode(0) |
|---|
| 439 |
self.my_parent.selectCorrectMode() |
|---|
| 440 |
|
|---|
| 441 |
class SaffireLEMixerLarge(QWidget, Ui_SaffireLEMixerLargeUI, SaffireMixerBase): |
|---|
| 442 |
def __init__(self,parent = None): |
|---|
| 443 |
self.my_parent = parent |
|---|
| 444 |
QWidget.__init__(self,parent) |
|---|
| 445 |
self.setupUi(self) |
|---|
| 446 |
SaffireMixerBase.__init__(self) |
|---|
| 447 |
|
|---|
| 448 |
log.debug("Init large Saffire LE mixer window") |
|---|
| 449 |
|
|---|
| 450 |
self.VolumeControls={ |
|---|
| 451 |
self.sldIN1Out1: ['/Mixer/LEMix48', 0, 0], |
|---|
| 452 |
self.sldIN1Out2: ['/Mixer/LEMix48', 0, 1], |
|---|
| 453 |
self.sldIN1Out3: ['/Mixer/LEMix48', 0, 2], |
|---|
| 454 |
self.sldIN1Out4: ['/Mixer/LEMix48', 0, 3], |
|---|
| 455 |
self.sldIN2Out1: ['/Mixer/LEMix48', 1, 0], |
|---|
| 456 |
self.sldIN2Out2: ['/Mixer/LEMix48', 1, 1], |
|---|
| 457 |
self.sldIN2Out3: ['/Mixer/LEMix48', 1, 2], |
|---|
| 458 |
self.sldIN2Out4: ['/Mixer/LEMix48', 1, 3], |
|---|
| 459 |
self.sldIN3Out1: ['/Mixer/LEMix48', 2, 0], |
|---|
| 460 |
self.sldIN3Out2: ['/Mixer/LEMix48', 2, 1], |
|---|
| 461 |
self.sldIN3Out3: ['/Mixer/LEMix48', 2, 2], |
|---|
| 462 |
self.sldIN3Out4: ['/Mixer/LEMix48', 2, 3], |
|---|
| 463 |
self.sldIN4Out1: ['/Mixer/LEMix48', 3, 0], |
|---|
| 464 |
self.sldIN4Out2: ['/Mixer/LEMix48', 3, 1], |
|---|
| 465 |
self.sldIN4Out3: ['/Mixer/LEMix48', 3, 2], |
|---|
| 466 |
self.sldIN4Out4: ['/Mixer/LEMix48', 3, 3], |
|---|
| 467 |
self.sldSPDIF1Out1: ['/Mixer/LEMix48', 4, 0], |
|---|
| 468 |
self.sldSPDIF1Out2: ['/Mixer/LEMix48', 4, 1], |
|---|
| 469 |
self.sldSPDIF1Out3: ['/Mixer/LEMix48', 4, 2], |
|---|
| 470 |
self.sldSPDIF1Out4: ['/Mixer/LEMix48', 4, 3], |
|---|
| 471 |
self.sldSPDIF2Out1: ['/Mixer/LEMix48', 5, 0], |
|---|
| 472 |
self.sldSPDIF2Out2: ['/Mixer/LEMix48', 5, 1], |
|---|
| 473 |
self.sldSPDIF2Out3: ['/Mixer/LEMix48', 5, 2], |
|---|
| 474 |
self.sldSPDIF2Out4: ['/Mixer/LEMix48', 5, 3], |
|---|
| 475 |
|
|---|
| 476 |
self.sldPC1Out1: ['/Mixer/LEMix48', 6, 0], |
|---|
| 477 |
self.sldPC1Out2: ['/Mixer/LEMix48', 6, 1], |
|---|
| 478 |
self.sldPC1Out3: ['/Mixer/LEMix48', 6, 2], |
|---|
| 479 |
self.sldPC1Out4: ['/Mixer/LEMix48', 6, 3], |
|---|
| 480 |
self.sldPC2Out1: ['/Mixer/LEMix48', 7, 0], |
|---|
| 481 |
self.sldPC2Out2: ['/Mixer/LEMix48', 7, 1], |
|---|
| 482 |
self.sldPC2Out3: ['/Mixer/LEMix48', 7, 2], |
|---|
| 483 |
self.sldPC2Out4: ['/Mixer/LEMix48', 7, 3], |
|---|
| 484 |
self.sldPC3Out1: ['/Mixer/LEMix48', 8, 0], |
|---|
| 485 |
self.sldPC3Out2: ['/Mixer/LEMix48', 8, 1], |
|---|
| 486 |
self.sldPC3Out3: ['/Mixer/LEMix48', 8, 2], |
|---|
| 487 |
self.sldPC3Out4: ['/Mixer/LEMix48', 8, 3], |
|---|
| 488 |
self.sldPC4Out1: ['/Mixer/LEMix48', 9, 0], |
|---|
| 489 |
self.sldPC4Out2: ['/Mixer/LEMix48', 9, 1], |
|---|
| 490 |
self.sldPC4Out3: ['/Mixer/LEMix48', 9, 2], |
|---|
| 491 |
self.sldPC4Out4: ['/Mixer/LEMix48', 9, 3], |
|---|
| 492 |
self.sldPC5Out1: ['/Mixer/LEMix48', 10, 0], |
|---|
| 493 |
self.sldPC5Out2: ['/Mixer/LEMix48', 10, 1], |
|---|
| 494 |
self.sldPC5Out3: ['/Mixer/LEMix48', 10, 2], |
|---|
| 495 |
self.sldPC5Out4: ['/Mixer/LEMix48', 10, 3], |
|---|
| 496 |
self.sldPC6Out1: ['/Mixer/LEMix48', 11, 0], |
|---|
| 497 |
self.sldPC6Out2: ['/Mixer/LEMix48', 11, 1], |
|---|
| 498 |
self.sldPC6Out3: ['/Mixer/LEMix48', 11, 2], |
|---|
| 499 |
self.sldPC6Out4: ['/Mixer/LEMix48', 11, 3], |
|---|
| 500 |
self.sldPC7Out1: ['/Mixer/LEMix48', 12, 0], |
|---|
| 501 |
self.sldPC7Out2: ['/Mixer/LEMix48', 12, 1], |
|---|
| 502 |
self.sldPC7Out3: ['/Mixer/LEMix48', 12, 2], |
|---|
| 503 |
self.sldPC7Out4: ['/Mixer/LEMix48', 12, 3], |
|---|
| 504 |
self.sldPC8Out1: ['/Mixer/LEMix48', 13, 0], |
|---|
| 505 |
self.sldPC8Out2: ['/Mixer/LEMix48', 13, 1], |
|---|
| 506 |
self.sldPC8Out3: ['/Mixer/LEMix48', 13, 2], |
|---|
| 507 |
self.sldPC8Out4: ['/Mixer/LEMix48', 13, 3], |
|---|
| 508 |
} |
|---|
| 509 |
|
|---|
| 510 |
self.SelectorControls={ |
|---|
| 511 |
self.chkOut12Mute: ['/Mixer/Out12Mute'], |
|---|
| 512 |
self.chkOut12HwCtrl: ['/Mixer/Out12HwCtrl'], |
|---|
| 513 |
self.chkOut34Mute: ['/Mixer/Out34Mute'], |
|---|
| 514 |
self.chkOut34HwCtrl: ['/Mixer/Out34HwCtrl'], |
|---|
| 515 |
self.chkOut56Mute: ['/Mixer/Out56Mute'], |
|---|
| 516 |
self.chkOut56HwCtrl: ['/Mixer/Out56HwCtrl'], |
|---|
| 517 |
self.chkSPDIFTransparent: ['/Mixer/SpdifTransparent'], |
|---|
| 518 |
self.chkMIDITru: ['/Mixer/MidiThru'], |
|---|
| 519 |
self.chkHighGain3: ['/Mixer/HighGainLine3'], |
|---|
| 520 |
self.chkHighGain4: ['/Mixer/HighGainLine4'], |
|---|
| 521 |
} |
|---|
| 522 |
|
|---|
| 523 |
self.VolumeControlsLowRes={ |
|---|
| 524 |
self.sldOut12Level: ['/Mixer/Out12Level'], |
|---|
| 525 |
self.sldOut34Level: ['/Mixer/Out34Level'], |
|---|
| 526 |
self.sldOut56Level: ['/Mixer/Out56Level'], |
|---|
| 527 |
} |
|---|
| 528 |
|
|---|
| 529 |
self.TriggerButtonControls={ |
|---|
| 530 |
self.btnSaveSettings: ['/Mixer/SaveSettings'], |
|---|
| 531 |
} |
|---|
| 532 |
|
|---|
| 533 |
self.TextControls={ |
|---|
| 534 |
} |
|---|
| 535 |
|
|---|
| 536 |
self.saveTextControls={ |
|---|
| 537 |
} |
|---|
| 538 |
|
|---|
| 539 |
self.ComboControls={ |
|---|
| 540 |
} |
|---|
| 541 |
|
|---|
| 542 |
def polledUpdate(self): |
|---|
| 543 |
#fixme do what it takes to make the gui follow the front panel dial |
|---|
| 544 |
pass |
|---|
| 545 |
|
|---|
| 546 |
def updateMatrixVolume(self,a0): |
|---|
| 547 |
SaffireMixerBase.updateMatrixVolume(self,a0) |
|---|
| 548 |
def updateLowResVolume(self,a0): |
|---|
| 549 |
SaffireMixerBase.updateLowResVolume(self,a0) |
|---|
| 550 |
def updateSelector(self,a0): |
|---|
| 551 |
SaffireMixerBase.updateSelector(self,a0) |
|---|
| 552 |
def triggerButton(self): |
|---|
| 553 |
SaffireMixerBase.triggerButton(self) |
|---|
| 554 |
def saveText(self): |
|---|
| 555 |
SaffireMixerBase.saveText(self) |
|---|
| 556 |
def initCombo(self, combo): |
|---|
| 557 |
SaffireMixerBase.initCombo(self,combo) |
|---|
| 558 |
def selectCombo(self, mode): |
|---|
| 559 |
SaffireMixerBase.selectCombo(self,mode) |
|---|
| 560 |
|
|---|
| 561 |
def updateValues(self): |
|---|
| 562 |
SaffireMixerBase.updateValues(self) |
|---|
| 563 |
|
|---|
| 564 |
class SaffireLEMixerSmall(QWidget, Ui_SaffireLEMixerSmallUI, SaffireMixerBase): |
|---|
| 565 |
def __init__(self,parent = None): |
|---|
| 566 |
self.my_parent = parent |
|---|
| 567 |
QWidget.__init__(self,parent) |
|---|
| 568 |
self.setupUi(self) |
|---|
| 569 |
SaffireMixerBase.__init__(self) |
|---|
| 570 |
|
|---|
| 571 |
log.debug("Init small Saffire LE mixer window") |
|---|
| 572 |
|
|---|
| 573 |
self.VolumeControls={ |
|---|
| 574 |
self.sldIN1RecMix: ['/Mixer/LEMix96', 0, 4], |
|---|
| 575 |
self.sldIN2RecMix: ['/Mixer/LEMix96', 1, 4], |
|---|
| 576 |
self.sldIN3RecMix: ['/Mixer/LEMix96', 2, 4], |
|---|
| 577 |
self.sldIN4RecMix: ['/Mixer/LEMix96', 3, 4], |
|---|
| 578 |
self.sldSPDIF1RecMix: ['/Mixer/LEMix96', 4, 4], |
|---|
| 579 |
self.sldSPDIF2RecMix: ['/Mixer/LEMix96', 5, 4], |
|---|
| 580 |
|
|---|
| 581 |
self.sldPC1Out1: ['/Mixer/LEMix96', 6, 0], |
|---|
| 582 |
self.sldPC1Out2: ['/Mixer/LEMix96', 6, 1], |
|---|
| 583 |
self.sldPC1Out3: ['/Mixer/LEMix96', 6, 2], |
|---|
| 584 |
self.sldPC1Out4: ['/Mixer/LEMix96', 6, 3], |
|---|
| 585 |
self.sldPC2Out1: ['/Mixer/LEMix96', 7, 0], |
|---|
| 586 |
self.sldPC2Out2: ['/Mixer/LEMix96', 7, 1], |
|---|
| 587 |
self.sldPC2Out3: ['/Mixer/LEMix96', 7, 2], |
|---|
| 588 |
self.sldPC2Out4: ['/Mixer/LEMix96', 7, 3], |
|---|
| 589 |
} |
|---|
| 590 |
|
|---|
| 591 |
self.SelectorControls={ |
|---|
| 592 |
self.chkOut12Mute: ['/Mixer/Out12Mute'], |
|---|
| 593 |
self.chkOut12HwCtrl: ['/Mixer/Out12HwCtrl'], |
|---|
| 594 |
self.chkOut34Mute: ['/Mixer/Out34Mute'], |
|---|
| 595 |
self.chkOut34HwCtrl: ['/Mixer/Out34HwCtrl'], |
|---|
| 596 |
self.chkOut56Mute: ['/Mixer/Out56Mute'], |
|---|
| 597 |
self.chkOut56HwCtrl: ['/Mixer/Out56HwCtrl'], |
|---|
| 598 |
self.chkSPDIFTransparent: ['/Mixer/SpdifTransparent'], |
|---|
| 599 |
self.chkMIDITru: ['/Mixer/MidiThru'], |
|---|
| 600 |
self.chkHighGain3: ['/Mixer/HighGainLine3'], |
|---|
| 601 |
self.chkHighGain4: ['/Mixer/HighGainLine4'], |
|---|
| 602 |
} |
|---|
| 603 |
|
|---|
| 604 |
self.VolumeControlsLowRes={ |
|---|
| 605 |
self.sldOut12Level: ['/Mixer/Out12Level'], |
|---|
| 606 |
self.sldOut34Level: ['/Mixer/Out34Level'], |
|---|
| 607 |
self.sldOut56Level: ['/Mixer/Out56Level'], |
|---|
| 608 |
} |
|---|
| 609 |
|
|---|
| 610 |
self.TriggerButtonControls={ |
|---|
| 611 |
self.btnSaveSettings: ['/Mixer/SaveSettings'], |
|---|
| 612 |
} |
|---|
| 613 |
|
|---|
| 614 |
self.TextControls={ |
|---|
| 615 |
} |
|---|
| 616 |
|
|---|
| 617 |
self.saveTextControls={ |
|---|
| 618 |
} |
|---|
| 619 |
|
|---|
| 620 |
self.ComboControls={ |
|---|
| 621 |
} |
|---|
| 622 |
|
|---|
| 623 |
def polledUpdate(self): |
|---|
| 624 |
#fixme do what it takes to make the gui follow the front panel dial |
|---|
| 625 |
pass |
|---|
| 626 |
|
|---|
| 627 |
def updateMatrixVolume(self,a0): |
|---|
| 628 |
SaffireMixerBase.updateMatrixVolume(self,a0) |
|---|
| 629 |
def updateLowResVolume(self,a0): |
|---|
| 630 |
SaffireMixerBase.updateLowResVolume(self,a0) |
|---|
| 631 |
def updateSelector(self,a0): |
|---|
| 632 |
SaffireMixerBase.updateSelector(self,a0) |
|---|
| 633 |
def triggerButton(self): |
|---|
| 634 |
SaffireMixerBase.triggerButton(self) |
|---|
| 635 |
def saveText(self): |
|---|
| 636 |
SaffireMixerBase.saveText(self) |
|---|
| 637 |
def initCombo(self, combo): |
|---|
| 638 |
SaffireMixerBase.initCombo(self,combo) |
|---|
| 639 |
def selectCombo(self, mode): |
|---|
| 640 |
SaffireMixerBase.selectCombo(self,mode) |
|---|
| 641 |
|
|---|
| 642 |
def updateValues(self): |
|---|
| 643 |
SaffireMixerBase.updateValues(self) |
|---|