mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-11 19:00:04 +01:00
tidy up how midi_input is set/accessed from plugins, nicer complaining when the shader gadget plugins arent present, and feedback plugin now takes most of its config (which notes to light up) by reading the midi config
This commit is contained in:
@@ -10,6 +10,7 @@ class MidiInput(object):
|
||||
self.display = display
|
||||
self.actions = actions
|
||||
self.data = data
|
||||
self.data.midi_input = self
|
||||
self.midi_mappings = data.midi_mappings
|
||||
self.midi_device = None
|
||||
self.midi_feedback_device = None
|
||||
@@ -166,3 +167,12 @@ class MidiInput(object):
|
||||
if self.midi_output.supports_midi_feedback(self.data.midi_device_name):
|
||||
self.root.after(self.midi_delay*5, self.refresh_midi_feedback)
|
||||
|
||||
|
||||
def find_binding_for_action(self, action):
|
||||
for bind,a in self.midi_mappings.items():
|
||||
#print("looped over %s : %s " % (bind,a))
|
||||
for (b,c) in a.items():
|
||||
if action in c:
|
||||
#print ("find_binding_for_action(%s) got %s" % (action, bind))
|
||||
return bind
|
||||
|
||||
|
||||
Reference in New Issue
Block a user