Tests to fetch info from module

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2021-10-31 09:46:36 +00:00
parent 9d7221dd50
commit ff5f9f6285
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
3 changed files with 36 additions and 1 deletions

View file

@ -112,6 +112,7 @@ BUILD_FILES += ../src/Rack/src/logger.cpp
BUILD_FILES += ../src/Rack/src/random.cpp
BUILD_FILES += ../src/Rack/src/string.cpp
BUILD_FILES += ../src/Rack/src/system.cpp
BUILD_FILES += ../src/Rack/src/tinyexpr.c
BUILD_FILES += ../src/Rack/src/Quantity.cpp
BUILD_FILES += ../src/Rack/src/engine/Module.cpp
BUILD_FILES += ../src/Rack/src/engine/ParamQuantity.cpp

View file

@ -168,6 +168,13 @@ void SvgSlider::onChange(const ChangeEvent& e) {}
}
namespace engine {
std::string LightInfo::getName() { return name; }
std::string LightInfo::getDescription() { return description; }
}
namespace widget {
FramebufferWidget::FramebufferWidget() {}

View file

@ -79,7 +79,34 @@ int main()
Plugin* const p = new Plugin;
pluginInstance__Befaco = p;
p->addModel(modelSpringReverb);
engine::Module* module = modelSpringReverb->createModule();
d_stdout("modelSpringReverb is %p", modelSpringReverb);
d_stdout("modelSpringReverb is %p %p", modelSpringReverb, module);
d_stdout("modelSpringReverb has %d ins, %d outs, %d lights, %d params",
module->getNumInputs(), module->getNumOutputs(), module->getNumLights(), module->getNumParams());
for (int i=0; i<module->getNumInputs(); ++i)
d_stdout(" in %d has name '%s'; description '%s'",
i+1, module->getInputInfo(i)->getFullName().c_str(), module->getInputInfo(i)->getDescription().c_str());
for (int i=0; i<module->getNumOutputs(); ++i)
d_stdout(" out %d has name '%s'; description '%s'",
i+1, module->getOutputInfo(i)->getFullName().c_str(), module->getOutputInfo(i)->getDescription().c_str());
// for (int i=0; i<module->getNumLights(); ++i)
// {
// LightInfo* l = module->getLightInfo(i);
// DISTRHO_SAFE_ASSERT_CONTINUE(l != nullptr);
// d_stdout(" light %d has name '%s'; description '%s'",
// i+1, l->getName().c_str(), l->getDescription().c_str());
// }
for (int i=0; i<module->getNumParams(); ++i)
{
ParamQuantity* q = module->getParamQuantity(i);
d_stdout(" param %d has name '%s'; description '%s'; unit '%s'; min %f; max %f; def %f",
i+1, q->name.c_str(), q->getDescription().c_str(), q->unit.c_str(),
q->minValue, q->maxValue, q->defaultValue);
}
return 0;
}