mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-11 19:00:04 +01:00
AutomationSourcePlugin type, to enable recording of WJ params to automation clips (featured in feature_plugin_shader_gadgets)
This commit is contained in:
@@ -221,6 +221,7 @@ class DisplayPlugin(Plugin):
|
||||
#display_text.insert(END, 'test from DisplayPlugin')
|
||||
display.display_text.insert(END, '{} \n'.format(display.body_title))
|
||||
|
||||
|
||||
class ModulationReceiverPlugin(Plugin):
|
||||
def __init__(self, plugin_collection):
|
||||
super().__init__(plugin_collection)
|
||||
@@ -230,6 +231,24 @@ class ModulationReceiverPlugin(Plugin):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class AutomationSourcePlugin(Plugin):
|
||||
@property
|
||||
def frame_key(self):
|
||||
return self.__class__.__name__
|
||||
|
||||
def __init__(self, plugin_collection):
|
||||
super().__init__(plugin_collection)
|
||||
|
||||
def get_frame_data(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def recall_frame_data(self, data):
|
||||
raise NotImplementedError
|
||||
|
||||
def get_frame_diff(self, last_frame, current_frame):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
# adapted from https://github.com/gdiepen/python_plugin_example
|
||||
class PluginCollection(object):
|
||||
"""Upon creation, this class will read the plugins package for modules
|
||||
@@ -303,7 +322,7 @@ class PluginCollection(object):
|
||||
for (_, c) in clsmembers:
|
||||
# Only add classes that are a sub class of Plugin, but NOT Plugin itself
|
||||
# or one of the base classes
|
||||
ignore_list = [ Plugin, ActionsPlugin, SequencePlugin, MidiFeedbackPlugin, DisplayPlugin, ModulationReceiverPlugin ]
|
||||
ignore_list = [ Plugin, ActionsPlugin, SequencePlugin, MidiFeedbackPlugin, DisplayPlugin, ModulationReceiverPlugin, AutomationSourcePlugin ]
|
||||
if issubclass(c, Plugin) & (c not in ignore_list):
|
||||
print(' Found plugin class: %s.%s' % (c.__module__,c.__name__))
|
||||
self.plugins.append(c(self))
|
||||
|
||||
Reference in New Issue
Block a user