TestExpander.hpp (1430B)
1 #pragma once 2 3 #include "bogaudio.hpp" 4 #include "expanders.hpp" 5 6 extern Model* modelTestExpanderBase; 7 extern Model* modelTestExpanderExtension; 8 9 namespace bogaudio { 10 11 struct TestExpanderMessage : ExpanderMessage { 12 float sample[BGModule::maxChannels] {}; 13 }; 14 15 struct TestExpanderExtension; 16 17 struct TestExpanderBase : ExpandableModule<TestExpanderMessage, BGModule> { 18 enum ParamsIds { 19 NUM_PARAMS 20 }; 21 22 enum InputsIds { 23 IN_INPUT, 24 NUM_INPUTS 25 }; 26 27 enum OutputsIds { 28 OUT_OUTPUT, 29 NUM_OUTPUTS 30 }; 31 32 enum LightsIds { 33 COM_LIGHT, 34 NUM_LIGHTS 35 }; 36 37 TestExpanderBase() { 38 config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); 39 setExpanderModelPredicate([](Model* m) { return m == modelTestExpanderExtension; }); 40 } 41 42 int channels() override; 43 void processAll(const ProcessArgs& args) override; 44 void processChannel(const ProcessArgs& args, int c) override; 45 }; 46 47 struct TestExpanderExtension : ExpanderModule<TestExpanderMessage, BGModule> { 48 enum ParamsIds { 49 NUM_PARAMS 50 }; 51 52 enum InputsIds { 53 NUM_INPUTS 54 }; 55 56 enum OutputsIds { 57 OUT_OUTPUT, 58 NUM_OUTPUTS 59 }; 60 61 enum LightsIds { 62 COM_LIGHT, 63 NUM_LIGHTS 64 }; 65 66 TestExpanderExtension() { 67 config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); 68 setBaseModelPredicate([](Model* m) { return m == modelTestExpanderBase; }); 69 } 70 71 void processAll(const ProcessArgs& args) override; 72 void processChannel(const ProcessArgs& args, int c) override; 73 }; 74 75 } // namespace bogaudio