Browse Source

Carla: Fix parameter ports under native API

tags/v0.9.0
falkTX 13 years ago
parent
commit
c80cb48d46
2 changed files with 16 additions and 3 deletions
  1. +2
    -2
      c++/carla-backend/carla_native.cpp
  2. +14
    -1
      c++/carla-backend/plugins/carla_nativemm.h

+ 2
- 2
c++/carla-backend/carla_native.cpp View File

@@ -371,8 +371,8 @@ public:
{ {
fixParameterValue(value, param.ranges[parameterId]); fixParameterValue(value, param.ranges[parameterId]);


descriptor->set_parameter_value(handle, parameterId, value);
if (h2) descriptor->set_parameter_value(h2, parameterId, value);
descriptor->set_parameter_value(handle, param.data[parameterId].rindex, value);
if (h2) descriptor->set_parameter_value(h2, param.data[parameterId].rindex, value);
} }


CarlaPlugin::setParameterValue(parameterId, value, sendGui, sendOsc, sendCallback); CarlaPlugin::setParameterValue(parameterId, value, sendGui, sendOsc, sendCallback);


+ 14
- 1
c++/carla-backend/plugins/carla_nativemm.h View File

@@ -176,7 +176,7 @@ protected:
return nullptr; return nullptr;
} }


virtual void getParameterRanges(uint32_t index, ParameterRanges* ranges)
virtual void getParameterRanges(uint32_t index, ParameterRanges* const ranges)
{ {
CARLA_ASSERT(index < getPortCount()); CARLA_ASSERT(index < getPortCount());
CARLA_ASSERT(ranges); CARLA_ASSERT(ranges);
@@ -400,6 +400,9 @@ private:
port->type = getPortType(i); port->type = getPortType(i);
port->hints = getPortHints(i); port->hints = getPortHints(i);
port->name = getPortName(i); port->name = getPortName(i);

port->scalePointCount = 0;
port->scalePoints = nullptr;
} }
} }
} }
@@ -407,7 +410,17 @@ private:
void _handleFini() void _handleFini()
{ {
if (desc.portCount > 0 && desc.ports) if (desc.portCount > 0 && desc.ports)
{
for (uint32_t i=0; i < desc.portCount; i++)
{
PluginPort* const port = &desc.ports[i];

if (port->scalePointCount > 0 && port->scalePoints)
delete[] port->scalePoints;
}

delete[] desc.ports; delete[] desc.ports;
}


desc.portCount = 0; desc.portCount = 0;
desc.ports = nullptr; desc.ports = nullptr;


Loading…
Cancel
Save