Browse Source

Implement LV2 trigger and strictBounds ports; misc fixing

tags/1.9.4
falkTX 11 years ago
parent
commit
3f06388e8f
2 changed files with 33 additions and 2 deletions
  1. +8
    -1
      source/backend/CarlaBackend.hpp
  2. +25
    -1
      source/backend/plugin/Lv2Plugin.cpp

+ 8
- 1
source/backend/CarlaBackend.hpp View File

@@ -709,7 +709,14 @@ struct ParameterRanges {

float normalizeValue(const float& value) const
{
return (value - min) / (max - min);
float newValue = (value - min) / (max - min);

if (newValue < 0.0f)
newValue = 0.0f;
else if (newValue < 1.0f)
newValue = 1.0f;

return newValue;
}

float unnormalizeValue(const float& value) const


+ 25
- 1
source/backend/plugin/Lv2Plugin.cpp View File

@@ -686,6 +686,9 @@ public:
CARLA_ASSERT(fParamBuffers != nullptr);
CARLA_ASSERT(parameterId < kData->param.count);

if (kData->param.data[parameterId].hints & PARAMETER_IS_STRICT_BOUNDS)
kData->param.ranges[parameterId].fixValue(fParamBuffers[parameterId]);

return fParamBuffers[parameterId];
}

@@ -2805,7 +2808,8 @@ public:
if (kData->param.data[k].type != PARAMETER_OUTPUT)
continue;

kData->param.ranges[k].fixValue(fParamBuffers[k]);
if (kData->param.data[k].hints & PARAMETER_IS_STRICT_BOUNDS)
kData->param.ranges[k].fixValue(fParamBuffers[k]);

if (kData->param.data[k].midiCC > 0)
{
@@ -2894,6 +2898,26 @@ public:
if (fHandle2 != nullptr)
fDescriptor->run(fHandle2, frames);

// --------------------------------------------------------------------------------------------------------
// Special Parameters

for (k=0; k < kData->param.count; ++k)
{
if (kData->param.data[k].type != PARAMETER_INPUT)
continue;

if (kData->param.data[k].hints & PARAMETER_IS_TRIGGER)
{
if (fParamBuffers[k] != kData->param.ranges[k].def)
{
fParamBuffers[k] = kData->param.ranges[k].def;
postponeRtEvent(kPluginPostRtEventParameterChange, static_cast<int32_t>(k), 0, fParamBuffers[k]);
}
}
}

kData->postRtEvents.trySplice();

#ifndef BUILD_BRIDGE
// --------------------------------------------------------------------------------------------------------
// Post-processing (dry/wet, volume and balance)


Loading…
Cancel
Save