mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-12 03:10:17 +01:00
Display page for ShaderLoopRecordPlugin showing playing/rec/loop/overdub status, position, enabled clips, speed, duration. midi binding in apc config to adjust clip speed when on this page
This commit is contained in:
@@ -43,7 +43,8 @@
|
|||||||
"DEFAULT": ["set_the_shader_param_0_layer_offset_0_continuous","set_strobe_amount_continuous"],
|
"DEFAULT": ["set_the_shader_param_0_layer_offset_0_continuous","set_strobe_amount_continuous"],
|
||||||
"NAV_DETOUR": ["set_detour_speed_position_continuous"],
|
"NAV_DETOUR": ["set_detour_speed_position_continuous"],
|
||||||
"WJMXSEND": ["wj_set_position_N_x"],
|
"WJMXSEND": ["wj_set_position_N_x"],
|
||||||
"MANIPULA": ["set_variable_A"]
|
"MANIPULA": ["set_variable_A"],
|
||||||
|
"LOOPREC": ["set_automation_speed"]
|
||||||
},
|
},
|
||||||
"control_change 49": {
|
"control_change 49": {
|
||||||
"DEFAULT": ["set_the_shader_param_1_layer_offset_0_continuous","set_shader_speed_layer_0_amount"],
|
"DEFAULT": ["set_the_shader_param_1_layer_offset_0_continuous","set_shader_speed_layer_0_amount"],
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import data_centre.plugin_collection
|
import data_centre.plugin_collection
|
||||||
from data_centre.plugin_collection import ActionsPlugin, SequencePlugin
|
from data_centre.plugin_collection import ActionsPlugin, SequencePlugin, DisplayPlugin
|
||||||
from plugins.frame_manager import Frame
|
from plugins.frame_manager import Frame
|
||||||
|
|
||||||
class ShaderLoopRecordPlugin(ActionsPlugin,SequencePlugin):
|
class ShaderLoopRecordPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin):
|
||||||
disabled = False
|
disabled = False
|
||||||
MAX_CLIPS = 8
|
MAX_CLIPS = 8
|
||||||
frames = []
|
frames = []
|
||||||
@@ -58,6 +58,46 @@ class ShaderLoopRecordPlugin(ActionsPlugin,SequencePlugin):
|
|||||||
def save_presets(self):
|
def save_presets(self):
|
||||||
self.pc.update_json(self.PRESET_FILE_NAME, self.frames)
|
self.pc.update_json(self.PRESET_FILE_NAME, self.frames)
|
||||||
|
|
||||||
|
def get_display_modes(self):
|
||||||
|
return ['LOOPREC','NAV_LP']
|
||||||
|
|
||||||
|
def show_plugin(self, display, display_mode):
|
||||||
|
from tkinter import Text, END
|
||||||
|
#super(DisplayPlugin).show_plugin(display, display_mode)
|
||||||
|
display.display_text.insert(END, '{} \n'.format(display.body_title))
|
||||||
|
display.display_text.insert(END, "test from ShaderLoopRecordPlugin!\n")
|
||||||
|
status = ""
|
||||||
|
status+="playing" if self.is_playing() else "stopped"
|
||||||
|
status+="\t"
|
||||||
|
status+="paused" if self.is_paused() else "unpaused"
|
||||||
|
status+="\t"
|
||||||
|
status+="REC" if self.recording else "---"
|
||||||
|
status+="*" if self.is_ignoring() else " "
|
||||||
|
status+="\t"
|
||||||
|
status+="Overdub" if self.overdub else "-------"
|
||||||
|
status+="\t"
|
||||||
|
status+="Looping" if self.looping else "Once"
|
||||||
|
status+="\n"
|
||||||
|
|
||||||
|
display.display_text.insert(END, status)
|
||||||
|
display.display_text.insert(END, ("Position:\t{:03.2f}%\t[{:15s}]".format(self.position,("#"*int(self.position*15)))))
|
||||||
|
display.display_text.insert(END, (" Speed: {:03.2f}%\n".format(self.speed)))
|
||||||
|
display.display_text.insert(END, ("Duration:\t{:03.2f}s\n".format(((self.duration/1000)/self.speed)/4)))
|
||||||
|
#distance s = d/t d = s*t t = d/s
|
||||||
|
|
||||||
|
status = "\nEnabled clips:\t"
|
||||||
|
for i in range(0,self.MAX_CLIPS):
|
||||||
|
status+="#" if i==self.selected_clip and i in self.running_clips else\
|
||||||
|
"/" if i==self.selected_clip and i not in self.running_clips else\
|
||||||
|
"=" if i in self.running_clips else\
|
||||||
|
'_'
|
||||||
|
status += "\n"
|
||||||
|
display.display_text.insert(END, status)
|
||||||
|
|
||||||
|
"""for key,value in self.variables.items():
|
||||||
|
display.display_text.insert(END, "\t" + key + "\t{:03.2f}\n".format(value))"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def parserlist(self):
|
def parserlist(self):
|
||||||
@@ -90,7 +130,7 @@ class ShaderLoopRecordPlugin(ActionsPlugin,SequencePlugin):
|
|||||||
self.last_saved_index = None
|
self.last_saved_index = None
|
||||||
self.save_presets()
|
self.save_presets()
|
||||||
|
|
||||||
def get_empty_clip(self, duration = 2000):
|
def get_empty_clip(self, duration = 4000):
|
||||||
return [None] * (int(duration / self.frequency))
|
return [None] * (int(duration / self.frequency))
|
||||||
|
|
||||||
def get_factory_reset(self):
|
def get_factory_reset(self):
|
||||||
@@ -130,7 +170,7 @@ class ShaderLoopRecordPlugin(ActionsPlugin,SequencePlugin):
|
|||||||
selected_clip = 0
|
selected_clip = 0
|
||||||
running_clips = [ ] #False ] * self.MAX_CLIPS
|
running_clips = [ ] #False ] * self.MAX_CLIPS
|
||||||
|
|
||||||
duration = 2000
|
duration = 4000
|
||||||
frequency = 10 #25
|
frequency = 10 #25
|
||||||
recording = False
|
recording = False
|
||||||
overdub = True
|
overdub = True
|
||||||
@@ -142,8 +182,8 @@ class ShaderLoopRecordPlugin(ActionsPlugin,SequencePlugin):
|
|||||||
current_frame_index = int(position * (int(self.duration / self.frequency)))
|
current_frame_index = int(position * (int(self.duration / self.frequency)))
|
||||||
if current_frame_index<0:
|
if current_frame_index<0:
|
||||||
current_frame_index = (self.duration/self.frequency) - current_frame_index
|
current_frame_index = (self.duration/self.frequency) - current_frame_index
|
||||||
if current_frame_index > self.duration/self.frequency:
|
if current_frame_index >= self.duration: # self.duration/self.frequency:
|
||||||
current_frame_index = self.duration/self.frequency
|
current_frame_index = "(self.duration/self.frequency) +""" (current_frame_index%self.duration)
|
||||||
|
|
||||||
if self.DEBUG_FRAMES: print (">>>>>>>>>>>>>>frame at %i%%: %i" % (position*100, current_frame_index))
|
if self.DEBUG_FRAMES: print (">>>>>>>>>>>>>>frame at %i%%: %i" % (position*100, current_frame_index))
|
||||||
#print("got frame index %s" % current_frame_index)
|
#print("got frame index %s" % current_frame_index)
|
||||||
|
|||||||
Reference in New Issue
Block a user