gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 3cd85f8956fff7f3f02fbe4eaf24cb7819440ff1
parent c0a21cb853a2d3e6b81c69aaff6fb8e32a46c38f
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sun, 13 Mar 2022 01:43:27 +0100

retrieve parameter type by name

Diffstat:
Msource/jucePlugin/VirusController.cpp | 12++++++++++++
Msource/jucePlugin/VirusController.h | 2++
Msource/jucePlugin/VirusParameterDescription.h | 2++
3 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/source/jucePlugin/VirusController.cpp b/source/jucePlugin/VirusController.cpp @@ -540,6 +540,18 @@ namespace Virus LOG((ss.str())); } + ParameterType Controller::getParameterTypeByName(const std::string& _name) const + { + for(size_t i=0; i<m_descriptions.getDescriptions().size(); ++i) + { + const auto& description = m_descriptions.getDescriptions()[i]; + if(description.name.toStdString() == _name) + return static_cast<ParameterType>(i); + } + + return Param_Invalid; + } + void Controller::sendSysEx(const SysEx &msg) const { synthLib::SMidiEvent ev; diff --git a/source/jucePlugin/VirusController.h b/source/jucePlugin/VirusController.h @@ -34,6 +34,8 @@ namespace Virus void printMessage(const SysEx &) const; + ParameterType getParameterTypeByName(const std::string& _name) const; + // currently Value as I figure out what's the best approach // ch - [0-15] // bank - [0-2] (ABC) diff --git a/source/jucePlugin/VirusParameterDescription.h b/source/jucePlugin/VirusParameterDescription.h @@ -11,6 +11,8 @@ namespace Virus { enum ParameterType { + Param_Invalid = -1, + Param_BankSelect, Param_ModWheel, Param_BreathControl,