mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-16 21:30:01 +01:00
actions to go forward/back thru modulation slots
This commit is contained in:
@@ -1036,6 +1036,8 @@ class Actions(object):
|
|||||||
( r"^reset_selected_modulation$", self.shaders.reset_selected_modulation ),
|
( r"^reset_selected_modulation$", self.shaders.reset_selected_modulation ),
|
||||||
( r"^reset_modulation_([0-3])$", self.shaders.reset_modulation ),
|
( r"^reset_modulation_([0-3])$", self.shaders.reset_modulation ),
|
||||||
( r"^select_shader_modulation_slot_([0-3])$", self.shaders.select_shader_modulation_slot ),
|
( r"^select_shader_modulation_slot_([0-3])$", self.shaders.select_shader_modulation_slot ),
|
||||||
|
( r"^select_next_shader_modulation_slot$", self.shaders.select_next_shader_modulation_slot ),
|
||||||
|
( r"^select_previous_shader_modulation_slot$", self.shaders.select_previous_shader_modulation_slot ),
|
||||||
( r"^set_shader_speed_layer_offset_([0-2])_amount$", self.shaders.set_speed_offset_to_amount ),
|
( r"^set_shader_speed_layer_offset_([0-2])_amount$", self.shaders.set_speed_offset_to_amount ),
|
||||||
( r"^set_shader_speed_layer_([0-2])_amount$", self.shaders.set_speed_layer_to_amount ),
|
( r"^set_shader_speed_layer_([0-2])_amount$", self.shaders.set_speed_layer_to_amount ),
|
||||||
( r"^set_display_mode_([a-zA-Z_]*)$", self.set_display_mode )
|
( r"^set_display_mode_([a-zA-Z_]*)$", self.set_display_mode )
|
||||||
@@ -1099,9 +1101,8 @@ class Actions(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
#print ("for method_name %s, arguments is %s and len is %s, got method %s" % (method_name, arguments, len(signature(method).parameters), method))
|
#print ("for method_name %s, arguments is %s and len is %s, got method %s" % (method_name, arguments, len(signature(method).parameters), method))
|
||||||
|
|
||||||
# for the case where cc is being used as switch, we ignore note_off
|
# for the case where cc is being used as switch, we ignore note_off
|
||||||
print(type(argument))
|
#print(type(argument))
|
||||||
if len(signature(method).parameters) == 0 and isinstance(argument, float) and argument == 0:
|
if len(signature(method).parameters) == 0 and isinstance(argument, float) and argument == 0:
|
||||||
print('cc off ?')
|
print('cc off ?')
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ from data_centre.plugin_collection import ModulationReceiverPlugin
|
|||||||
class Shaders(object):
|
class Shaders(object):
|
||||||
MENU_HEIGHT = 10
|
MENU_HEIGHT = 10
|
||||||
EMPTY_SHADER = dict(name='none',is_shader=True,shad_type='-',param_number=4,path='-')
|
EMPTY_SHADER = dict(name='none',is_shader=True,shad_type='-',param_number=4,path='-')
|
||||||
|
|
||||||
|
MAX_MOD_SLOTS = 4
|
||||||
|
|
||||||
def __init__(self, root, osc_client, message_handler, data):
|
def __init__(self, root, osc_client, message_handler, data):
|
||||||
self.root = root
|
self.root = root
|
||||||
self.osc_client = osc_client
|
self.osc_client = osc_client
|
||||||
@@ -25,7 +28,7 @@ class Shaders(object):
|
|||||||
|
|
||||||
self.selected_modulation_slot = 0
|
self.selected_modulation_slot = 0
|
||||||
#self.modulation_level = [[[0.0,0.0,0.0,0.0] for i in range(4)] for i in range(3)]
|
#self.modulation_level = [[[0.0,0.0,0.0,0.0] for i in range(4)] for i in range(3)]
|
||||||
self.modulation_value = [0.0,0.0,0.0,0.0]
|
self.modulation_value = [0.0] * self.MAX_MOD_SLOTS #,0.0,0.0,0.0]
|
||||||
|
|
||||||
#self.load_selected_shader()
|
#self.load_selected_shader()
|
||||||
|
|
||||||
@@ -177,6 +180,16 @@ class Shaders(object):
|
|||||||
def select_shader_modulation_slot(self, slot):
|
def select_shader_modulation_slot(self, slot):
|
||||||
self.selected_modulation_slot = slot
|
self.selected_modulation_slot = slot
|
||||||
|
|
||||||
|
def select_next_shader_modulation_slot(self):
|
||||||
|
self.selected_modulation_slot += 1
|
||||||
|
if self.selected_modulation_slot >= self.MAX_MOD_SLOTS:
|
||||||
|
self.selected_modulation_slot = 0
|
||||||
|
|
||||||
|
def select_previous_shader_modulation_slot(self):
|
||||||
|
self.selected_modulation_slot -= 1
|
||||||
|
if self.selected_modulation_slot < 0:
|
||||||
|
self.selected_modulation_slot = self.MAX_MOD_SLOTS-1
|
||||||
|
|
||||||
def reset_modulation(self, slot):
|
def reset_modulation(self, slot):
|
||||||
for layer in self.modulation_level:
|
for layer in self.modulation_level:
|
||||||
for layer,levels in enumerate(layer):
|
for layer,levels in enumerate(layer):
|
||||||
|
|||||||
Reference in New Issue
Block a user