|
@@ -341,8 +341,13 @@ public: |
|
|
Q_ASSERT(handle); |
|
|
Q_ASSERT(handle); |
|
|
Q_ASSERT(parameterId < param.count); |
|
|
Q_ASSERT(parameterId < param.count); |
|
|
|
|
|
|
|
|
if (descriptor && handle) |
|
|
|
|
|
descriptor->set_parameter_value(handle, parameterId, fixParameterValue(value, param.ranges[parameterId])); |
|
|
|
|
|
|
|
|
if (descriptor) |
|
|
|
|
|
{ |
|
|
|
|
|
fixParameterValue(value, param.ranges[parameterId]); |
|
|
|
|
|
|
|
|
|
|
|
descriptor->set_parameter_value(handle, parameterId, value); |
|
|
|
|
|
if (h2) descriptor->set_parameter_value(h2, parameterId, value); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
CarlaPlugin::setParameterValue(parameterId, value, sendGui, sendOsc, sendCallback); |
|
|
CarlaPlugin::setParameterValue(parameterId, value, sendGui, sendOsc, sendCallback); |
|
|
} |
|
|
} |
|
@@ -364,8 +369,11 @@ public: |
|
|
if (! value) |
|
|
if (! value) |
|
|
return qCritical("Nativelugin::setCustomData(%s, \"%s\", \"%s\", %s) - value is null", CustomDataType2str(type), key, value, bool2str(sendGui)); |
|
|
return qCritical("Nativelugin::setCustomData(%s, \"%s\", \"%s\", %s) - value is null", CustomDataType2str(type), key, value, bool2str(sendGui)); |
|
|
|
|
|
|
|
|
if (descriptor && handle) |
|
|
|
|
|
|
|
|
if (descriptor) |
|
|
|
|
|
{ |
|
|
descriptor->set_custom_data(handle, key, value); |
|
|
descriptor->set_custom_data(handle, key, value); |
|
|
|
|
|
if (h2) descriptor->set_custom_data(h2, key, value); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
CarlaPlugin::setCustomData(type, key, value, sendGui); |
|
|
CarlaPlugin::setCustomData(type, key, value, sendGui); |
|
|
} |
|
|
} |
|
@@ -387,11 +395,13 @@ public: |
|
|
{ |
|
|
{ |
|
|
const CarlaEngine::ScopedLocker m(x_engine, block); |
|
|
const CarlaEngine::ScopedLocker m(x_engine, block); |
|
|
descriptor->set_midi_program(handle, midiprog.data[index].bank, midiprog.data[index].program); |
|
|
descriptor->set_midi_program(handle, midiprog.data[index].bank, midiprog.data[index].program); |
|
|
|
|
|
if (h2) descriptor->set_midi_program(h2, midiprog.data[index].bank, midiprog.data[index].program); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
const ScopedDisabler m(this, block); |
|
|
const ScopedDisabler m(this, block); |
|
|
descriptor->set_midi_program(handle, midiprog.data[index].bank, midiprog.data[index].program); |
|
|
descriptor->set_midi_program(handle, midiprog.data[index].bank, midiprog.data[index].program); |
|
|
|
|
|
if (h2) descriptor->set_midi_program(h2, midiprog.data[index].bank, midiprog.data[index].program); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -444,6 +454,9 @@ public: |
|
|
const double sampleRate = x_engine->getSampleRate(); |
|
|
const double sampleRate = x_engine->getSampleRate(); |
|
|
const uint32_t portCount = descriptor->portCount; |
|
|
const uint32_t portCount = descriptor->portCount; |
|
|
|
|
|
|
|
|
|
|
|
bool forcedStereoIn, forcedStereoOut; |
|
|
|
|
|
forcedStereoIn = forcedStereoOut = false; |
|
|
|
|
|
|
|
|
for (uint32_t i=0; i < portCount; i++) |
|
|
for (uint32_t i=0; i < portCount; i++) |
|
|
{ |
|
|
{ |
|
|
const PortType portType = descriptor->ports[i].type; |
|
|
const PortType portType = descriptor->ports[i].type; |
|
@@ -467,6 +480,23 @@ public: |
|
|
params += 1; |
|
|
params += 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (carlaOptions.forceStereo && (aIns == 1 || aOuts == 1) && mIns <= 1 && mOuts <= 1 && ! h2) |
|
|
|
|
|
{ |
|
|
|
|
|
h2 = descriptor->instantiate((struct _PluginDescriptor*)descriptor, &host); |
|
|
|
|
|
|
|
|
|
|
|
if (aIns == 1) |
|
|
|
|
|
{ |
|
|
|
|
|
aIns = 2; |
|
|
|
|
|
forcedStereoIn = true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (aOuts == 1) |
|
|
|
|
|
{ |
|
|
|
|
|
aOuts = 2; |
|
|
|
|
|
forcedStereoOut = true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (aIns > 0) |
|
|
if (aIns > 0) |
|
|
{ |
|
|
{ |
|
|
aIn.ports = new CarlaEngineAudioPort*[aIns]; |
|
|
aIn.ports = new CarlaEngineAudioPort*[aIns]; |
|
@@ -527,12 +557,26 @@ public: |
|
|
aOut.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); |
|
|
aOut.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); |
|
|
aOut.rindexes[j] = i; |
|
|
aOut.rindexes[j] = i; |
|
|
needsCtrlIn = true; |
|
|
needsCtrlIn = true; |
|
|
|
|
|
|
|
|
|
|
|
if (forcedStereoOut) |
|
|
|
|
|
{ |
|
|
|
|
|
strcat(portName, "_"); |
|
|
|
|
|
aOut.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, false); |
|
|
|
|
|
aOut.rindexes[1] = i; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
j = aIn.count++; |
|
|
j = aIn.count++; |
|
|
aIn.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); |
|
|
aIn.ports[j] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); |
|
|
aIn.rindexes[j] = i; |
|
|
aIn.rindexes[j] = i; |
|
|
|
|
|
|
|
|
|
|
|
if (forcedStereoIn) |
|
|
|
|
|
{ |
|
|
|
|
|
strcat(portName, "_"); |
|
|
|
|
|
aIn.ports[1] = (CarlaEngineAudioPort*)x_client->addPort(CarlaEnginePortTypeAudio, portName, true); |
|
|
|
|
|
aIn.rindexes[1] = i; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else if (portType == PORT_TYPE_MIDI) |
|
|
else if (portType == PORT_TYPE_MIDI) |
|
@@ -993,13 +1037,13 @@ public: |
|
|
if (descriptor->deactivate) |
|
|
if (descriptor->deactivate) |
|
|
{ |
|
|
{ |
|
|
descriptor->deactivate(handle); |
|
|
descriptor->deactivate(handle); |
|
|
//if (h2) ldescriptor->deactivate(h2); |
|
|
|
|
|
|
|
|
if (h2) descriptor->deactivate(h2); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (descriptor->activate) |
|
|
if (descriptor->activate) |
|
|
{ |
|
|
{ |
|
|
descriptor->activate(handle); |
|
|
descriptor->activate(handle); |
|
|
//if (h2) ldescriptor->activate(h2); |
|
|
|
|
|
|
|
|
if (h2) descriptor->activate(h2); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
allNotesOffSent = true; |
|
|
allNotesOffSent = true; |
|
@@ -1175,13 +1219,20 @@ public: |
|
|
if (descriptor->activate) |
|
|
if (descriptor->activate) |
|
|
{ |
|
|
{ |
|
|
descriptor->activate(handle); |
|
|
descriptor->activate(handle); |
|
|
//if (h2) descriptor->activate(h2); |
|
|
|
|
|
|
|
|
if (h2) descriptor->activate(h2); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
isProcessing = true; |
|
|
isProcessing = true; |
|
|
descriptor->process(handle, inBuffer, outBuffer, frames, midiEventCountBefore, midiEvents); |
|
|
|
|
|
//if (h2) descriptor->process(h2, inBuffer, outBuffer, frames, midiEventCount, midiEvents); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (h2) |
|
|
|
|
|
{ |
|
|
|
|
|
descriptor->process(handle, inBuffer? &inBuffer[0] : nullptr, outBuffer? &outBuffer[0] : nullptr, frames, midiEventCountBefore, midiEvents); |
|
|
|
|
|
descriptor->process(h2, inBuffer? &inBuffer[1] : nullptr, outBuffer? &outBuffer[1] : nullptr, frames, midiEventCountBefore, midiEvents); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
descriptor->process(handle, inBuffer, outBuffer, frames, midiEventCountBefore, midiEvents); |
|
|
|
|
|
|
|
|
isProcessing = false; |
|
|
isProcessing = false; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
@@ -1191,7 +1242,7 @@ public: |
|
|
if (descriptor->deactivate) |
|
|
if (descriptor->deactivate) |
|
|
{ |
|
|
{ |
|
|
descriptor->deactivate(handle); |
|
|
descriptor->deactivate(handle); |
|
|
//if (h2) descriptor->deactivate(h2); |
|
|
|
|
|
|
|
|
if (h2) descriptor->deactivate(h2); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|