tidy up + change way plugins are found+listed, solves some problems, plugins use the active status to indicate disabled and now have start/stop methods (seems to work to stop+restart Sound+WJ ok, needs restart to get MidiFeedback working if its disabled? needs more tidying up and testing and fixing

This commit is contained in:
Tristan Rowley
2020-03-01 23:37:58 +00:00
parent 9738fc74a5
commit 99006a2cd7
14 changed files with 120 additions and 67 deletions

View File

@@ -3,7 +3,6 @@ import data_centre.plugin_collection
from data_centre.plugin_collection import ActionsPlugin, SequencePlugin, DisplayPlugin
class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin):
disabled = False
MAX_LFOS = 4
@@ -20,8 +19,10 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin):
#self.PRESET_FILE_NAME = "ShaderLoopRecordPlugin/frames.json"
self.pc.shaders.root.after(1000, self.run_automation)
self.pc.shaders.root.after(1000, self.start_plugin)
def start_plugin(self):
self.pc.shaders.root.after(0, self.run_automation)
# DisplayPlugin methods
def get_display_modes(self):
@@ -100,10 +101,10 @@ class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin):
import time
now = time.time()
if self.pc.data.plugins is None:
if self.pc.data.plugins is None: # not initialised yet
return
if not self.active:
if not self.active: # output is disabled
return
for lfo in range(0,self.MAX_LFOS):