mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-13 20:00:12 +01:00
Initialise plugins later so that they've got better access to modules to do stuff
This commit is contained in:
@@ -53,10 +53,6 @@ class Data(object):
|
|||||||
self.PATHS_TO_SHADERS = [self.PATH_TO_EXTERNAL_DEVICES, '/home/pi/r_e_c_u_r/Shaders', '/home/pi/Shaders' ]
|
self.PATHS_TO_SHADERS = [self.PATH_TO_EXTERNAL_DEVICES, '/home/pi/r_e_c_u_r/Shaders', '/home/pi/Shaders' ]
|
||||||
self.PATHS_TO_PLUGIN_DATA = [ '/home/pi/r_e_c_u_r/json_objects/plugins', self.PATH_TO_EXTERNAL_DEVICES ]
|
self.PATHS_TO_PLUGIN_DATA = [ '/home/pi/r_e_c_u_r/json_objects/plugins', self.PATH_TO_EXTERNAL_DEVICES ]
|
||||||
|
|
||||||
#initialise plugin manager
|
|
||||||
self.plugins = plugin_collection.PluginCollection("plugins", message_handler, self)
|
|
||||||
self.plugins.apply_all_plugins_on_value(5)
|
|
||||||
|
|
||||||
### state data
|
### state data
|
||||||
self.auto_repeat_on = True
|
self.auto_repeat_on = True
|
||||||
self.function_on = False
|
self.function_on = False
|
||||||
@@ -107,6 +103,11 @@ class Data(object):
|
|||||||
docs.generate_mappings_doc("Key mappings", self.analog_mappings, column_one_header="Analogue input")
|
docs.generate_mappings_doc("Key mappings", self.analog_mappings, column_one_header="Analogue input")
|
||||||
#quit()
|
#quit()
|
||||||
|
|
||||||
|
def initialise_plugins(self):
|
||||||
|
#initialise plugin manager
|
||||||
|
self.plugins = plugin_collection.PluginCollection("plugins", self.message_handler, self)
|
||||||
|
self.plugins.apply_all_plugins_on_value(5)
|
||||||
|
|
||||||
def load_midi_mapping_for_device(self, device_name):
|
def load_midi_mapping_for_device(self, device_name):
|
||||||
# check if custom config file exists on disk for this device name
|
# check if custom config file exists on disk for this device name
|
||||||
custom_file = self.MIDI_MAPPING_JSON.replace(".json","_%s.json"%device_name)
|
custom_file = self.MIDI_MAPPING_JSON.replace(".json","_%s.json"%device_name)
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ class PluginCollection(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def shaders(self):
|
def shaders(self):
|
||||||
return self.message_handler.shaders
|
return self.actions.shaders
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def actions(self):
|
def actions(self):
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ display = Display(tk, video_driver, shaders, message_handler, data)
|
|||||||
actions = Actions(tk, message_handler, data, video_driver, shaders, display, osc_client)
|
actions = Actions(tk, message_handler, data, video_driver, shaders, display, osc_client)
|
||||||
message_handler.actions = actions
|
message_handler.actions = actions
|
||||||
|
|
||||||
|
data.initialise_plugins()
|
||||||
|
|
||||||
numpad_input = NumpadInput(tk, message_handler, display, actions, data)
|
numpad_input = NumpadInput(tk, message_handler, display, actions, data)
|
||||||
osc_input = OscInput(tk, message_handler, display, actions, data)
|
osc_input = OscInput(tk, message_handler, display, actions, data)
|
||||||
midi_input = MidiInput(tk, message_handler, display, actions, data)
|
midi_input = MidiInput(tk, message_handler, display, actions, data)
|
||||||
|
|||||||
Reference in New Issue
Block a user