mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-13 11:50:12 +01:00
plugin selection persists
This commit is contained in:
@@ -33,7 +33,7 @@ class Data(object):
|
||||
BANK_DATA_JSON = 'display_data.json'
|
||||
SHADER_BANK_DATA_JSON = 'shader_bank_data.json'
|
||||
SETTINGS_JSON = 'settings.json'
|
||||
ACTIVE_PLUGINS = 'active_plugins.json'
|
||||
ACTIVE_PLUGINS_JSON = 'active_plugins.json'
|
||||
DEFAULT_SETTINGS_JSON = 'settings_default.json'
|
||||
KEYPAD_MAPPING_JSON = 'keypad_action_mapping.json'
|
||||
OSC_MAPPING_JSON = 'osc_action_mapping.json'
|
||||
@@ -87,8 +87,8 @@ class Data(object):
|
||||
self.bank_data = self._read_json(self.BANK_DATA_JSON)
|
||||
|
||||
self.active_plugins = {}
|
||||
if os.path.isfile(self.PATH_TO_DATA_OBJECTS + self.ACTIVE_PLUGINS):
|
||||
self.bank_data = self._read_json(self.ACTIVE_PLUGINS)
|
||||
if os.path.isfile(self.PATH_TO_DATA_OBJECTS + self.ACTIVE_PLUGINS_JSON):
|
||||
self.active_plugins = self._read_json(self.ACTIVE_PLUGINS_JSON)
|
||||
|
||||
self.shader_bank_data = [self.create_empty_shader_bank() for i in range(3)]
|
||||
if os.path.isfile(self.PATH_TO_DATA_OBJECTS + self.SHADER_BANK_DATA_JSON):
|
||||
@@ -131,6 +131,9 @@ class Data(object):
|
||||
if self.settings['system']['USE_PLUGINS']['value'] == 'disabled':
|
||||
self.active_plugins = {x:False for x in self.active_plugins}
|
||||
|
||||
def update_active_plugins(self, key, value):
|
||||
self.active_plugins[key] = value
|
||||
self._update_json(self.ACTIVE_PLUGINS_JSON, self.active_plugins)
|
||||
|
||||
def load_midi_mapping_for_device(self, device_name):
|
||||
# check if custom config file exists on disk for this device name
|
||||
|
||||
@@ -114,6 +114,7 @@ class BrowserMenu(Menu):
|
||||
######## used for displaying the mappings in browser view ########
|
||||
for bank_index, bank in enumerate(self.data.bank_data):
|
||||
for slot_index, slot in enumerate(bank):
|
||||
print('&&&&&&&&&&&&', slot)
|
||||
if file_name == slot['name']:
|
||||
return True, '{}-{}'.format(bank_index,slot_index)
|
||||
return False, ''
|
||||
@@ -206,7 +207,8 @@ class PluginsMenu(Menu):
|
||||
|
||||
def enter_on_plugins_selection(self):
|
||||
selected_item = sorted(self.data.active_plugins)[self.selected_list_index]
|
||||
self.data.active_plugins[selected_item] = not self.data.active_plugins[selected_item]
|
||||
state = self.data.active_plugins[selected_item]
|
||||
self.data.update_active_plugins(selected_item, not state)
|
||||
|
||||
|
||||
class ShadersMenu(Menu):
|
||||
|
||||
9
json_objects/active_plugins.json
Normal file
9
json_objects/active_plugins.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"LFOModulationPlugin": false,
|
||||
"ManipulatePlugin": true,
|
||||
"MidiFeedbackAPCKey25Plugin": true,
|
||||
"MidiFeedbackLaunchpadPlugin": false,
|
||||
"ShaderLoopRecordPlugin": false,
|
||||
"ShaderQuickPresetPlugin": true,
|
||||
"WJSendPlugin": false
|
||||
}
|
||||
Reference in New Issue
Block a user