From 69fc690290a0b0d2782e3197d97d4c3e8bfeb8c1 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 8 May 2021 18:19:43 -0400 Subject: [PATCH] Add getter methods to Module. --- include/engine/Module.hpp | 43 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/include/engine/Module.hpp b/include/engine/Module.hpp index 0acc9575..07008234 100644 --- a/include/engine/Module.hpp +++ b/include/engine/Module.hpp @@ -45,7 +45,7 @@ struct Module { std::vector outputs; std::vector lights; - /** Arrays of components. + /** Arrays of component metadata. Initialized with configParam(), configInput(), configOutput(), and configLight(). LightInfos are initialized to null unless configLight() is called. */ @@ -233,6 +233,47 @@ struct Module { /** Number of audio samples since the Engine's first sample. */ int64_t frame; }; + + /** Getters for members */ + plugin::Model* getModel() { + return model; + } + int64_t getId() { + return id; + } + Param& getParam(int index) { + return params[index]; + } + Input& getInput(int index) { + return inputs[index]; + } + Output& getOutput(int index) { + return outputs[index]; + } + Light& getLight(int index) { + return lights[index]; + } + ParamQuantity* getParamQuantity(int index) { + return paramQuantities[index]; + } + PortInfo* getInputInfo(int index) { + return inputInfos[index]; + } + PortInfo* getOutputInfo(int index) { + return outputInfos[index]; + } + LightInfo* getLightInfo(int index) { + return lightInfos[index]; + } + Expander& getLeftExpander() { + return leftExpander; + } + Expander& getRightExpander() { + return rightExpander; + } + + // Virtual methods + /** Advances the module by one audio sample. Override this method to read Inputs and Params and to write Outputs and Lights. */