mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-12 11:20:15 +01:00
Merge branch 'feature_plugins' into feature_plugins_shader_gadgets - MultiActions, some fixes and improved handling of action calls
This commit is contained in:
@@ -89,12 +89,10 @@ class MidiFeedbackAPCKey25Plugin(MidiFeedbackPlugin):
|
||||
def feedback_plugin_status(self):
|
||||
from data_centre.plugin_collection import SequencePlugin
|
||||
|
||||
from plugins.MidiActionsTestPlugin import MidiActionsTestPlugin
|
||||
|
||||
try:
|
||||
from plugins.ShaderLoopRecordPlugin import ShaderLoopRecordPlugin
|
||||
for plugin in self.pc.get_plugins(SequencePlugin):
|
||||
if isinstance(plugin, ShaderLoopRecordPlugin): #MidiActionsTestPlugin):
|
||||
if isinstance(plugin, ShaderLoopRecordPlugin):
|
||||
|
||||
NOTE_PLAY_STATUS = 65
|
||||
NOTE_RECORD_STATUS = 66
|
||||
@@ -225,7 +223,7 @@ class MidiFeedbackAPCKey25Plugin(MidiFeedbackPlugin):
|
||||
#print("in update device status is %s" % self.status)
|
||||
for i,c in self.status.items():
|
||||
#'print("comparing\n%s to\n%s" % (c, self.last_state[i]))
|
||||
if self.last_state is None or self.last_state[i]!=c:
|
||||
if self.last_state is None or (i not in self.last_state or self.last_state[i]!=c):
|
||||
#print("got command: %s: %s" % (i,c))
|
||||
self.send_command(**c)
|
||||
self.last_state = deepcopy(self.status)
|
||||
|
||||
19
plugins/MultiActionsPlugin.py
Normal file
19
plugins/MultiActionsPlugin.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import data_centre.plugin_collection
|
||||
from data_centre.plugin_collection import ActionsPlugin
|
||||
|
||||
class MultiActionsPlugin(ActionsPlugin):
|
||||
disabled = False
|
||||
|
||||
def __init__(self, plugin_collection):
|
||||
super().__init__(plugin_collection)
|
||||
|
||||
@property
|
||||
def parserlist(self):
|
||||
return [
|
||||
( r"(.*)&&(.*)", self.run_multi ),
|
||||
]
|
||||
|
||||
def run_multi(self, action1, action2, value):
|
||||
print("multi running %s and %s with value %s" % (action1, action2, value))
|
||||
self.pc.actions.call_method_name(action1, value)
|
||||
self.pc.actions.call_method_name(action2, value)
|
||||
@@ -10,13 +10,13 @@ class MidiActionsTestPlugin(ActionsPlugin,SequencePlugin):
|
||||
@property
|
||||
def parserlist(self):
|
||||
return [
|
||||
( r"test_plugin", self.test_plugin ),
|
||||
( r"cycle_shaders", self.cycle_shaders ),
|
||||
( r"run_automation", self.run_automation ),
|
||||
( r"stop_automation", self.stop_automation ),
|
||||
( r"toggle_pause_automation", self.toggle_pause_automation ),
|
||||
( r"pause_automation", self.pause_automation ),
|
||||
( r"toggle_loop_automation", self.toggle_loop_automation ),
|
||||
( r"^test_plugin$", self.test_plugin ),
|
||||
( r"^cycle_shaders$", self.cycle_shaders ),
|
||||
( r"^run_automation$", self.run_automation ),
|
||||
( r"^stop_automation$", self.stop_automation ),
|
||||
( r"^toggle_pause_automation$", self.toggle_pause_automation ),
|
||||
( r"^pause_automation$", self.pause_automation ),
|
||||
( r"^toggle_loop_automation$", self.toggle_loop_automation ),
|
||||
]
|
||||
|
||||
def test_plugin(self):
|
||||
@@ -42,7 +42,7 @@ class MidiActionsTestPlugin(ActionsPlugin,SequencePlugin):
|
||||
frequency = 50
|
||||
def run_sequence(self, position):
|
||||
self.pc.actions.call_method_name(
|
||||
"set_the_shader_param_0_layer_0_continuous", position
|
||||
"set_the_shader_param_3_layer_0_continuous", position
|
||||
)
|
||||
|
||||
self.pc.actions.call_method_name(
|
||||
Reference in New Issue
Block a user