# 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_keys.pyc # Compiled at: 2025-05-16 12:34:05 import wx, os, data_model, traceback, one_unit, ConfigParser, protocol, sys, select_keys, select_units, d_protocol, mytime from user_config_helpers import * keyFunctionNone = 0 keyFunctionSystemMenu = 1 keyFunctionEscExit = 2 keyFunctionToggleMute = 3 keyFunctionChannelSelect = 4 keyFunctionItemSelect = 5 keyFunctionChannelUp = 6 keyFunctionChannelDown = 7 keyFunctionItemUp = 8 keyFunctionItemDown = 9 keyFunctionModifyValue = 10 keyFunctionNotUsed1 = 11 keyFunctionNextPreset = 12 keyFunctionEnterConfirm = 13 keyFunctionSetValueTo = 14 keyFunctionLoadPreset = 15 keyFunctionNetworkReset = 16 keyFunctionFactoryReset = 17 keyFunctionLockKeys = 18 keyFunctionCopy = 19 keyFunctionPaste = 20 keyFunctionLockUnlock = 21 keyFunctionToggleOnOff = 22 keyFunctionToggleStandby = 23 keyFunctionResetPIN = 24 keyFunctionMuteSystem = 25 keyFunctionToggleBridgeMode = 26 keyFunctionEraseUserPresets = 27 keyFunctionSafeMode = 28 keyFunctionGotoStandby = 29 keyFunctionExitStandby = 30 keyFunctions = {keyFunctionNone: 'None', keyFunctionSystemMenu: 'System Menu', keyFunctionEscExit: 'Esc / Exit', keyFunctionToggleMute: 'Toggle Mute', keyFunctionChannelSelect: 'Channel Select', keyFunctionItemSelect: 'None', keyFunctionChannelUp: 'Channel Up', keyFunctionChannelDown: 'Channel Down', keyFunctionItemUp: 'Item Up', keyFunctionItemDown: 'Item Down', keyFunctionModifyValue: 'Modify Value By', keyFunctionNotUsed1: 'Invalid', keyFunctionNextPreset: 'Next Preset', keyFunctionEnterConfirm: 'Enter / Confirm', keyFunctionSetValueTo: 'Set Value To', keyFunctionLoadPreset: 'Load Preset', keyFunctionNetworkReset: 'Network Reset', keyFunctionFactoryReset: 'Factory Reset', keyFunctionLockKeys: 'Lock / Unlock Keys', keyFunctionCopy: 'Copy', keyFunctionPaste: 'Paste', keyFunctionLockUnlock: 'Lock / Unlock Unit', keyFunctionToggleOnOff: 'Toggle On / Off', keyFunctionToggleStandby: 'Toggle Standby', keyFunctionResetPIN: 'Reset PIN', keyFunctionMuteSystem: 'Fire Mute', keyFunctionToggleBridgeMode: 'Toggle Bridge Mode', keyFunctionEraseUserPresets: 'Erase User presets', keyFunctionSafeMode: 'Startup in Safe Mode', keyFunctionGotoStandby: 'Go to Standby', keyFunctionExitStandby: 'Exit Standby'} keySelectOptions = {keyFunctionNone: '', keyFunctionSystemMenu: '', keyFunctionEscExit: '', keyFunctionToggleMute: 'c', keyFunctionChannelSelect: 'c', keyFunctionItemSelect: 'sm', keyFunctionChannelUp: '', keyFunctionChannelDown: '', keyFunctionItemUp: '', keyFunctionItemDown: '', keyFunctionModifyValue: 'smciv', keyFunctionNotUsed1: 'smciv', keyFunctionNextPreset: 'v', keyFunctionEnterConfirm: '', keyFunctionSetValueTo: 'scmiv', keyFunctionLoadPreset: 'v', keyFunctionNetworkReset: '', keyFunctionFactoryReset: '', keyFunctionLockKeys: '', keyFunctionCopy: '', keyFunctionPaste: '', keyFunctionLockUnlock: '', keyFunctionToggleOnOff: 'sci', keyFunctionToggleStandby: '', keyFunctionResetPIN: '', keyFunctionMuteSystem: 'v', keyFunctionToggleBridgeMode: 'c', keyFunctionEraseUserPresets: '', keyFunctionSafeMode: '', keyFunctionGotoStandby: '', keyFunctionExitStandby: ''} keyTriggerOptions = {0: 'On Push', 1: 'Click', 2: 'Hold 3 sec', 3: 'Hold 10 sec', 4: 'Hold 20 sec', 5: 'Hold 30 sec', 6: 'Depressed', 7: 'Not pressed', 8: 'Hold 1 sec', 9: 'Hold 2 sec', 10: 'On Release', 11: 'Hold Until Action', 12: 'Release Until Action'} gpiTriggerOptions = {0: 'Falling Edge', 1: 'Pulse 0.5 sec', 2: 'Pulse 5 sec', 3: 'Pulse 15 sec', 4: 'Pulse 25 sec', 5: 'Pulse 35 sec', 6: 'Active', 7: 'Not Active', 8: 'Pulse 1.5 sec', 9: 'Pulse 2.5 sec', 10: 'Rising Edge', 11: 'Active Until Action', 12: 'Not Active Until Action'} keyTriggerChoices = [ 71, 81, 72, 79, 80, 73, 74, 75, 76, 77, 82, 78, 83] gpiTriggerChoices = [ 94, 84, 90, 95, 91, 96, 85, 92, 93, 86, 87, 88, 89] defaultRotaryFunctions = {16: 'Channel Gain', 48: 'Channel Delay', 32: 'PEQ 1 Gain', 33: 'PEQ 2 Gain', 34: 'PEQ 3 Gain', 35: 'PEQ 4 Gain', 36: 'PEQ 5 Gain', 37: 'PEQ 6 Gain', 38: 'PEQ 7 Gain', 39: 'PEQ 8 Gain', 40: 'PEQ 9 Gain', 41: 'PEQ 10 Gain', 255: 'Disabled'} class frontPanelKeys(wx.Panel): def __init__(self, parent, frame, uiNumber, panelName): self.frame = frame self.name = panelName self.uiNumber = uiNumber self.panelName = panelName self.parent = parent if uiNumber >= 96: self.keyTriggerOptions = gpiTriggerOptions self.keyTriggerChoices = gpiTriggerChoices else: self.keyTriggerOptions = keyTriggerOptions self.keyTriggerChoices = keyTriggerChoices wx.Panel.__init__(self, parent, size=(964, 500)) self.lines = {} self.initFinished = False self.frame = frame self.Show(True) return def initMe(self, force=False): if self.IsShown() == False and force == False: return else: if self.initFinished == True: return 0 print mytime.displayTime(), 'uck.initMe FrontPanelKeys', self.name i = 0 frame = self.frame uiNumber = self.uiNumber self.struct_id_choices = ['Selected'] for strID in (0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 17): self.struct_id_choices.append(protocol.get_strid_text(strID)) self.member_id_choices = [ 'Selected'] for membID in (0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 24, 27): self.member_id_choices.append(protocol.get_member_text(membID)) self.channels = {127: 'All Inputs', 255: 'All Outputs'} for c in self.frame.frame.parent.unit_channels: if c < 128: s = 'Input ' + str(c + 1) else: s = 'Output ' + str(c - 127) self.channels[c] = s self.uiKeys = getKeys(frame, uiNumber) print 'uck.Keys for ui number', uiNumber, ':', self.uiKeys self.offset = 40 labelOffset = 20 self.factoryItems = 0 self.rotaryKeys = None pos = self.panelName.lower().find('rotary') if pos >= 0: rotaryNumber = 0 try: rotaryNumber = int(self.panelName[-1]) - 1 if rotaryNumber < 0: rotaryNumber = 0 except: pass else: print mytime.displayTime(), 'uck.found rotary number', rotaryNumber self.rotaryKeys = getKeys(frame, 88 + rotaryNumber) if rotaryNumber == 3: self.frame.frame.clear(self.frame, 92) self.frame.frame.clear(self.frame, 93) self.frame.frame.clear(self.frame, 94) self.frame.frame.clear(self.frame, 95) self.createRotaryLine(0) self.lines[0].uiNumber = 88 + rotaryNumber i = 1 self.offset = 40 labelOffset = 48 if len(self.rotaryKeys) > 0: for uiIndex in self.rotaryKeys: (key, val) = self.rotaryKeys[uiIndex] print mytime.displayTime(), 'uck.found rotary key for rotary number', rotaryNumber, ':', key, val if key.channel == 1 and key.index >= 128: continue else: self.lines[0].key = key self.lines[0].uiNumber = val[0] self.lines[0].bit1Choice.SetStringSelection(str(val[5])) self.lines[0].bit2Choice.SetStringSelection(str(val[6])) try: self.lines[0].functionChoice.SetStringSelection(str(defaultRotaryFunctions[val[7]])) except: self.lines[0].functionChoice.SetStringSelection('Disabled') try: channelString = self.channels[val[3]] except: channelString = 'Input 1' self.lines[0].channelChoice.SetStringSelection(channelString) self.lines[0].bit1Choice.Enable(True) self.lines[0].bit2Choice.Enable(True) self.lines[0].functionChoice.Enable(True) self.lines[0].channelChoice.Enable(True) self.lines[0].checkBox.SetValue(True) self.strTrigger = wx.StaticText(self, -1, 'Trigger', pos=(80, labelOffset)) self.strFunction = wx.StaticText(self, -1, 'Function', pos=(230, labelOffset)) self.strItem = wx.StaticText(self, -1, 'Process', pos=(370, labelOffset)) self.strSubItem = wx.StaticText(self, -1, 'Parameter', pos=(480, labelOffset)) self.strChannel = wx.StaticText(self, -1, 'Channel', pos=(590, labelOffset)) self.strIndex = wx.StaticText(self, -1, 'Index', pos=(700, labelOffset)) self.strValue = wx.StaticText(self, -1, 'Value', pos=(750, labelOffset)) for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel != 1 or key.index < 128: continue self.createLine(i, self.offset) self.lines[i].key = key self.lines[i].checkBox.Enable(False) self.lines[i].checkBox.SetLabel('Factory') self.lines[i].struct_id_choice.Enable(False) self.lines[i].member_id_choice.Enable(False) self.lines[i].channel_choice.Enable(False) self.lines[i].index_choice.Enable(False) self.lines[i].keyTriggerChoice.Enable(False) self.lines[i].checkBox.SetValue(True) self.lines[i].struct_id_choice.SetStringSelection(protocol.get_strid_text(val[1])) self.lines[i].member_id_choice.SetStringSelection(protocol.get_member_text(val[2])) channel = val[3] if channel == 255: channel = 'All Outputs' elif channel == 127: channel = 'All Inputs' elif channel < 128: channel = 'Input ' + str(channel + 1) else: channel = 'Output ' + str(channel - 128 + 1) self.lines[i].channel_choice.SetStringSelection(channel) self.lines[i].index_choice.SetStringSelection(str(val[4] + 1)) keyFunction = val[5] self.lines[i].keyFunctionChoice.SetStringSelection(keyFunctions[keyFunction]) self.lines[i].keyTriggerChoice.SetStringSelection(self.keyTriggerOptions[val[6]]) self.enable(i) self.lines[i].keyFunctionChoice.Enable(False) if keyFunction in (keyFunctionNextPreset, keyFunctionLoadPreset, keyFunctionMuteSystem): self.lines[i].value.SetValue(str(val[2])) elif keyFunction in (keyFunctionModifyValue, keyFunctionSetValueTo): self.lines[i].value.SetValue(str(val[7] - 128)) i += 1 self.factoryItems += 1 for uiIndex in self.uiKeys: (key, val) = self.uiKeys[uiIndex] if key.channel == 1 and key.index >= 128: continue self.createLine(i, self.offset) self.lines[i].key = key self.lines[i].checkBox.SetValue(True) keyFunction = val[5] self.lines[i].keyFunctionChoice.SetStringSelection(keyFunctions[keyFunction]) self.lines[i].keyTriggerChoice.SetStringSelection(self.keyTriggerOptions[val[6]]) if keyFunction in (keyFunctionNextPreset, keyFunctionLoadPreset, keyFunctionMuteSystem): self.lines[i].value.SetValue(str(val[2])) elif keyFunction in (keyFunctionModifyValue, keyFunctionSetValueTo): self.lines[i].value.SetValue(str((val[7] - 128) / 4.0)) self.enable(i) self.lines[i].struct_id_choice.SetStringSelection(protocol.get_strid_text(val[1])) self.lines[i].member_id_choice.SetStringSelection(protocol.get_member_text(val[2])) channel = val[3] if channel == 255: channel = 'All Outputs' elif channel == 127: channel = 'All Inputs' elif channel < 128: channel = 'Input ' + str(channel + 1) else: channel = 'Output ' + str(channel - 128 + 1) self.lines[i].channel_choice.SetStringSelection(channel) self.lines[i].index_choice.SetStringSelection(str(val[4] + 1)) i += 1 if i - self.factoryItems < 8: self.createLine(i, self.offset) self.initFinished = True return def createRotaryLine(self, i): p = wx.Panel(self, size=(964, 28)) p.type = 'rotary' p.Show(False) p.checkBox = wx.CheckBox(p, 10 + i, 'Enable Rotary', pos=(10, 2)) p.label2 = wx.StaticText(p, -1, 'bit 1', pos=(120, 3)) p.bit1Choice = wx.Choice(p, 20 + i, choices=[_[1] for nr in range(32)], style=wx.BORDER_NONE, pos=(160, 0), size=(60, 26)) p.label3 = wx.StaticText(p, -1, 'bit 2', pos=(240, 3)) p.bit2Choice = wx.Choice(p, 30 + i, choices=[_[2] for nr in range(32)], style=wx.BORDER_NONE, pos=(280, 0), size=(60, 26)) p.label4 = wx.StaticText(p, -1, 'Default Function', pos=(360, 3)) p.functionChoice = wx.Choice(p, 40 + i, choices=defaultRotaryFunctions.values(), style=wx.BORDER_NONE, pos=(480, 0), size=(150, 26)) p.functionChoice.SetStringSelection('Disabled') p.label4 = wx.StaticText(p, -1, 'Channel', pos=(670, 3)) channels = self.channels.values() channels.remove('All Inputs') channels.remove('All Outputs') p.channelChoice = wx.Choice(p, 60 + i, choices=sorted(channels), style=wx.BORDER_NONE, pos=(730, 0), size=(100, 26)) p.channelChoice.SetStringSelection(channels[0]) p.bit1Choice.Enable(False) p.bit2Choice.Enable(False) p.functionChoice.Enable(False) p.channelChoice.Enable(False) p.SetPosition((0, 12)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.checkBox.Show(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabledRotary, id=10 + i) self.lines[i] = p p.Show(True) return def OnEnabledRotary(self, e): i = e.GetId() - 10 if i != 0: return val = self.lines[i].checkBox.GetValue() self.lines[i].bit1Choice.Enable(val) self.lines[i].bit2Choice.Enable(val) self.lines[i].functionChoice.Enable(val) self.lines[i].channelChoice.Enable(val) return def createLine(self, i, offset): p = wx.Panel(self, size=(964, 28)) p.type = 'key' p.Show(False) p.checkBox = wx.CheckBox(p, 10 + i, ' User', pos=(10, 2), size=(70, 20)) p.keyTriggerChoice = wx.Choice(p, 80 + i, choices=self.keyTriggerChoices, style=wx.BORDER_NONE, pos=(80, 0), size=(140, 26)) p.keyTriggerChoice.SetStringSelection(sorted(self.keyTriggerOptions.values())[0]) p.keyFunctionChoice = wx.Choice(p, 30 + i, choices=sorted(keyFunctions.values()), style=wx.BORDER_NONE, pos=(230, 0), size=(130, 26)) p.keyFunctionChoice.SetStringSelection(keyFunctions.values()[0]) p.struct_id_choice = wx.Choice(p, 40 + i, choices=self.struct_id_choices, style=wx.BORDER_NONE, pos=(370, 0), size=(100, 26)) p.struct_id_choice.SetStringSelection(self.struct_id_choices[0]) p.member_id_choice = wx.Choice(p, 50 + i, choices=self.member_id_choices, style=wx.BORDER_NONE, pos=(480, 0), size=(100, 26)) p.member_id_choice.SetStringSelection(self.member_id_choices[0]) p.channel_choice = wx.Choice(p, 60 + i, choices=sorted(self.channels.values()), style=wx.BORDER_NONE, pos=(590, 0), size=(100, 26)) p.channel_choice.SetStringSelection(self.channels.values()[0]) p.index_choice = wx.Choice(p, 70 + i, choices=[_[1] for j in range(10)], style=wx.BORDER_NONE, pos=(700, 0), size=(45, 26)) p.index_choice.SetStringSelection('1') p.value = wx.TextCtrl(p, 20 + i, '', pos=(750, 1), size=(100, 20)) p.value.Show(False) p.strParameter = wx.StaticText(p, -1, '', pos=(590, 3), size=(120, 20)) p.strParameter.Show(False) p.SetPosition((0, offset + 28 * i)) p.checkBox.SetValue(0) p.checkBox.Enable(True) p.key = None self.Bind(wx.EVT_CHECKBOX, self.OnEnabled, id=10 + i) self.Bind(wx.EVT_CHOICE, self.OnStructId, id=40 + i) self.Bind(wx.EVT_CHOICE, self.OnChangeKeyFunction, id=30 + i) self.lines[i] = p self.enable(i) p.Show(True) return def enable(self, i): val = self.lines[i].checkBox.GetValue() self.showChoices(i, self.getKeyFunction(self.lines[i]), val) return def showChoices(self, i, keyFunctionInt, enabled): self.lines[i].keyFunctionChoice.Enable(enabled) try: keyFunctionFields = keySelectOptions[keyFunctionInt] except: keyFunctionFields = None self.lines[i].struct_id_choice.Show(False) self.lines[i].member_id_choice.Show(False) self.lines[i].channel_choice.Show(False) self.lines[i].index_choice.Show(False) self.lines[i].value.Show(False) self.lines[i].strParameter.Show(False) if keyFunctionFields.find('s') >= 0: self.lines[i].struct_id_choice.Show(True) if self.lines[i].struct_id_choice.GetStringSelection() not in ('Selected', 'All'): if keyFunctionFields.find('m') >= 0: self.lines[i].member_id_choice.Show(True) if keyFunctionFields.find('c') >= 0: self.lines[i].channel_choice.Show(True) if keyFunctionFields.find('i') >= 0: self.lines[i].index_choice.Show(True) elif keyFunctionFields.find('m') >= 0: self.lines[i].member_id_choice.Show(True) if keyFunctionFields.find('c') >= 0: self.lines[i].channel_choice.Show(True) if keyFunctionFields.find('i') >= 0: self.lines[i].index_choice.Show(True) if keyFunctionFields.find('v') >= 0: self.lines[i].value.Show(True) if keyFunctionInt == keyFunctionNextPreset: self.lines[i].strParameter.SetLabel('Looping Range:') self.lines[i].strParameter.Show(True) elif keyFunctionInt == keyFunctionLoadPreset: self.lines[i].strParameter.SetLabel('Preset To Load:') self.lines[i].strParameter.Show(True) if keyFunctionFields == 'sm': self.lines[i].struct_id_choice.Show(True) self.lines[i].member_id_choice.Show(True) self.struct_id_choices = [] if keyFunctionInt == keyFunctionToggleOnOff: for strID in (3, 4, 5): self.struct_id_choices.append(protocol.get_strid_text(strID)) elif keyFunctionInt == keyFunctionModifyValue: for strID in (0, 5, 12): self.struct_id_choices.append(protocol.get_strid_text(strID)) elif keyFunctionInt == keyFunctionSetValueTo: for strID in (0, 5, 7, 17): self.struct_id_choices.append(protocol.get_strid_text(strID)) else: for strID in (0, 1, 2, 3, 4, 5, 6, 7, 8, 12): self.struct_id_choices.append(protocol.get_strid_text(strID)) currentSelection = self.lines[i].struct_id_choice.GetStringSelection() self.lines[i].struct_id_choice.Clear() self.lines[i].struct_id_choice.AppendItems(self.struct_id_choices) if currentSelection in self.struct_id_choices: self.lines[i].struct_id_choice.SetStringSelection(currentSelection) else: self.lines[i].struct_id_choice.SetStringSelection(self.struct_id_choices[0]) self.member_id_choices = [] if keyFunctionInt in (keyFunctionSetValueTo, keyFunctionModifyValue): for membID in (0, protocol.MEMBER_ID_THRESHOLD, 7, 65): self.member_id_choices.append(protocol.get_member_text(membID)) else: for membID in (0, 1, 2, 3, 4, 5, 6, 7, 8, 14, 15, 24, 27): self.member_id_choices.append(protocol.get_member_text(membID)) currentSelection = self.lines[i].member_id_choice.GetStringSelection() self.lines[i].member_id_choice.Clear() self.lines[i].member_id_choice.AppendItems(self.member_id_choices) if currentSelection in self.member_id_choices: self.lines[i].member_id_choice.SetStringSelection(currentSelection) else: self.lines[i].member_id_choice.SetStringSelection(self.member_id_choices[0]) 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 < 7 + self.factoryItems: self.createLine(i + 1, self.offset) return def OnChangeKeyFunction(self, e): i = e.GetId() - 30 self.showChoices(i, self.getKeyFunction(self.lines[i]), 1) print mytime.displayTime() + ' on change key function', self.lines[i].keyFunctionChoice.GetStringSelection() return def OnStructId(self, e): print mytime.displayTime() + ' OnStructid' i = e.GetId() - 40 self.showChoices(i, self.getKeyFunction(self.lines[i]), True) return def getKeyFunction(self, line): fName = line.keyFunctionChoice.GetStringSelection() for k in keyFunctions.keys(): if keyFunctions[k] == fName: return k return def getKeyTrigger(self, line): fName = line.keyTriggerChoice.GetStringSelection() for k in self.keyTriggerOptions.keys(): if self.keyTriggerOptions[k] == fName: return k return def evaluateLine(self, line): if line.checkBox.GetValue() == False: return else: if line.type == 'rotary': try: bit1 = int(line.bit1Choice.GetStringSelection()) bit2 = int(line.bit2Choice.GetStringSelection()) functionChoice = line.functionChoice.GetStringSelection() functionChoiceInt = 255 for c in defaultRotaryFunctions: v = defaultRotaryFunctions[c] if v == functionChoice: functionChoiceInt = c break channelChoice = line.channelChoice.GetStringSelection() if channelChoice.find('Input ') >= 0: channel = int(channelChoice.replace('Input ', '')) - 1 elif channelChoice.find('Output ') >= 0: channel = int(channelChoice.replace('Output ', '')) - 1 + 128 sendString = '' + chr(line.uiNumber) sendString += chr(0) sendString += chr(0) sendString += chr(channel) sendString += chr(0) sendString += chr(bit1) sendString += chr(bit2) sendString += chr(functionChoiceInt) mys = 'String: ' for c in sendString: mys += hex(ord(c)) + ':' print mys return sendString except: print mytime.displayTime(), 'uck.fpk.eL.failed to build string' traceback.print_exc(file=sys.stdout) return return try: if line.key.channel == 1 and line.key.index >= 128: return except: pass value = 0 keyFunction = self.getKeyFunction(line) if keyFunction in (keyFunctionModifyValue, keyFunctionSetValueTo): strID = protocol.get_strid_by_text(line.struct_id_choice.GetStringSelection()) membID = protocol.get_membid_by_text(line.member_id_choice.GetStringSelection()) channel = line.channel_choice.GetStringSelection() if channel == 'All Inputs': channel = 127 elif channel == 'All Outputs': channel = 255 elif channel.find('Input ') >= 0: channel = int(channel.replace('Input ', '')) - 1 elif channel.find('Output ') >= 0: channel = int(channel.replace('Output ', '')) - 1 + 128 index = int(line.index_choice.GetStringSelection()) - 1 try: value = int(float(line.value.GetValue()) * 4.0) except: value = 0 else: if value > 127: value = 127 if value < -127: value = -127 line.value.SetValue(str(value / 4.0)) value += 128 elif keyFunction in (keyFunctionToggleMute, keyFunctionChannelSelect, keyFunctionToggleBridgeMode): strID = 0 membID = 0 channel = line.channel_choice.GetStringSelection() if channel == 'All Inputs': channel = 127 elif channel == 'All Outputs': channel = 255 elif channel.find('Input ') >= 0: channel = int(channel.replace('Input ', '')) - 1 elif channel.find('Output ') >= 0: channel = int(channel.replace('Output ', '')) - 1 + 128 index = 0 elif keyFunction in (keyFunctionNextPreset, keyFunctionLoadPreset, keyFunctionMuteSystem): strID = 0 channel = 0 index = 0 membID = line.value.GetValue() try: membID = int(membID) if keyFunction == keyFunctionMuteSystem: if membID < 0: membID = 0 if membID > 1: membID = 1 elif membID < 1: membID = 1 if membID > self.frame.frame.parent.number_of_presets: print mytime.displayTime(), 'Limiting preset selection to max preset range of', self.frame.frame.parent.number_of_presets membID = self.frame.frame.parent.number_of_presets except: traceback.print_exc(file=sys.stdout) membID = 1 elif keyFunction == keyFunctionToggleOnOff: strID = protocol.get_strid_by_text(line.struct_id_choice.GetStringSelection()) membID = protocol.MEMBER_ID_ON channel = line.channel_choice.GetStringSelection() if channel == 'All Inputs': channel = 127 elif channel == 'All Outputs': channel = 255 elif channel.find('Input ') >= 0: channel = int(channel.replace('Input ', '')) - 1 elif channel.find('Output ') >= 0: channel = int(channel.replace('Output ', '')) - 1 + 128 index = int(line.index_choice.GetStringSelection()) - 1 elif keyFunction == keyFunctionLockKeys: strID = 0 membID = 0 channel = 0 index = 0 else: strID = 0 membID = 0 channel = 0 index = 0 keyTrigger = self.getKeyTrigger(line) try: sendString = '' + chr(self.uiNumber) sendString += chr(strID) sendString += chr(membID) sendString += chr(channel) sendString += chr(index) sendString += chr(keyFunction) sendString += chr(keyTrigger) sendString += chr(value) return sendString except: print mytime.displayTime(), 'uck.fpk.eL.failed to build string' traceback.print_exc(file=sys.stdout) return return # okay decompiling pycode/user_config_keys.pyc