Merge branch 'feature_plugins' into feature_plugins_shader_gadgets

This commit is contained in:
Tristan Rowley
2020-01-31 21:14:56 +00:00
4 changed files with 40 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
# Auto-generated Actions list
Fri 31 Jan 20:24:05 UTC 2020
Fri 31 Jan 21:14:27 UTC 2020
for branch=feature_plugins_shader_gadgets
@@ -173,6 +173,7 @@ for branch=feature_plugins_shader_gadgets
* set_shader_speed_layer_([0-2])_amount
### Plugin routes
* (.*)|invert (from ManipulatePlugin)
* (.*)&&(.*) (from MultiActionsPlugin)
* run_automation (from ShaderLoopRecordPlugin)
* stop_automation (from ShaderLoopRecordPlugin)
@@ -199,6 +200,8 @@ for branch=feature_plugins_shader_gadgets
* toggle_pause_automation (from TestPlugin)
* pause_automation (from TestPlugin)
* toggle_loop_automation (from TestPlugin)
* print_arguments (from TestPlugin)
* set_the_shader_param_([0-3])_layer_offset_([0-2])_continuous_inverted_example (from TestPlugin)
----

View File

@@ -12,11 +12,11 @@ grep " def " actions.py | grep -v "^#" | sed -e 's/ def //' | sed -e 's/self//'
echo
echo "## Dynamic routes"
grep '( r"' actions.py | sed -e 's/\(.*\)"\(.*\)"\(.*\)/ * \2/' | sed -e 's/\$//' | sed -e 's/\^//'
grep '( r"' actions.py | sed -e 's/\(.*\)"\(.*\)"\(.*\)/ * \2/' | sed -e 's/\$//' | sed -e 's/\^//' | sed -e 's/\\//'
echo
echo "### Plugin routes"
grep "( r\"" plugins/*.py | sed -e 's/plugins\/\(.*\)\.py:\(.*\)\( r\"\)\(.*\)\"\(.*\)/ * \4\t(from \1)/' | grep -v "open_serial" | sed -e 's/\$//' | sed -e 's/\^//'
grep "( r\"" plugins/*.py | sed -e 's/plugins\/\(.*\)\.py:\(.*\)\( r\"\)\(.*\)\"\(.*\)/ * \4\t(from \1)/' | grep -v "open_serial" | sed -e 's/\$//' | sed -e 's/\^//' | sed -e 's/\\//'
echo
echo "----"

View File

@@ -0,0 +1,22 @@
import data_centre.plugin_collection
from data_centre.plugin_collection import ActionsPlugin#, SequencePlugin
class ManipulatePlugin(ActionsPlugin):
disabled = False
def __init__(self, plugin_collection):
super().__init__(plugin_collection)
@property
def parserlist(self):
return [
( r"(.*)\|invert$", self.invert ),
]
def invert(self, action, value):
# invert the value
self.pc.actions.call_method_name(
action, 1.0 - value
# if you were calling an action with no argument, use eg:
# "toggle_automation_pause", None
)

View File

@@ -17,6 +17,8 @@ class MidiActionsTestPlugin(ActionsPlugin,SequencePlugin):
( r"^toggle_pause_automation$", self.toggle_pause_automation ),
( r"^pause_automation$", self.pause_automation ),
( r"^toggle_loop_automation$", self.toggle_loop_automation ),
( r"^print_arguments$", self.print_arguments ),
( r"^set_the_shader_param_([0-3])_layer_offset_([0-2])_continuous_inverted_example$", self.invert_shader_param_layer )
]
def test_plugin(self):
@@ -49,3 +51,13 @@ class MidiActionsTestPlugin(ActionsPlugin,SequencePlugin):
"set_the_shader_param_1_layer_0_continuous", position
)
def print_arguments(self, *args):
print(">>>>print_arguments ( %s )" % args)
def invert_shader_param_layer(self, param, layer, value):
# invert the value
self.pc.actions.call_method_name(
"set_the_shader_param_%s_layer_offset_%s_continuous" % ( param, layer), 1.0 - value
# if you were calling an action with no argument, use eg:
# "toggle_automation_pause", None
)