refactor call_method_name into actions.py so all the input messages go through the same pipe (mainly to be compatible with workings in plugins dev branch)

This commit is contained in:
Tristan Rowley
2019-12-22 22:09:39 +00:00
parent 5d239e5a5d
commit 6a14dfbe72
3 changed files with 19 additions and 27 deletions

View File

@@ -123,26 +123,8 @@ class MidiInput(object):
else:
norm_message_value = None
self.call_method_name(method_name, norm_message_value)
self.actions.call_method_name(method_name, norm_message_value)
## only update screen if not continuous - seeing if cc can respond faster if not refreshing screen on every action
if 'continuous' not in message_name:
self.display.refresh_display()
def call_method_name(self, method_name, argument=None):
# if the target method doesnt exist, call the handler
if not hasattr(self.actions, method_name):
self.call_parse_method_name(method_name, argument)
return
if argument is not None:
getattr(self.actions, method_name)(argument)
else:
getattr(self.actions, method_name)()
def call_parse_method_name(self, method_name, argument):
method, arguments = self.actions.get_callback_for_method(method_name, argument)
method(*arguments)