Läuft die Voice Acoustic VA-Remotecontrol (AllDSP AllControl) nativ unter Linux auf echtem wxGTK 3.0 — ohne Wine und ohne dekompilierten App-Code. Ausgeführt wird das unveränderte Python-2.7-Bytecode aus dem macOS-.app; C-Extensions (wxGTK/numpy/ scipy/PortAudio) kommen nativ aus Debian stretch. Enthält: va/ (Original-.pyc + pure-Python-Libs + Assets + launch.py mit den drei Linux-Fixes), Dockerfile/run.sh/entrypoint.sh, reference/ (dekompilierter Quellcode zum Debuggen) und README/STATUS. img.cache (378 MB, regenerierbar) ist per .gitignore ausgeschlossen. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1123 lines
53 KiB
Python
1123 lines
53 KiB
Python
# uncompyle6 version 3.9.3
|
|
# Python bytecode version base 2.6 (62161)
|
|
# Decompiled from: Python 3.9.25 (main, Oct 31 2025, 23:16:49)
|
|
# [GCC 14.2.0]
|
|
# Embedded file name: user_config_audio.pyc
|
|
# Compiled at: 2025-05-07 14:29:41
|
|
import wx, os, data_model, traceback, one_unit, ConfigParser, protocol, sys, select_keys, select_units, d_protocol, mytime
|
|
from user_config_helpers import *
|
|
inputSourceSelectOptions = {16: 'Signal Input ',
|
|
32: 'Gain Fader Output',
|
|
48: 'DSP Core Output',
|
|
64: 'Delay Output',
|
|
80: 'Sine Wave',
|
|
96: 'White Noise',
|
|
112: 'Pink Noise'}
|
|
outputSourceSelectOptions = {16: 'Link Bus ',
|
|
32: 'Mixer & Gain Fader Output',
|
|
48: 'DSP Core Output',
|
|
64: 'Delay Output',
|
|
240: 'FIR result'}
|
|
|
|
class audioRouting(wx.Panel):
|
|
|
|
def __init__(self, parent, frame, uiNumber, panelName):
|
|
self.frame = frame
|
|
self.name = panelName
|
|
self.uiNumber = uiNumber
|
|
print mytime.displayTime(), 'uca.ar.creating panel for UI number', uiNumber
|
|
self.parent = parent
|
|
self.lines = {}
|
|
wx.Panel.__init__(self, parent, size=(964, 500))
|
|
self.Show(True)
|
|
self.initFinished = False
|
|
return
|
|
|
|
def initMe(self, force=False):
|
|
if self.IsShown() == False and force == False:
|
|
return
|
|
if self.initFinished == True:
|
|
return 0
|
|
print mytime.displayTime(), 'uca.initMe audioRouting', self.name, 'visible:', self.IsShown(), 'force:', force
|
|
frame = self.frame
|
|
uiNumber = self.uiNumber
|
|
if os.name in mac_names:
|
|
y = 5
|
|
else:
|
|
y = 12
|
|
self.headerLabel = wx.StaticText(self, -1, 'Select the signal source for each point in the audio chain:', pos=(10,
|
|
11))
|
|
self.lines = {}
|
|
if uiNumber < 168:
|
|
self.sourceSelectOptions = inputSourceSelectOptions
|
|
self.uiOffset = 152
|
|
self.channelString = 'Input'
|
|
else:
|
|
self.sourceSelectOptions = outputSourceSelectOptions
|
|
self.uiOffset = 168
|
|
self.channelString = 'Output'
|
|
self.sourceSelectOptionList = {0: 'Invalid'}
|
|
for option in self.sourceSelectOptions:
|
|
if option == 16:
|
|
for channel in self.frame.frame.parent.unit_channels:
|
|
if channel >= 128:
|
|
channel -= 128
|
|
if channel not in self.frame.frame.parent.unit_channels:
|
|
continue
|
|
if channel < 15:
|
|
self.sourceSelectOptionList[16 + channel] = self.sourceSelectOptions[16] + str(channel + 1)
|
|
|
|
if option == 32:
|
|
for channel in self.frame.frame.parent.unit_channels:
|
|
if channel >= 128:
|
|
channel -= 128
|
|
if channel < 15:
|
|
self.sourceSelectOptionList[32 + channel] = self.channelString + ' ' + str(channel + 1) + ' ' + self.sourceSelectOptions[32]
|
|
|
|
if option == 48:
|
|
for channel in self.frame.frame.parent.unit_channels:
|
|
if channel >= 128:
|
|
channel -= 128
|
|
if channel < 15:
|
|
self.sourceSelectOptionList[48 + channel] = self.channelString + ' ' + str(channel + 1) + ' ' + self.sourceSelectOptions[48]
|
|
|
|
if option == 64:
|
|
for channel in self.frame.frame.parent.unit_channels:
|
|
if channel >= 128:
|
|
channel -= 128
|
|
if channel < 15:
|
|
self.sourceSelectOptionList[64 + channel] = self.channelString + ' ' + str(channel + 1) + ' ' + self.sourceSelectOptions[64]
|
|
|
|
if option == 240:
|
|
for channel in self.frame.frame.parent.unit_channels:
|
|
if channel >= 128:
|
|
channel -= 128
|
|
if channel < 15:
|
|
self.sourceSelectOptionList[240 + channel] = self.channelString + ' ' + str(channel + 1) + ' ' + self.sourceSelectOptions[240]
|
|
|
|
if option == 80:
|
|
self.sourceSelectOptionList[80] = self.sourceSelectOptions[80]
|
|
if option == 96:
|
|
self.sourceSelectOptionList[96] = self.sourceSelectOptions[96]
|
|
if option == 112:
|
|
self.sourceSelectOptionList[112] = self.sourceSelectOptions[112]
|
|
|
|
self.uiKeys = getKeys(frame, uiNumber)
|
|
self.createLine(0)
|
|
self.createLine(1)
|
|
for uiIndex in self.uiKeys:
|
|
(key, val) = self.uiKeys[uiIndex]
|
|
if key.channel == 1 and key.index >= 128:
|
|
line = self.lines[0]
|
|
else:
|
|
line = self.lines[1]
|
|
line.checkBox.SetValue(True)
|
|
self.enable(1)
|
|
line.key = key
|
|
inputGainSource = val[2]
|
|
inputGainSource2 = val[6]
|
|
inputDSPSource = val[3]
|
|
inputDelaySource = val[4]
|
|
inputRoutingSource = val[5]
|
|
inputRoutingSource2 = val[7]
|
|
if self.uiNumber < 168:
|
|
if inputGainSource not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.i.1a'
|
|
inputGainSource = self.uiNumber - self.uiOffset + 16
|
|
if inputGainSource2 not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.i.1b'
|
|
inputGainSource2 = self.uiNumber - self.uiOffset + 16
|
|
if inputDSPSource not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.i.2'
|
|
inputDSPSource = self.uiNumber - self.uiOffset + 32
|
|
if inputDelaySource not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.i.3'
|
|
inputDelaySource = self.uiNumber - self.uiOffset + 48
|
|
if inputRoutingSource not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.i.3a'
|
|
inputRoutingSource = self.uiNumber - self.uiOffset + 64
|
|
if inputRoutingSource2 not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.i.3b'
|
|
inputRoutingSource2 = self.uiNumber - self.uiOffset + 64
|
|
elif inputGainSource not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.o.1a'
|
|
inputGainSource = (self.uiNumber - self.uiOffset) % 4 + 16
|
|
if inputGainSource2 not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.o.1b'
|
|
inputGainSource2 = (self.uiNumber - self.uiOffset) % 4 + 16
|
|
if inputDSPSource not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.o.2'
|
|
inputDSPSource = (self.uiNumber - self.uiOffset) % 4 + 16
|
|
if inputDelaySource not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.o.3'
|
|
inputDelaySource = (self.uiNumber - self.uiOffset) % 4 + 16
|
|
if inputRoutingSource not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.o.3a'
|
|
inputRoutingSource = self.uiNumber - self.uiOffset + 32
|
|
if inputRoutingSource2 not in self.sourceSelectOptionList:
|
|
print mytime.displayTime(), 'uca.ar.o.3b'
|
|
inputRoutingSource2 = self.uiNumber - self.uiOffset + 48
|
|
try:
|
|
line.inputGainSourceChoice.SetStringSelection(self.sourceSelectOptionList[inputGainSource])
|
|
except:
|
|
line.inputGainSourceChoice.SetStringSelection(self.sourceSelectOptionList[0])
|
|
traceback.print_exc(file=sys.stdout)
|
|
|
|
try:
|
|
line.inputGainSourceChoice2.SetStringSelection(self.sourceSelectOptionList[inputGainSource2])
|
|
except:
|
|
line.inputGainSourceChoice2.SetStringSelection(self.sourceSelectOptionList[0])
|
|
traceback.print_exc(file=sys.stdout)
|
|
|
|
try:
|
|
line.inputDSPSourceChoice.SetStringSelection(self.sourceSelectOptionList[inputDSPSource])
|
|
except:
|
|
line.inputDSPSourceChoice.SetStringSelection(self.sourceSelectOptionList[0])
|
|
traceback.print_exc(file=sys.stdout)
|
|
|
|
try:
|
|
line.inputDelaySourceChoice.SetStringSelection(self.sourceSelectOptionList[inputDelaySource])
|
|
except:
|
|
line.inputDelaySourceChoice.SetStringSelection(self.sourceSelectOptionList[0])
|
|
traceback.print_exc(file=sys.stdout)
|
|
|
|
try:
|
|
line.inputRoutingOutputSourceChoice.SetStringSelection(self.sourceSelectOptionList[inputRoutingSource])
|
|
except:
|
|
line.inputRoutingOutputSourceChoice.SetStringSelection(self.sourceSelectOptionList[0])
|
|
traceback.print_exc(file=sys.stdout)
|
|
|
|
try:
|
|
line.inputRoutingOutputSourceChoice2.SetStringSelection(self.sourceSelectOptionList[inputRoutingSource2])
|
|
except:
|
|
line.inputRoutingOutputSourceChoice2.SetStringSelection(self.sourceSelectOptionList[0])
|
|
traceback.print_exc(file=sys.stdout)
|
|
|
|
self.initFinished = True
|
|
self.Show(True)
|
|
return
|
|
|
|
def createLine(self, i):
|
|
if os.name in mac_names:
|
|
y = 3
|
|
else:
|
|
y = 4
|
|
if i == 0:
|
|
x = 280
|
|
else:
|
|
x = 10
|
|
p = wx.Panel(self, size=(550, 400))
|
|
p.Show(False)
|
|
p.checkBox = wx.CheckBox(p, 10 + i, ' Override Defaults', pos=(10, 0), size=(150,
|
|
20))
|
|
p.SetPosition((10 + 550 * i, 10))
|
|
channel = self.uiNumber - self.uiOffset
|
|
p.inputGainSourceChoice = wx.Choice(p, 20 + i, choices=sorted(self.sourceSelectOptionList.values()), style=wx.BORDER_NONE, pos=(x, 30), size=(250,
|
|
26))
|
|
p.inputGainSourceChoice2 = wx.Choice(p, 50 + i, choices=sorted(self.sourceSelectOptionList.values()), style=wx.BORDER_NONE, pos=(x, 60), size=(250,
|
|
26))
|
|
p.inputDSPSourceChoice = wx.Choice(p, 30 + i, choices=sorted(self.sourceSelectOptionList.values()), style=wx.BORDER_NONE, pos=(x, 90), size=(250,
|
|
26))
|
|
p.inputDelaySourceChoice = wx.Choice(p, 40 + i, choices=sorted(self.sourceSelectOptionList.values()), style=wx.BORDER_NONE, pos=(x, 120), size=(250,
|
|
26))
|
|
p.inputRoutingOutputSourceChoice = wx.Choice(p, 50 + i, choices=sorted(self.sourceSelectOptionList.values()), style=wx.BORDER_NONE, pos=(x, 150), size=(250,
|
|
26))
|
|
p.inputRoutingOutputSourceChoice2 = wx.Choice(p, 60 + i, choices=sorted(self.sourceSelectOptionList.values()), style=wx.BORDER_NONE, pos=(x, 180), size=(250,
|
|
26))
|
|
if self.uiNumber < 168:
|
|
p.inputGainSourceChoice.SetStringSelection(self.sourceSelectOptionList[channel + 16])
|
|
p.inputGainSourceChoice2.SetStringSelection(self.sourceSelectOptionList[channel + 16])
|
|
p.inputDSPSourceChoice.SetStringSelection(self.sourceSelectOptionList[channel + 32])
|
|
p.inputDelaySourceChoice.SetStringSelection(self.sourceSelectOptionList[channel + 48])
|
|
p.inputRoutingOutputSourceChoice.SetStringSelection(self.sourceSelectOptionList[channel + 64])
|
|
p.inputRoutingOutputSourceChoice2.SetStringSelection(self.sourceSelectOptionList[channel + 64])
|
|
else:
|
|
p.inputGainSourceChoice.SetStringSelection(self.sourceSelectOptionList[16])
|
|
p.inputGainSourceChoice2.SetStringSelection(self.sourceSelectOptionList[17])
|
|
if 2 in self.frame.frame.parent.unit_channels:
|
|
p.inputDSPSourceChoice.SetStringSelection(self.sourceSelectOptionList[18])
|
|
if 3 in self.frame.frame.parent.unit_channels:
|
|
p.inputDelaySourceChoice.SetStringSelection(self.sourceSelectOptionList[19])
|
|
p.inputRoutingOutputSourceChoice.SetStringSelection(self.sourceSelectOptionList[channel + 32])
|
|
p.inputRoutingOutputSourceChoice2.SetStringSelection(self.sourceSelectOptionList[channel + 48])
|
|
p.checkBox.SetValue(0)
|
|
p.checkBox.Enable(True)
|
|
if i == 0:
|
|
p.checkBox.SetValue(1)
|
|
p.checkBox.Show(False)
|
|
channelString = self.channelString + ' ' + str(channel + 1)
|
|
if self.uiNumber < 168:
|
|
p.inputGainSourceLabel = wx.StaticText(p, -1, channelString + ' Gain Fader Source 1', pos=(0, 30 + y))
|
|
p.inputGainSourceLabel2 = wx.StaticText(p, -1, channelString + ' Gain Fader Source 2', pos=(0, 60 + y))
|
|
p.inputDSPSourceLabel = wx.StaticText(p, -1, channelString + ' DSP Core Source', pos=(0, 90 + y))
|
|
p.inputDelaySourceLabel = wx.StaticText(p, -1, channelString + ' Delay Source', pos=(0, 120 + y))
|
|
p.inputRoutingOutputSourceLabel = wx.StaticText(p, -1, 'Link Bus ' + str(channel + 1) + ' Source 1', pos=(0, 150 + y))
|
|
p.inputRoutingOutputSourceLabel2 = wx.StaticText(p, -1, 'Link Bus ' + str(channel + 1) + ' Source 2', pos=(0, 180 + y))
|
|
else:
|
|
p.inputGainSourceLabel = wx.StaticText(p, -1, channelString + ' Mixer Fader 1 Source', pos=(0, 30 + y))
|
|
p.inputGainSourceLabel2 = wx.StaticText(p, -1, channelString + ' Mixer Fader 2 Source', pos=(0, 60 + y))
|
|
if 2 in self.frame.frame.parent.unit_channels:
|
|
p.inputDSPSourceLabel = wx.StaticText(p, -1, channelString + ' Mixer Fader 3 Source', pos=(0, 90 + y))
|
|
else:
|
|
p.inputDSPSourceLabel = wx.StaticText(p, -1, 'Not Used', pos=(0, 90 + y))
|
|
if 3 in self.frame.frame.parent.unit_channels:
|
|
p.inputDelaySourceLabel = wx.StaticText(p, -1, channelString + ' Mixer Fader 4 Source', pos=(0, 120 + y))
|
|
else:
|
|
p.inputDelaySourceLabel = wx.StaticText(p, -1, 'Not Used', pos=(0, 120 + y))
|
|
p.inputRoutingOutputSourceLabel = wx.StaticText(p, -1, channelString + ' DSP Core Source', pos=(0, 150 + y))
|
|
p.inputRoutingOutputSourceLabel2 = wx.StaticText(p, -1, channelString + ' Delay Source', pos=(0, 180 + y))
|
|
p.key = None
|
|
p.lineNumber = i
|
|
self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + i)
|
|
self.lines[i] = p
|
|
self.enable(i)
|
|
p.Show(True)
|
|
return
|
|
|
|
def enable(self, i):
|
|
val = self.lines[i].checkBox.GetValue()
|
|
if i == 0:
|
|
val = False
|
|
self.lines[i].inputGainSourceChoice.Enable(val)
|
|
self.lines[i].inputGainSourceChoice2.Enable(val)
|
|
if self.uiNumber >= 168 and 2 not in self.frame.frame.parent.unit_channels:
|
|
self.lines[i].inputDSPSourceChoice.Enable(False)
|
|
else:
|
|
self.lines[i].inputDSPSourceChoice.Enable(val)
|
|
if self.uiNumber >= 168 and 3 not in self.frame.frame.parent.unit_channels:
|
|
self.lines[i].inputDelaySourceChoice.Enable(False)
|
|
else:
|
|
self.lines[i].inputDelaySourceChoice.Enable(val)
|
|
self.lines[i].inputRoutingOutputSourceChoice.Enable(val)
|
|
self.lines[i].inputRoutingOutputSourceChoice2.Enable(val)
|
|
return
|
|
|
|
def OnEnabled(self, e):
|
|
print mytime.displayTime(), 'uca.OnEnabled', e.GetId()
|
|
i = e.GetId() - 10
|
|
if i == 0:
|
|
return
|
|
self.enable(i)
|
|
t = self.lines[i]
|
|
s = self.lines[0]
|
|
t.inputGainSourceChoice.SetStringSelection(s.inputGainSourceChoice.GetStringSelection())
|
|
t.inputGainSourceChoice2.SetStringSelection(s.inputGainSourceChoice2.GetStringSelection())
|
|
t.inputDSPSourceChoice.SetStringSelection(s.inputDSPSourceChoice.GetStringSelection())
|
|
t.inputDelaySourceChoice.SetStringSelection(s.inputDelaySourceChoice.GetStringSelection())
|
|
t.inputRoutingOutputSourceChoice.SetStringSelection(s.inputRoutingOutputSourceChoice.GetStringSelection())
|
|
t.inputRoutingOutputSourceChoice2.SetStringSelection(s.inputRoutingOutputSourceChoice2.GetStringSelection())
|
|
return
|
|
|
|
def getSourceKey(self, str):
|
|
for key in self.sourceSelectOptionList:
|
|
if self.sourceSelectOptionList[key] == str:
|
|
print mytime.displayTime(), 'uca.found key for', str, '->', key
|
|
return key
|
|
|
|
print mytime.displayTime(), 'uca.did not find key for', str, '-> None'
|
|
return
|
|
|
|
def evaluateLine(self, line):
|
|
if line.checkBox.GetValue() == False:
|
|
return
|
|
else:
|
|
if line.lineNumber == 0:
|
|
return
|
|
inputGainSource = self.getSourceKey(line.inputGainSourceChoice.GetStringSelection())
|
|
inputGainSource2 = self.getSourceKey(line.inputGainSourceChoice2.GetStringSelection())
|
|
inputDSPSource = self.getSourceKey(line.inputDSPSourceChoice.GetStringSelection())
|
|
inputDelaySource = self.getSourceKey(line.inputDelaySourceChoice.GetStringSelection())
|
|
inputRoutingSource = self.getSourceKey(line.inputRoutingOutputSourceChoice.GetStringSelection())
|
|
inputRoutingSource2 = self.getSourceKey(line.inputRoutingOutputSourceChoice2.GetStringSelection())
|
|
if self.uiNumber < 168:
|
|
if inputGainSource == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.1a'
|
|
inputGainSource = self.uiNumber - self.uiOffset + 16
|
|
if inputGainSource2 == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.1b'
|
|
inputGainSource2 = self.uiNumber - self.uiOffset + 16
|
|
if inputDSPSource == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.2'
|
|
inputDSPSource = self.uiNumber - self.uiOffset + 32
|
|
if inputDelaySource == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.3'
|
|
inputDelaySource = self.uiNumber - self.uiOffset + 48
|
|
if inputRoutingSource == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.4a'
|
|
inputRoutingSource = self.uiNumber - self.uiOffset + 64
|
|
if inputRoutingSource2 == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.4b'
|
|
inputRoutingSource2 = self.uiNumber - self.uiOffset + 64
|
|
if inputGainSource > 31 and inputGainSource & 15 == self.uiNumber - self.uiOffset and inputGainSource not in (80,
|
|
96,
|
|
112):
|
|
print mytime.displayTime(), 'uca.ar.eL.5a', inputGainSource
|
|
inputGainSource = self.uiNumber - self.uiOffset + 16
|
|
if inputGainSource2 > 31 and inputGainSource2 & 15 == self.uiNumber - self.uiOffset and inputGainSource not in (80,
|
|
96,
|
|
112):
|
|
print mytime.displayTime(), 'uca.ar.eL.5b', inputGainSource
|
|
inputGainSource2 = self.uiNumber - self.uiOffset + 16
|
|
if inputDSPSource > 47 and inputDSPSource & 15 == self.uiNumber - self.uiOffset:
|
|
print mytime.displayTime(), 'uca.ar.eL.6', inputDSPSource
|
|
inputDSPSource = self.uiNumber - self.uiOffset + 32
|
|
if inputDelaySource > 63 and inputDelaySource & 15 == self.uiNumber - self.uiOffset:
|
|
print mytime.displayTime(), 'uca.ar.eL.7', inputDelaySource
|
|
inputDelaySource = self.uiNumber - self.uiOffset + 48
|
|
elif inputGainSource == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.1a'
|
|
inputGainSource = 16
|
|
if inputGainSource2 == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.1b'
|
|
inputGainSource2 = 17
|
|
if inputDSPSource == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.2'
|
|
if 2 in self.frame.frame.parent.unit_channels:
|
|
inputDSPSource = 18
|
|
else:
|
|
inputDSPSource = 16
|
|
if inputDelaySource == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.3'
|
|
if 3 in self.frame.frame.parent.unit_channels:
|
|
inputDelaySource = 19
|
|
else:
|
|
inputDelaySource = 16
|
|
if inputRoutingSource == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.4a'
|
|
inputRoutingSource = self.uiNumber - self.uiOffset + 32
|
|
if inputRoutingSource2 == None:
|
|
print mytime.displayTime(), 'uca.ar.eL.4b'
|
|
inputRoutingSource2 = self.uiNumber - self.uiOffset + 48
|
|
if inputGainSource > 31 and inputGainSource & 15 == self.uiNumber - self.uiOffset:
|
|
print mytime.displayTime(), 'uca.ar.eL.5a', inputGainSource
|
|
inputGainSource = 16
|
|
if inputGainSource2 > 31 and inputGainSource2 & 15 == self.uiNumber - self.uiOffset:
|
|
print mytime.displayTime(), 'uca.ar.eL.5b', inputGainSource
|
|
inputGainSource2 = 17
|
|
if inputDSPSource > 31 and inputDSPSource & 15 == self.uiNumber - self.uiOffset:
|
|
print mytime.displayTime(), 'uca.ar.eL.6', inputDSPSource
|
|
if 2 in self.frame.frame.parent.unit_channels:
|
|
inputDSPSource = 18
|
|
else:
|
|
inputDSPSource = 16
|
|
if inputDelaySource > 31 and inputDelaySource & 15 == self.uiNumber - self.uiOffset:
|
|
print mytime.displayTime(), 'uca.ar.eL.7', inputDelaySource
|
|
if 3 in self.frame.frame.parent.unit_channels:
|
|
inputDelaySource = 19
|
|
else:
|
|
inputDelaySource = 16
|
|
if inputRoutingSource > 47 and inputRoutingSource & 15 == self.uiNumber - self.uiOffset:
|
|
print mytime.displayTime(), 'uca.ar.eL.8a', inputRoutingSource
|
|
inputRoutingSource = self.uiNumber - self.uiOffset + 32
|
|
if inputRoutingSource2 > 63 and inputRoutingSource2 & 15 == self.uiNumber - self.uiOffset:
|
|
print mytime.displayTime(), 'uca.ar.eL.8b', inputRoutingSource2
|
|
inputRoutingSource2 = self.uiNumber - self.uiOffset + 48
|
|
line.inputGainSourceChoice.SetStringSelection(self.sourceSelectOptionList[inputGainSource])
|
|
line.inputGainSourceChoice2.SetStringSelection(self.sourceSelectOptionList[inputGainSource2])
|
|
line.inputDSPSourceChoice.SetStringSelection(self.sourceSelectOptionList[inputDSPSource])
|
|
line.inputDelaySourceChoice.SetStringSelection(self.sourceSelectOptionList[inputDelaySource])
|
|
line.inputRoutingOutputSourceChoice.SetStringSelection(self.sourceSelectOptionList[inputRoutingSource])
|
|
line.inputRoutingOutputSourceChoice2.SetStringSelection(self.sourceSelectOptionList[inputRoutingSource2])
|
|
try:
|
|
sendString = '' + chr(self.uiNumber)
|
|
sendString += chr(0)
|
|
sendString += chr(inputGainSource)
|
|
sendString += chr(inputDSPSource)
|
|
sendString += chr(inputDelaySource)
|
|
sendString += chr(inputRoutingSource)
|
|
sendString += chr(inputGainSource2)
|
|
sendString += chr(inputRoutingSource2)
|
|
mys = 'String: '
|
|
for c in sendString:
|
|
mys += hex(ord(c)) + ':'
|
|
|
|
print mytime.displayTime(), 'Built string for output routing:', mys[:-1]
|
|
return sendString
|
|
except:
|
|
print mytime.displayTime(), 'uca.ar.eL.failed to build string'
|
|
traceback.print_exc(file=sys.stdout)
|
|
return
|
|
|
|
return
|
|
|
|
|
|
amplifierImpedanceMap = {'Unity Gain': 10000,
|
|
'Pascal S-Pro': 2100,
|
|
'Pascal L-Pro': 3600,
|
|
'Pascal T-Pro': 2400,
|
|
'Pascal U-Pro': 3700,
|
|
'Pascal M-Pro': 1900,
|
|
'Pascal X-Pro CH 1': 1900,
|
|
'Pascal X-Pro CH 2 & 3': 1900,
|
|
'Powersoft Litemod CH 1': 1300,
|
|
'Powersoft Litemod CH 2': 2900,
|
|
'Powersoft Litemod HV CH 1': 1300,
|
|
'Powersoft Litemod HV CH 2': 2900,
|
|
'Powersoft Digimod 3004PFC2 / 4': 10000,
|
|
'Powersoft Litemod 4HC CH 1 & 3': 3500,
|
|
'Powersoft Litemod 4HC CH 2 & 4': 1500,
|
|
'Powersoft Minimod 4 CH 1 & 3': 9400,
|
|
'Powersoft Minimod 4 CH 2 & 4': 9400,
|
|
'Hypex NCxxxMP models': '>25k',
|
|
'Hypex NC2k OEM': 2500,
|
|
'Hypex NC1200 OEM Buffered': '>25k',
|
|
'Hypex NC1200 OEM Unbuffered': 2600,
|
|
'Hypex NC500 OEM': 1800,
|
|
'Hypex UcD102 OEM': 1800,
|
|
'Hypex UcD180 OEM Buffered': '>25k',
|
|
'Hypex UcD180 OEM Unbuffered': 1800,
|
|
'Hypex UcD180LP OEM': 1800,
|
|
'Hypex UcD250LP OEM': 1800,
|
|
'Hypex UcD2k OEM': '>25k',
|
|
'Hypex UcD400 OEM Buffered': '>25k',
|
|
'Hypex UcD400 OEM Unbuffered': 1800,
|
|
'Hypex UcD400LP OEM': 1800,
|
|
'Hypex UcD700LZ OEM Buffered': '>25k',
|
|
'Hypex UcD700LZ OEM Unbuffered': 1800,
|
|
'IcePower 1200AS1 / 1200AS2': '>25k',
|
|
'IcePower 700AS1 / 700AS2 / 700ASX': '>25k',
|
|
'IcePower 125ASX2': '>25k',
|
|
'IcePower 200AS1 / 200AS2': 3000,
|
|
'IcePower Engine400': 6600,
|
|
'IcePower 50ASX2': '>25k',
|
|
'IcePower 100AS1 / 100AS2': 2800,
|
|
'IcePower 250A': 4300,
|
|
'IcePower 250ASX2': '>25k',
|
|
'IcePower 250ASP': 8200,
|
|
'IcePower 300A1 / 300AS1': '>25k',
|
|
'IcePower 500A / 500ASP': 4300,
|
|
'IcePower 1000A': 6600,
|
|
'IcePower 1000ASP': 4300,
|
|
'Custom': 10000}
|
|
amplifierGainMap = {'Unity Gain': 0.0,
|
|
'Pascal S-Pro': 26.0,
|
|
'Pascal L-Pro': 27.4,
|
|
'Pascal T-Pro': 26.0,
|
|
'Pascal U-Pro': 26.0,
|
|
'Pascal M-Pro': 26.0,
|
|
'Pascal X-Pro CH 1': 32.0,
|
|
'Pascal X-Pro CH 2 & 3': 26.0,
|
|
'Powersoft Litemod CH 1': 26.0,
|
|
'Powersoft Litemod CH 2': 26.0,
|
|
'Powersoft Litemod HV CH 1': 26.0,
|
|
'Powersoft Litemod HV CH 2': 26.0,
|
|
'Powersoft Digimod 3004PFC2 / 4': 32.0,
|
|
'Powersoft Litemod 4HC CH 1 & 3': 26.0,
|
|
'Powersoft Litemod 4HC CH 2 & 4': 26.0,
|
|
'Powersoft Minimod 4 CH 1 & 3': 20.4,
|
|
'Powersoft Minimod 4 CH 2 & 4': 20.1,
|
|
'Hypex NCxxxMP models': 25.5,
|
|
'Hypex NC2k OEM': 20.0,
|
|
'Hypex NC1200 OEM Buffered': 27.8,
|
|
'Hypex NC1200 OEM Unbuffered': 11.6,
|
|
'Hypex NC500 OEM': 12.4, 'Hypex UcD102 OEM': 13.5,
|
|
'Hypex UcD180 OEM Buffered': 26.0,
|
|
'Hypex UcD180 OEM Unbuffered': 26.0,
|
|
'Hypex UcD180LP OEM': 13.1,
|
|
'Hypex UcD250LP OEM': 13.3,
|
|
'Hypex UcD2k OEM': 34.0,
|
|
'Hypex UcD400 OEM Buffered': 26.5,
|
|
'Hypex UcD400 OEM Unbuffered': 26.5,
|
|
'Hypex UcD400LP OEM': 13.0,
|
|
'Hypex UcD700LZ OEM Buffered': 26.0,
|
|
'Hypex UcD700LZ OEM Unbuffered': 13.0,
|
|
'IcePower 1200AS1 / 1200AS2': 25.8,
|
|
'IcePower 700AS1 / 700AS2 / 700ASX': 27.4,
|
|
'IcePower 125ASX2': 24.8,
|
|
'IcePower 200AS1 / 200AS2': 24.0,
|
|
'IcePower Engine400': 15.3,
|
|
'IcePower 50ASX2': 20.5,
|
|
'IcePower 100AS1 / 100AS2': 21.0,
|
|
'IcePower 250A': 27.4,
|
|
'IcePower 250ASX2': 28.3,
|
|
'IcePower 250ASP': 27.0,
|
|
'IcePower 300A1 / 300AS1': 28.15,
|
|
'IcePower 500A / 500ASP': 27.1,
|
|
'IcePower 1000A': 28.1,
|
|
'IcePower 1000ASP': 27.2,
|
|
'Custom': 0}
|
|
|
|
class outputConfiguration(wx.Panel):
|
|
|
|
def __init__(self, parent, frame, uiNumber, panelName):
|
|
self.frame = frame
|
|
self.name = panelName
|
|
self.uiNumber = uiNumber
|
|
self.lines = {}
|
|
self.parent = parent
|
|
wx.Panel.__init__(self, parent, size=(964, 500))
|
|
self.Show(True)
|
|
self.initFinished = False
|
|
return
|
|
|
|
def initMe(self, force=False):
|
|
if self.IsShown() == False and force == False:
|
|
return
|
|
if self.initFinished == True:
|
|
return 0
|
|
print mytime.displayTime(), 'uca.initMe outputConfiguration', self.name
|
|
frame = self.frame
|
|
uiNumber = self.uiNumber
|
|
if os.name in mac_names:
|
|
y = 5
|
|
else:
|
|
y = 12
|
|
self.amplifierGain = wx.StaticText(self, -1, 'Amplifier Channel Gain', pos=(90, y), size=(100,
|
|
26))
|
|
self.amplifierGain.Wrap(100)
|
|
self.calibrationGain = wx.StaticText(self, -1, 'Amplifier Calibration Gain', pos=(200, y), size=(100,
|
|
26))
|
|
self.calibrationGain.Wrap(100)
|
|
self.amplifierInputImpedance = wx.StaticText(self, -1, 'Amplifier Input Impedance', pos=(310, y), size=(100,
|
|
26))
|
|
self.amplifierInputImpedance.Wrap(100)
|
|
self.hardwareOutput = wx.StaticText(self, -1, 'Output Connector', pos=(420, y), size=(100,
|
|
26))
|
|
self.hardwareOutput.Wrap(100)
|
|
self.loadImpedance = wx.StaticText(self, -1, 'Loudspeaker Impedance', pos=(530, y), size=(100,
|
|
26))
|
|
self.loadImpedance.Wrap(100)
|
|
self.targetGain = wx.StaticText(self, -1, 'Desired Channel Gain', pos=(640, y), size=(100,
|
|
26))
|
|
self.targetGain.Wrap(100)
|
|
self.ampModel = wx.StaticText(self, -1, 'Amplifier Model', pos=(734, y), size=(100,
|
|
26))
|
|
self.ampModel.Wrap(100)
|
|
self.lines = {}
|
|
try:
|
|
self.impedanceMap = eval(self.frame.frame.parent.config.get('DEFAULT', 'amplifierImpedanceMap'))
|
|
self.gainMap = eval(self.frame.frame.parent.config.get('DEFAULT', 'amplifierGainMap'))
|
|
self.gainMap['Custom'] = 0
|
|
self.impedanceMap['Custom'] = 10000
|
|
except:
|
|
self.impedanceMap = amplifierImpedanceMap
|
|
self.gainMap = amplifierGainMap
|
|
|
|
self.uiKeys = getKeys(frame, uiNumber)
|
|
i = 0
|
|
self.factoryItems = 0
|
|
for uiIndex in self.uiKeys:
|
|
(key, val) = self.uiKeys[uiIndex]
|
|
if key.channel != 1 or key.index < 128:
|
|
continue
|
|
amplifierGain = str(val[6] / 4.0)
|
|
calibrationGain = str((val[2] - 128) / 100.0)
|
|
if val[3] < 255:
|
|
amplifierInputImpedance = str(val[3] * 100)
|
|
else:
|
|
amplifierInputImpedance = '>25k'
|
|
hardwareOutput = str(val[4] + 1)
|
|
loadImpedance = str(val[5] / 4.0)
|
|
targetGain = str(val[7] / 4.0)
|
|
self.createLine(i)
|
|
self.lines[i].key = key
|
|
self.lines[i].checkBox.SetLabel('Factory')
|
|
self.lines[i].amplifierGain.SetValue(amplifierGain)
|
|
self.lines[i].calibrationGain.SetValue(calibrationGain)
|
|
self.lines[i].amplifierInputImpedance.SetValue(amplifierInputImpedance)
|
|
self.lines[i].hardwareOutput.SetValue(hardwareOutput)
|
|
self.lines[i].loadImpedance.SetValue(loadImpedance)
|
|
self.lines[i].targetGain.SetValue(targetGain)
|
|
self.setAmpModelChoice(self.lines[i])
|
|
self.lines[i].checkBox.Enable(False)
|
|
self.lines[i].amplifierGain.Enable(False)
|
|
self.lines[i].calibrationGain.Enable(False)
|
|
self.lines[i].amplifierInputImpedance.Enable(False)
|
|
self.lines[i].hardwareOutput.Enable(False)
|
|
self.lines[i].loadImpedance.Enable(False)
|
|
self.lines[i].targetGain.Enable(False)
|
|
i += 1
|
|
self.factoryItems += 1
|
|
|
|
for uiIndex in self.uiKeys:
|
|
(key, val) = self.uiKeys[uiIndex]
|
|
if key.channel == 1 and key.index >= 128:
|
|
continue
|
|
amplifierGain = str(val[6] / 4.0)
|
|
calibrationGain = str((val[2] - 128) / 100.0)
|
|
if val[3] < 251:
|
|
amplifierInputImpedance = str(val[3] * 100)
|
|
else:
|
|
amplifierInputImpedance = '>25k'
|
|
hardwareOutput = str(val[4] + 1)
|
|
loadImpedance = str(val[5] / 4.0)
|
|
targetGain = str(val[7] / 4.0)
|
|
self.createLine(i)
|
|
self.lines[i].key = key
|
|
self.lines[i].checkBox.SetValue(True)
|
|
self.lines[i].amplifierGain.SetValue(amplifierGain)
|
|
self.lines[i].calibrationGain.SetValue(calibrationGain)
|
|
self.lines[i].amplifierInputImpedance.SetValue(amplifierInputImpedance)
|
|
self.lines[i].hardwareOutput.SetValue(hardwareOutput)
|
|
self.lines[i].loadImpedance.SetValue(loadImpedance)
|
|
self.lines[i].targetGain.SetValue(targetGain)
|
|
self.setAmpModelChoice(self.lines[i])
|
|
self.enable(i)
|
|
i += 1
|
|
|
|
if i - self.factoryItems < 8:
|
|
self.createLine(i)
|
|
self.initFinished = True
|
|
self.Show(True)
|
|
return
|
|
|
|
def createLine(self, i):
|
|
if os.name in mac_names:
|
|
y = 3
|
|
else:
|
|
y = 4
|
|
p = wx.Panel(self, size=(964, 28))
|
|
p.Show(False)
|
|
p.checkBox = wx.CheckBox(p, 10 + i, ' User', pos=(10, 2), size=(70, 20))
|
|
p.amplifierGain = wx.TextCtrl(p, 20 + i, '', pos=(90, 1), size=(60, 20))
|
|
p.ampGainUnit = wx.StaticText(p, -1, 'dB', pos=(152, y), size=(30, 26))
|
|
p.calibrationGain = wx.TextCtrl(p, 30 + i, '', pos=(200, 1), size=(60, 20))
|
|
p.calGainUnit = wx.StaticText(p, -1, 'dB', pos=(262, y), size=(30, 26))
|
|
p.amplifierInputImpedance = wx.TextCtrl(p, 40 + i, '', pos=(310, 1), size=(60,
|
|
20))
|
|
p.ampImpUnit = wx.StaticText(p, -1, 'Ohm', pos=(372, y), size=(30, 26))
|
|
p.hardwareOutput = wx.TextCtrl(p, 50 + i, '', pos=(420, 1), size=(60, 20))
|
|
p.loadImpedance = wx.TextCtrl(p, 60 + i, '', pos=(530, 1), size=(60, 20))
|
|
p.loadImpUnit = wx.StaticText(p, -1, 'Ohm', pos=(592, y), size=(30, 26))
|
|
p.targetGain = wx.TextCtrl(p, 70 + i, '', pos=(640, 1), size=(60, 20))
|
|
p.targetGainUnit = wx.StaticText(p, -1, 'dB', pos=(702, y), size=(30, 26))
|
|
p.ampModelChoice = wx.Choice(p, 70 + i, choices=sorted(self.impedanceMap.keys()), style=wx.BORDER_NONE, pos=(734, y - 5), size=(180,
|
|
26))
|
|
p.SetPosition((0, 40 + 28 * i))
|
|
p.checkBox.SetValue(0)
|
|
p.checkBox.Enable(True)
|
|
p.key = None
|
|
p.lineNumber = i
|
|
self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + i)
|
|
self.Bind(wx.EVT_CHOICE, self.OnChooseAmplifierModel, id=70 + i)
|
|
self.lines[i] = p
|
|
self.enable(i)
|
|
p.Show(True)
|
|
return
|
|
|
|
def setAmpModelChoice(self, line):
|
|
try:
|
|
try:
|
|
impedance = line.amplifierInputImpedance.GetValue()
|
|
except:
|
|
impedance = '>25k'
|
|
|
|
if impedance != '>25k':
|
|
impedance = float(impedance)
|
|
try:
|
|
gain = float(line.amplifierGain.GetValue()) + float(line.calibrationGain.GetValue())
|
|
except:
|
|
gain = 0.0
|
|
|
|
for ampModel in self.impedanceMap:
|
|
try:
|
|
if self.impedanceMap[ampModel] == impedance and float(self.gainMap[ampModel]) == gain:
|
|
line.ampModelChoice.SetStringSelection(ampModel)
|
|
return
|
|
except:
|
|
traceback.print_exc(file=sys.stdout)
|
|
continue
|
|
|
|
except:
|
|
traceback.print_exc(file=sys.stdout)
|
|
|
|
line.ampModelChoice.SetStringSelection('Custom')
|
|
return
|
|
|
|
def OnChooseAmplifierModel(self, e):
|
|
i = e.GetId() - 70
|
|
print mytime.displayTime(), 'Selected', i, self.lines[i].ampModelChoice.GetStringSelection()
|
|
ampModel = self.lines[i].ampModelChoice.GetStringSelection()
|
|
if ampModel == 'Custom':
|
|
return
|
|
impedance = self.impedanceMap[ampModel]
|
|
gain = self.gainMap[ampModel]
|
|
ampGain = int(gain * 4) / 4.0
|
|
calibrationGain = gain - ampGain
|
|
self.lines[i].amplifierGain.SetValue(str(ampGain))
|
|
self.lines[i].calibrationGain.SetValue(str(calibrationGain))
|
|
self.lines[i].amplifierInputImpedance.SetValue(str(impedance))
|
|
if ampModel == 'Unity Gain':
|
|
self.lines[i].targetGain.SetValue('0.0')
|
|
else:
|
|
try:
|
|
if float(self.lines[i].targetGain.GetValue()) == 0.0 and gain > 20.0:
|
|
self.lines[i].targetGain.SetValue('30.0')
|
|
except:
|
|
self.lines[i].targetGain.SetValue('30.0')
|
|
|
|
return
|
|
|
|
def enable(self, i):
|
|
val = self.lines[i].checkBox.GetValue()
|
|
self.lines[i].amplifierGain.Enable(val)
|
|
self.lines[i].calibrationGain.Enable(val)
|
|
self.lines[i].amplifierInputImpedance.Enable(val)
|
|
self.lines[i].hardwareOutput.Enable(val)
|
|
self.lines[i].loadImpedance.Enable(val)
|
|
self.lines[i].targetGain.Enable(val)
|
|
self.lines[i].ampModelChoice.Enable(val)
|
|
return
|
|
|
|
def OnEnabled(self, e):
|
|
i = e.GetId() - 10
|
|
self.enable(i)
|
|
if i == len(self.lines) - 1 and self.lines[i].checkBox.GetValue() == True and i < 2:
|
|
if i > 0:
|
|
t = self.lines[i]
|
|
s = self.lines[0]
|
|
t.amplifierGain.SetValue(s.amplifierGain.GetValue())
|
|
t.calibrationGain.SetValue(s.calibrationGain.GetValue())
|
|
t.amplifierInputImpedance.SetValue(s.amplifierInputImpedance.GetValue())
|
|
t.hardwareOutput.SetValue(s.hardwareOutput.GetValue())
|
|
t.loadImpedance.SetValue(s.loadImpedance.GetValue())
|
|
t.targetGain.SetValue(s.targetGain.GetValue())
|
|
else:
|
|
t = self.lines[i]
|
|
t.amplifierGain.SetValue('0')
|
|
t.calibrationGain.SetValue('0')
|
|
t.amplifierInputImpedance.SetValue('10000')
|
|
t.hardwareOutput.SetValue(str(self.uiNumber - 129))
|
|
t.loadImpedance.SetValue('8')
|
|
t.targetGain.SetValue('0')
|
|
self.setAmpModelChoice(self.lines[i])
|
|
return
|
|
|
|
def evaluateLine(self, line):
|
|
if line.checkBox.GetValue() == False:
|
|
return
|
|
else:
|
|
self.setAmpModelChoice(line)
|
|
flags = int(0)
|
|
try:
|
|
amplifierGain = float(line.amplifierGain.GetValue())
|
|
except:
|
|
amplifierGain = 0
|
|
|
|
try:
|
|
calibrationGain = float(line.calibrationGain.GetValue())
|
|
except:
|
|
calibrationGain = 0
|
|
|
|
try:
|
|
amplifierInputImpedance = float(line.amplifierInputImpedance.GetValue())
|
|
except:
|
|
amplifierInputImpedance = ''
|
|
|
|
try:
|
|
hardwareOutput = float(line.hardwareOutput.GetValue())
|
|
except:
|
|
hardwareOutput = 1
|
|
|
|
try:
|
|
loadImpedance = float(line.loadImpedance.GetValue())
|
|
except:
|
|
loadImpedance = 8
|
|
|
|
try:
|
|
targetGain = float(line.targetGain.GetValue())
|
|
except:
|
|
targetGain = 0
|
|
|
|
if flags > 15:
|
|
print mytime.displayTime(), 'uc.oc.invalid flags:', hex(flags)
|
|
flags = 0
|
|
amplifierGain *= 4
|
|
amplifierGain = int(round(amplifierGain, 0))
|
|
if amplifierGain > 255:
|
|
amplifierGain = 255
|
|
if amplifierGain < 0:
|
|
amplifierGain = 0
|
|
calibrationGain *= 100.0
|
|
calibrationGain += 128
|
|
calibrationGain = int(round(calibrationGain, 0))
|
|
if calibrationGain < 28:
|
|
calibrationGain = 28
|
|
if calibrationGain > 228:
|
|
calibrationGain = 228
|
|
try:
|
|
amplifierInputImpedance /= 100
|
|
amplifierInputImpedance = int(round(amplifierInputImpedance, 0))
|
|
if amplifierInputImpedance < 1:
|
|
amplifierInputImpedance = 1
|
|
if amplifierInputImpedance > 250:
|
|
amplifierInputImpedance = 250
|
|
except:
|
|
amplifierInputImpedance = 255
|
|
|
|
hardwareOutput -= 1
|
|
hardwareOutput = int(round(hardwareOutput, 0))
|
|
if hardwareOutput < 0:
|
|
hardwareOutput = 0
|
|
if hardwareOutput > max(self.frame.frame.parent.unit_channels):
|
|
hardwareOutput = max(self.frame.frame.parent.unit_channels)
|
|
loadImpedance *= 4
|
|
loadImpedance = int(round(loadImpedance))
|
|
if loadImpedance > 255:
|
|
loadImpedance = 255
|
|
if loadImpedance < 1:
|
|
loadImpedance = 1
|
|
targetGain *= 4
|
|
targetGain = int(round(targetGain))
|
|
if targetGain > 255:
|
|
targetGain = 255
|
|
if targetGain < 0:
|
|
targetGain = 0
|
|
i = line.lineNumber
|
|
self.lines[i].amplifierGain.SetValue(str(amplifierGain / 4.0))
|
|
self.lines[i].calibrationGain.SetValue(str((calibrationGain - 128) / 100.0))
|
|
if amplifierInputImpedance == 255:
|
|
self.lines[i].amplifierInputImpedance.SetValue('>25k')
|
|
else:
|
|
self.lines[i].amplifierInputImpedance.SetValue(str(amplifierInputImpedance * 100))
|
|
self.lines[i].hardwareOutput.SetValue(str(hardwareOutput + 1))
|
|
self.lines[i].loadImpedance.SetValue(str(loadImpedance / 4.0))
|
|
self.lines[i].targetGain.SetValue(str(targetGain / 4.0))
|
|
try:
|
|
sendString = '' + chr(self.uiNumber)
|
|
sendString += chr(flags)
|
|
sendString += chr(calibrationGain)
|
|
sendString += chr(amplifierInputImpedance)
|
|
sendString += chr(hardwareOutput)
|
|
sendString += chr(loadImpedance)
|
|
sendString += chr(amplifierGain)
|
|
sendString += chr(targetGain)
|
|
mys = 'String: '
|
|
for c in sendString:
|
|
mys += hex(ord(c)) + ':'
|
|
|
|
print mys
|
|
return sendString
|
|
except:
|
|
print mytime.displayTime(), 'uc.oc.eL.failed to build string'
|
|
traceback.print_exc(file=sys.stdout)
|
|
return
|
|
|
|
return
|
|
|
|
|
|
class enableChannels(wx.Panel):
|
|
|
|
def __init__(self, parent, frame, uiNumber, panelName):
|
|
self.frame = frame
|
|
self.name = panelName
|
|
self.uiNumber = uiNumber
|
|
self.parent = parent
|
|
self.lines = {}
|
|
wx.Panel.__init__(self, parent, size=(964, 600))
|
|
self.Show(True)
|
|
self.initFinished = False
|
|
return
|
|
|
|
def initMe(self, force=False):
|
|
if self.IsShown() == False and force == False:
|
|
return
|
|
if self.initFinished == True:
|
|
return 0
|
|
print mytime.displayTime(), 'uca.initMe enableChannels', self.name
|
|
frame = self.frame
|
|
uiNumber = self.uiNumber
|
|
self.lines = {0: (self.createLine(0)), 1: (self.createLine(1))}
|
|
self.checkBoxes = {}
|
|
self.uiKeys = getKeys(frame, uiNumber)
|
|
i = 0
|
|
foundChannelIndexes = []
|
|
for uiIndex in self.uiKeys:
|
|
(key, val) = self.uiKeys[uiIndex]
|
|
if val[7] & 1 == 1 and one_unit.app.mijnpc == False:
|
|
print mytime.displayTime(), 'Hiding', val
|
|
continue
|
|
if val[1] in foundChannelIndexes:
|
|
print mytime.displayTime(), 'uca.Error: Duplicate Channel Show / Hide Key', key, val
|
|
res = '' + chr(0)
|
|
res += chr(0)
|
|
res += chr(0)
|
|
res += chr(0)
|
|
res += chr(0)
|
|
res += chr(0)
|
|
res += chr(0)
|
|
res += chr(0)
|
|
self.frame.frame.parent.set_value(key, res)
|
|
print mytime.displayTime(), 'uca.Removed Key', key
|
|
continue
|
|
foundChannelIndexes.append(val[1])
|
|
if val[1] == 0:
|
|
self.lines[0].checkBox.SetValue(True)
|
|
self.enable(self.lines[0])
|
|
for channel in self.frame.frame.parent.unit_channels:
|
|
if channel >= 128:
|
|
continue
|
|
mask = 1 << channel
|
|
if mask & val[2] == 0:
|
|
self.lines[0].channelEnabled[channel].SetValue(False)
|
|
else:
|
|
self.lines[0].channelEnabled[channel].SetValue(True)
|
|
if mask & val[4] == 0:
|
|
self.lines[0].channelInverted[channel].SetValue(False)
|
|
else:
|
|
self.lines[0].channelInverted[channel].SetValue(True)
|
|
|
|
self.lines[0].key = key
|
|
flags = val[7]
|
|
if flags & 2 == 2:
|
|
self.lines[0].hideInputSelectCheckBox.SetValue(True)
|
|
if one_unit.app.mijnpc == True:
|
|
if flags & 1 == 1:
|
|
self.lines[0].hideUICheckBox.SetValue(True)
|
|
if val[1] == 4:
|
|
self.lines[1].checkBox.SetValue(True)
|
|
self.enable(self.lines[1])
|
|
for channel in self.frame.frame.parent.unit_channels:
|
|
if channel < 128:
|
|
continue
|
|
mask = 1 << channel - 128
|
|
if mask & val[2] == 0:
|
|
self.lines[1].channelEnabled[channel].SetValue(False)
|
|
else:
|
|
self.lines[1].channelEnabled[channel].SetValue(True)
|
|
if mask & val[4] == 0:
|
|
self.lines[1].channelInverted[channel].SetValue(False)
|
|
else:
|
|
self.lines[1].channelInverted[channel].SetValue(True)
|
|
|
|
self.lines[1].key = key
|
|
if one_unit.app.mijnpc == True:
|
|
flags = val[7]
|
|
if flags & 1 == 1:
|
|
self.lines[1].hideUICheckBox.SetValue(True)
|
|
if flags & 2 == 2:
|
|
self.lines[1].hideInputSelectCheckBox.SetValue(True)
|
|
|
|
self.initFinished = True
|
|
self.Show(True)
|
|
return
|
|
|
|
def createLine(self, lineNumber):
|
|
p = wx.Panel(self, size=(400, 400))
|
|
p.channelEnabled = {}
|
|
p.channelInverted = {}
|
|
p.label = wx.StaticText(p, -1, 'Show', pos=(200, 12))
|
|
p.label2 = wx.StaticText(p, -1, 'Invert', pos=(250, 12))
|
|
if lineNumber == 0:
|
|
p.checkBox = wx.CheckBox(p, 0, 'Configure Inputs', pos=(13, 10), size=(180,
|
|
20))
|
|
p.checkBox.SetValue(False)
|
|
if one_unit.app.mijnpc == True:
|
|
p.mijnpclabel = wx.StaticText(p, -1, 'Verborgen flags:', pos=(13, 200))
|
|
p.hideUICheckBox = wx.CheckBox(p, 0, 'Hide this UI key', pos=(13, 240), size=(180,
|
|
20))
|
|
p.hideUICheckBox.SetValue(False)
|
|
p.hideInputSelectCheckBox = wx.CheckBox(p, 0, 'Hide Input Select', pos=(13,
|
|
270), size=(180,
|
|
20))
|
|
p.hideInputSelectCheckBox.SetValue(False)
|
|
for channel in self.frame.frame.parent.unit_channels:
|
|
if channel < 128:
|
|
channelName = ' ' + str(channel + 1)
|
|
x = 200
|
|
y = 40 + channel * 30
|
|
p.channelEnabled[channel] = wx.CheckBox(p, channel, channelName, pos=(x, y), size=(40,
|
|
20))
|
|
p.channelEnabled[channel].SetValue(True)
|
|
p.channelInverted[channel] = wx.CheckBox(p, channel, '', pos=(x + 50, y), size=(30,
|
|
20))
|
|
p.channelInverted[channel].SetValue(False)
|
|
|
|
if lineNumber == 1:
|
|
p.checkBox = wx.CheckBox(p, 1, 'Configure Outputs', pos=(13, 10), size=(180,
|
|
20))
|
|
p.checkBox.SetValue(False)
|
|
if one_unit.app.mijnpc == True:
|
|
p.mijnpclabel = wx.StaticText(p, -1, 'Verborgen flags:', pos=(13, 200))
|
|
p.hideUICheckBox = wx.CheckBox(p, 0, 'Hide this UI key', pos=(13, 240), size=(180,
|
|
20))
|
|
p.hideUICheckBox.SetValue(False)
|
|
p.hideInputSelectCheckBox = wx.CheckBox(p, 0, 'Hide Mixer', pos=(13, 270), size=(180,
|
|
20))
|
|
p.hideInputSelectCheckBox.SetValue(False)
|
|
for channel in self.frame.frame.parent.unit_channels:
|
|
if channel >= 128:
|
|
channelName = ' ' + str(channel - 127)
|
|
x = 200
|
|
y = 40 + (channel - 128) * 30
|
|
p.channelEnabled[channel] = wx.CheckBox(p, channel, channelName, pos=(x, y), size=(40,
|
|
20))
|
|
p.channelEnabled[channel].SetValue(True)
|
|
p.channelInverted[channel] = wx.CheckBox(p, channel, '', pos=(x + 50, y), size=(30,
|
|
20))
|
|
p.channelInverted[channel].SetValue(False)
|
|
|
|
p.SetPosition((400 * lineNumber, 0))
|
|
self.enable(p)
|
|
p.key = None
|
|
self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=lineNumber)
|
|
p.lineNumber = lineNumber
|
|
return p
|
|
|
|
def OnEnabled(self, e):
|
|
lineNumber = e.GetId()
|
|
line = self.lines[lineNumber]
|
|
self.enable(line)
|
|
return
|
|
|
|
def enable(self, line):
|
|
val = line.checkBox.GetValue()
|
|
line.label.Enable(val)
|
|
for checkBox in line.channelEnabled.values():
|
|
checkBox.Enable(val)
|
|
|
|
return
|
|
|
|
def evaluateLine(self, line):
|
|
if line.checkBox.GetValue() == False:
|
|
for channel in line.channelEnabled:
|
|
self.frame.frame.parent.enabled_channels[channel] = True
|
|
|
|
return
|
|
else:
|
|
channelBits = 0
|
|
for channel in line.channelEnabled:
|
|
if line.channelEnabled[channel].GetValue() == True:
|
|
self.frame.frame.parent.enabled_channels[channel] = True
|
|
channelBits |= 1 << (channel & 127)
|
|
else:
|
|
self.frame.frame.parent.enabled_channels[channel] = False
|
|
|
|
invertBits = 0
|
|
for channel in line.channelInverted:
|
|
if line.channelInverted[channel].GetValue() == True:
|
|
invertBits |= 1 << (channel & 127)
|
|
|
|
if channelBits == 0:
|
|
channelBits = 1
|
|
self.frame.frame.parent.enabled_channels[line.lineNumber * 128] = True
|
|
line.channelEnabled[line.lineNumber * 128].SetValue(True)
|
|
flags = 0
|
|
if line.hideInputSelectCheckBox.GetValue() == True:
|
|
flags |= 2
|
|
if one_unit.app.mijnpc == True:
|
|
if line.hideUICheckBox.GetValue() == True:
|
|
flags |= 1
|
|
flags |= 252
|
|
print mytime.displayTime(), 'Setting UI flags for', self.uiNumber, 'to', flags
|
|
try:
|
|
sendString = '' + chr(self.uiNumber)
|
|
sendString += chr(line.lineNumber * 4)
|
|
sendString += chr(channelBits % 256)
|
|
sendString += chr(channelBits / 256)
|
|
sendString += chr(invertBits % 256)
|
|
sendString += chr(invertBits / 256)
|
|
sendString += chr(0)
|
|
sendString += chr(flags)
|
|
return sendString
|
|
except:
|
|
print mytime.displayTime(), 'uca.ec.eL.failed to build string'
|
|
traceback.print_exc(file=sys.stdout)
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
# okay decompiling pycode/user_config_audio.pyc
|