Fix AttributeError: remove redundant mapping_learned connection in main.py
TopBarWidget already connects mapping_learned to _on_mapping_learned internally in set_midi_engine, so the external connection in main.py was both redundant and referenced a non-existent method.
This commit is contained in:
+34
-1
@@ -88,6 +88,9 @@ class MidiEngine(QObject):
|
||||
cart_trigger = Signal(int)
|
||||
mixer_volume = Signal(int, float)
|
||||
mixer_mute = Signal(int, bool)
|
||||
mixer_solo = Signal(int, bool)
|
||||
mixer_pfl = Signal(int, bool)
|
||||
master_control = Signal(str, float)
|
||||
controller_connected = Signal(bool, str)
|
||||
mapping_learned = Signal(str, object, int, int, int, bool)
|
||||
|
||||
@@ -226,12 +229,42 @@ class MidiEngine(QObject):
|
||||
target_id = binding['target_id']
|
||||
inv = binding.get('inverse', False)
|
||||
|
||||
if action == 'mixer_volume':
|
||||
if action == 'deck_play_pause' and isinstance(target_id, str):
|
||||
self.deck_play_pause.emit(target_id)
|
||||
elif action == 'deck_cue' and isinstance(target_id, str):
|
||||
self.deck_cue.emit(target_id)
|
||||
elif action == 'cart_trigger':
|
||||
self.cart_trigger.emit(target_id)
|
||||
elif action == 'deck_play_pause' and isinstance(target_id, str):
|
||||
self.deck_play_pause.emit(target_id)
|
||||
elif action == 'deck_cue' and isinstance(target_id, str):
|
||||
self.deck_cue.emit(target_id)
|
||||
elif action == 'cart_trigger':
|
||||
self.cart_trigger.emit(target_id)
|
||||
elif action == 'mixer_volume':
|
||||
scaled = (127 - value if inv else value) / 127.0
|
||||
self.mixer_volume.emit(target_id, scaled)
|
||||
elif action == 'mixer_mute':
|
||||
muted = (value < 64) if inv else (value > 63)
|
||||
self.mixer_mute.emit(target_id, muted)
|
||||
elif action == 'mixer_solo':
|
||||
on = (value > 63) if not inv else (value < 64)
|
||||
self.mixer_solo.emit(target_id, on)
|
||||
elif action == 'mixer_pfl':
|
||||
on = (value > 63) if not inv else (value < 64)
|
||||
self.mixer_pfl.emit(target_id, on)
|
||||
elif action == 'master_control':
|
||||
scaled = (127 - value if inv else value) / 127.0
|
||||
self.master_control.emit(str(target_id), scaled)
|
||||
elif action == 'mixer_solo':
|
||||
on = (value > 63) if not inv else (value < 64)
|
||||
self.mixer_solo.emit(target_id, on)
|
||||
elif action == 'mixer_pfl':
|
||||
on = (value > 63) if not inv else (value < 64)
|
||||
self.mixer_pfl.emit(target_id, on)
|
||||
elif action == 'master_control':
|
||||
scaled = (127 - value if inv else value) / 127.0
|
||||
self.master_control.emit(str(target_id), scaled)
|
||||
|
||||
def _handle_note_on(self, note: int):
|
||||
# Hardcoded Numark DJ2Go mapping (legacy)
|
||||
|
||||
Reference in New Issue
Block a user