libAlgAudio
v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
|
#include <Module.hpp>
Classes | |
class | Inlet |
class | Outlet |
Public Member Functions | |
virtual std::shared_ptr < ModuleGUI > | BuildGUI (std::shared_ptr< Window > parent_window) |
LateReturn | CreateIOFromTemplate (bool fake=false) |
void | DropGUI () |
std::shared_ptr< ModuleGUI > | GetGUI () const |
std::shared_ptr< Inlet > | GetInletByID (std::string id) const |
std::shared_ptr< Outlet > | GetOutletByID (std::string id) const |
std::shared_ptr< ParamController > | GetParamControllerByID (std::string) const |
Module (const Module &other)=delete | |
virtual void | on_destroy () |
virtual void | on_gui_build (std::shared_ptr< ModuleGUI >) |
virtual void | on_init () |
virtual LateReturn | on_init_latereturn () |
virtual void | on_param_set (std::string, float) |
void | PrepareParamControllers () |
void | ResetControllers () |
virtual void | state_load_string (std::string) |
virtual void | state_load_xml (rapidxml::xml_node< char > *) |
virtual std::string | state_store_string () const |
virtual void | state_store_xml (rapidxml::xml_node< char > *) const |
virtual | ~Module () |
Module () | |
Module (void(*deleter)(void *)) | |
Module (std::shared_ptr< ModuleTemplate > t) | |
Public Member Functions inherited from AlgAudio::DynamicallyLoadableClass | |
DynamicallyLoadableClass (void(*d)(void *)) | |
DynamicallyLoadableClass () | |
void | SelfDestruct () |
void | SetDeleter (void(*d)(void *)) |
virtual | ~DynamicallyLoadableClass () |
Public Attributes | |
std::weak_ptr< Canvas > | canvas |
bool | enabled_by_factory = false |
std::vector< std::shared_ptr < Inlet > > | inlets |
std::vector< std::shared_ptr < Outlet > > | outlets |
std::vector< std::shared_ptr < ParamController > > | param_controllers |
Point2D | position_in_canvas |
std::vector< std::shared_ptr < SendReplyController > > | reply_controllers |
int | sc_id = -1 |
std::shared_ptr< ModuleTemplate > | templ |
Public Attributes inherited from AlgAudio::SubscriptionsManager | |
SubscriptionList | subscriptions |
Public Attributes inherited from AlgAudio::TimerHandleManager | |
TimerHandleList | timerhandles |
Protected Attributes | |
std::shared_ptr< ModuleGUI > | modulegui |
This is the module, the main class that represents any module instance. It is intended to:
|
inline |
You don't usually this constructor. Create a module instance using ModuleFactory instead, this will ensure proper initialisation.
|
inline |
You don't usually this constructor. Create a module instance using ModuleFactory instead, this will ensure proper initialisation.
|
inline |
You don't usually this constructor. Create a module instance using ModuleFactory instead, this will ensure proper initialisation.
|
delete |
No copy constructing.
|
virtual |
|
virtual |
This function is used to create a new ModuleGUI that will represent this module instance in a CanvasView. Custom modules can override this function with anything they desire, as long as it returns any ModuleGUI. It can be a custom class that derives from ModuleGUI. However, there is no necessity to override this method - the default implementation will create the GUI hierarchy according to the description from collection XML. The only argument to this function is the value of "type" attribute of xml's "gui" node. Whoever calls this function claims the ownership of the returned pointer, it will not be owned by the module instance.
LateReturn AlgAudio::Module::CreateIOFromTemplate | ( | bool | fake = false | ) |
Creates and allocates Inlets and Outlets for this instance, according to the data in template info.
|
inline |
std::shared_ptr<ModuleGUI> AlgAudio::Module::GetGUI | ( | ) | const |
Returns a reference to the ModuleGUI that represents this particular module instance. If the GUI was not yet build, or was already deleted, this function will return nullptr.
std::shared_ptr<Inlet > AlgAudio::Module::GetInletByID | ( | std::string | id | ) | const |
Returns inlets by their ID.
std::shared_ptr<Outlet> AlgAudio::Module::GetOutletByID | ( | std::string | id | ) | const |
Returns outlets by their ID.
std::shared_ptr<ParamController> AlgAudio::Module::GetParamControllerByID | ( | std::string | ) | const |
Returns a ParamController by given ID.
|
inlinevirtual |
Reimplemented in AlgAudio::Builtin::Subpatch.
|
inlinevirtual |
This method will be called when the module GUI is ready to be displayed. If you wish to modify the GUI but do not want to override BuildGUI with custom builder, you override on_gui_build and modify the UI from there.
Reimplemented in AlgAudio::Builtin::Subpatch.
|
inlinevirtual |
Custom module implementations will prefer to override on_init and on_destroy, instead of creating a custom constructor/destructor. on_init is guaranteed to run when the module is ready to work - the corresponding SC instance was created etc. Similarly, on_destroy is called before the SC instance is removed, while the buses still exist etc.
Reimplemented in AlgAudio::Builtin::SubpatchEntrance.
|
inlinevirtual |
Reimplemented in AlgAudio::Builtin::SubpatchExit, and AlgAudio::Builtin::Subpatch.
|
inlinevirtual |
This method is used for params defined with action="custom" attribute.
void AlgAudio::Module::PrepareParamControllers | ( | ) |
void AlgAudio::Module::ResetControllers | ( | ) |
Sets all controllers to default values
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in AlgAudio::Builtin::Subpatch.
|
inlinevirtual |
These methods are used for storing and loading internal module state. They are mostly used when a canvas is saved, or when a module is copied to clipboard. State loading will never happen before on_init.
|
inlinevirtual |
Reimplemented in AlgAudio::Builtin::Subpatch.
std::weak_ptr<Canvas> AlgAudio::Module::canvas |
The canvas this module belongs to.
bool AlgAudio::Module::enabled_by_factory = false |
This flag marks whether this module was initialized by ModuleFactory. When ModuleFactory destoys a module, this flag is set back to false. This way it's easy to detect whether the module was correctly created, and when it's destructed witout havning been destroyed by the factory.
std::vector<std::shared_ptr<Inlet> > AlgAudio::Module::inlets |
|
protected |
std::vector<std::shared_ptr<Outlet> > AlgAudio::Module::outlets |
std::vector<std::shared_ptr<ParamController> > AlgAudio::Module::param_controllers |
Point2D AlgAudio::Module::position_in_canvas |
This variable stores the widget position in canvas.
std::vector<std::shared_ptr<SendReplyController> > AlgAudio::Module::reply_controllers |
int AlgAudio::Module::sc_id = -1 |
The id of the supercollider synth instance this Module represents and manages.
std::shared_ptr<ModuleTemplate> AlgAudio::Module::templ |