Browse Source

Implement parameter groups for VST2 plugins (carla implementation)

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.3.1
falkTX 3 years ago
parent
commit
8eba3f67b4
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 25 additions and 3 deletions
  1. +25
    -3
      source/backend/plugin/CarlaPluginVST2.cpp

+ 25
- 3
source/backend/plugin/CarlaPluginVST2.cpp View File

@@ -321,10 +321,11 @@ public:
VstParameterProperties prop; VstParameterProperties prop;
carla_zeroStruct(prop); carla_zeroStruct(prop);


if (dispatcher(effGetParameterProperties, static_cast<int32_t>(parameterId), 0, &prop) == 1 && prop.label[0] != '\0')
if (dispatcher(effGetParameterProperties, static_cast<int32_t>(parameterId), 0, &prop) == 1
&& prop.label[0] != '\0')
{ {
std::strncpy(strBuf, prop.label, 64);
strBuf[64] = '\0';
std::strncpy(strBuf, prop.label, VestigeMaxLabelLen);
strBuf[VestigeMaxLabelLen] = '\0';
return true; return true;
} }


@@ -357,6 +358,27 @@ public:
return true; return true;
} }


bool getParameterGroupName(const uint32_t parameterId, char* const strBuf) const noexcept override
{
CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr, false);
CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count, false);

strBuf[0] = '\0';

VstParameterProperties prop;
carla_zeroStruct(prop);

if (dispatcher(effGetParameterProperties, static_cast<int32_t>(parameterId), 0, &prop) == 1
&& prop.category != 0 && prop.categoryLabel[0] != '\0')
{
std::snprintf(strBuf, STR_MAX, "%d:%s", prop.category, prop.categoryLabel);
return true;
}

strBuf[0] = '\0';
return true;
}

// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Set data (state) // Set data (state)




Loading…
Cancel
Save