| @@ -546,6 +546,7 @@ public: | |||||
| void setChunkData(const char* const stringData) | void setChunkData(const char* const stringData) | ||||
| { | { | ||||
| Q_ASSERT(m_hints & PLUGIN_USES_CHUNKS); | |||||
| Q_ASSERT(stringData); | Q_ASSERT(stringData); | ||||
| QString filePath; | QString filePath; | ||||
| @@ -1358,7 +1358,7 @@ public: | |||||
| /*! | /*! | ||||
| * Plugin process callback. | * Plugin process callback. | ||||
| */ | */ | ||||
| virtual void process(float* const* const inBuffer, float* const* const outBuffer, const uint32_t frames, const uint32_t framesOffset = 0) | |||||
| virtual void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t framesOffset = 0) | |||||
| { | { | ||||
| Q_UNUSED(inBuffer); | Q_UNUSED(inBuffer); | ||||
| Q_UNUSED(outBuffer); | Q_UNUSED(outBuffer); | ||||
| @@ -210,7 +210,6 @@ void CarlaPluginThread::run() | |||||
| case PLUGIN_THREAD_VST_GUI: | case PLUGIN_THREAD_VST_GUI: | ||||
| /* osc_url */ arguments << QString("%1/%2").arg(engine->getOscServerPath()).arg(plugin->id()); | /* osc_url */ arguments << QString("%1/%2").arg(engine->getOscServerPath()).arg(plugin->id()); | ||||
| /* filename */ arguments << plugin->filename(); | /* filename */ arguments << plugin->filename(); | ||||
| /* label */ arguments << m_label; | |||||
| /* ui-title */ arguments << QString("%1 (GUI)").arg(plugin->name()); | /* ui-title */ arguments << QString("%1 (GUI)").arg(plugin->name()); | ||||
| break; | break; | ||||
| @@ -244,6 +244,7 @@ public: | |||||
| void setChunkData(const char* const stringData) | void setChunkData(const char* const stringData) | ||||
| { | { | ||||
| Q_ASSERT(m_hints & PLUGIN_USES_CHUNKS); | |||||
| Q_ASSERT(stringData); | Q_ASSERT(stringData); | ||||
| static QByteArray chunk; | static QByteArray chunk; | ||||
| @@ -311,9 +312,12 @@ public: | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| osc_send_hide(&osc.data); | |||||
| osc_send_quit(&osc.data); | |||||
| osc_clear_data(&osc.data); | |||||
| if (osc.data.target) | |||||
| { | |||||
| osc_send_hide(&osc.data); | |||||
| osc_send_quit(&osc.data); | |||||
| osc_clear_data(&osc.data); | |||||
| } | |||||
| if (! osc.thread->wait(500)) | if (! osc.thread->wait(500)) | ||||
| osc.thread->quit(); | osc.thread->quit(); | ||||
| @@ -327,6 +331,7 @@ public: | |||||
| void reload() | void reload() | ||||
| { | { | ||||
| qDebug("DssiPlugin::reload() - start"); | qDebug("DssiPlugin::reload() - start"); | ||||
| Q_ASSERT(descriptor && ldescriptor); | |||||
| // Safely disable plugin for reload | // Safely disable plugin for reload | ||||
| const ScopedDisabler m(this); | const ScopedDisabler m(this); | ||||
| @@ -403,7 +408,7 @@ public: | |||||
| paramBuffers = new float[params]; | paramBuffers = new float[params]; | ||||
| } | } | ||||
| const int portNameSize = CarlaEngine::maxPortNameSize() - 1; | |||||
| const int portNameSize = CarlaEngine::maxPortNameSize() - 2; | |||||
| char portName[portNameSize]; | char portName[portNameSize]; | ||||
| bool needsCtrlIn = false; | bool needsCtrlIn = false; | ||||
| bool needsCtrlOut = false; | bool needsCtrlOut = false; | ||||
| @@ -641,7 +646,7 @@ public: | |||||
| param.portCout = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, false); | param.portCout = (CarlaEngineControlPort*)x_client->addPort(CarlaEnginePortTypeControl, portName, false); | ||||
| } | } | ||||
| if (mIns > 0) | |||||
| if (mIns == 1) | |||||
| { | { | ||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | if (carlaOptions.processMode != PROCESS_MODE_MULTIPLE_CLIENTS) | ||||
| @@ -698,7 +703,7 @@ public: | |||||
| // Delete old programs | // Delete old programs | ||||
| if (midiprog.count > 0) | if (midiprog.count > 0) | ||||
| { | { | ||||
| for (uint32_t i=0; i < midiprog.count; i++) | |||||
| for (i=0; i < midiprog.count; i++) | |||||
| { | { | ||||
| if (midiprog.data[i].name) | if (midiprog.data[i].name) | ||||
| free((void*)midiprog.data[i].name); | free((void*)midiprog.data[i].name); | ||||
| @@ -786,7 +791,7 @@ public: | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Plugin processing | // Plugin processing | ||||
| void process(float* const* const inBuffer, float* const* const outBuffer, const uint32_t frames, const uint32_t framesOffset) | |||||
| void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t framesOffset) | |||||
| { | { | ||||
| uint32_t i, k; | uint32_t i, k; | ||||
| unsigned long midiEventCount = 0; | unsigned long midiEventCount = 0; | ||||
| @@ -801,9 +806,7 @@ public: | |||||
| if (aIn.count > 0) | if (aIn.count > 0) | ||||
| { | { | ||||
| uint32_t count = h2 ? 2 : aIn.count; | |||||
| if (count == 1) | |||||
| if (aIn.count == 1) | |||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| @@ -811,7 +814,7 @@ public: | |||||
| aInsPeak[0] = abs(inBuffer[0][k]); | aInsPeak[0] = abs(inBuffer[0][k]); | ||||
| } | } | ||||
| } | } | ||||
| else if (count > 1) | |||||
| else if (aIn.count > 1) | |||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| @@ -1227,16 +1230,14 @@ public: | |||||
| double bal_rangeL, bal_rangeR; | double bal_rangeL, bal_rangeR; | ||||
| float oldBufLeft[do_balance ? frames : 0]; | float oldBufLeft[do_balance ? frames : 0]; | ||||
| uint32_t count = h2 ? 2 : aOut.count; | |||||
| for (i=0; i < count; i++) | |||||
| for (i=0; i < aOut.count; i++) | |||||
| { | { | ||||
| // Dry/Wet | // Dry/Wet | ||||
| if (do_drywet) | if (do_drywet) | ||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| if (aOut.count == 1 && ! h2) | |||||
| if (aOut.count == 1) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet)); | outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet)); | ||||
| else | else | ||||
| outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet)); | outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet)); | ||||
| @@ -381,6 +381,7 @@ public: | |||||
| void reload() | void reload() | ||||
| { | { | ||||
| qDebug("FluidSynthPlugin::reload() - start"); | qDebug("FluidSynthPlugin::reload() - start"); | ||||
| Q_ASSERT(f_synth); | |||||
| // Safely disable plugin for reload | // Safely disable plugin for reload | ||||
| const ScopedDisabler m(this); | const ScopedDisabler m(this); | ||||
| @@ -802,7 +803,7 @@ public: | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Plugin processing | // Plugin processing | ||||
| void process(float**, float** outBuffer, uint32_t frames, uint32_t framesOffset) | |||||
| void process(float** const, float** const outBuffer, const uint32_t frames, const uint32_t framesOffset) | |||||
| { | { | ||||
| uint32_t i, k; | uint32_t i, k; | ||||
| uint32_t midiEventCount = 0; | uint32_t midiEventCount = 0; | ||||
| @@ -333,6 +333,7 @@ public: | |||||
| void reload() | void reload() | ||||
| { | { | ||||
| qDebug("LadspaPlugin::reload() - start"); | qDebug("LadspaPlugin::reload() - start"); | ||||
| Q_ASSERT(descriptor); | |||||
| // Safely disable plugin for reload | // Safely disable plugin for reload | ||||
| const ScopedDisabler m(this); | const ScopedDisabler m(this); | ||||
| @@ -406,7 +407,7 @@ public: | |||||
| paramBuffers = new float[params]; | paramBuffers = new float[params]; | ||||
| } | } | ||||
| const int portNameSize = CarlaEngine::maxPortNameSize() - 1; | |||||
| const int portNameSize = CarlaEngine::maxPortNameSize() - 2; | |||||
| char portName[portNameSize]; | char portName[portNameSize]; | ||||
| bool needsCtrlIn = false; | bool needsCtrlIn = false; | ||||
| bool needsCtrlOut = false; | bool needsCtrlOut = false; | ||||
| @@ -664,7 +665,7 @@ public: | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Plugin processing | // Plugin processing | ||||
| void process(float* const* const inBuffer, float* const* const outBuffer, const uint32_t frames, const uint32_t framesOffset) | |||||
| void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t framesOffset) | |||||
| { | { | ||||
| uint32_t i, k; | uint32_t i, k; | ||||
| @@ -678,9 +679,7 @@ public: | |||||
| if (aIn.count > 0) | if (aIn.count > 0) | ||||
| { | { | ||||
| uint32_t count = h2 ? 2 : aIn.count; | |||||
| if (count == 1) | |||||
| if (aIn.count == 1) | |||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| @@ -688,7 +687,7 @@ public: | |||||
| aInsPeak[0] = abs(inBuffer[0][k]); | aInsPeak[0] = abs(inBuffer[0][k]); | ||||
| } | } | ||||
| } | } | ||||
| else if (count > 1) | |||||
| else if (aIn.count > 1) | |||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| @@ -912,16 +911,14 @@ public: | |||||
| double bal_rangeL, bal_rangeR; | double bal_rangeL, bal_rangeR; | ||||
| float oldBufLeft[do_balance ? frames : 0]; | float oldBufLeft[do_balance ? frames : 0]; | ||||
| uint32_t count = h2 ? 2 : aOut.count; | |||||
| for (i=0; i < count; i++) | |||||
| for (i=0; i < aOut.count; i++) | |||||
| { | { | ||||
| // Dry/Wet | // Dry/Wet | ||||
| if (do_drywet) | if (do_drywet) | ||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| if (aOut.count == 1 && ! h2) | |||||
| if (aOut.count == 1) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet)); | outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet)); | ||||
| else | else | ||||
| outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet)); | outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet)); | ||||
| @@ -134,6 +134,7 @@ public: | |||||
| void reload() | void reload() | ||||
| { | { | ||||
| qDebug("LinuxSamplerPlugin::reload() - start"); | qDebug("LinuxSamplerPlugin::reload() - start"); | ||||
| Q_ASSERT(instrument); | |||||
| // Safely disable plugin for reload | // Safely disable plugin for reload | ||||
| const ScopedDisabler m(this); | const ScopedDisabler m(this); | ||||
| @@ -271,7 +272,7 @@ public: | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Plugin processing | // Plugin processing | ||||
| void process(float**, float** outBuffer, uint32_t frames, uint32_t framesOffset) | |||||
| void process(float** const, float** const outBuffer, const uint32_t frames, const uint32_t framesOffset) | |||||
| { | { | ||||
| uint32_t i, k; | uint32_t i, k; | ||||
| uint32_t midiEventCount = 0; | uint32_t midiEventCount = 0; | ||||
| @@ -311,12 +311,6 @@ public: | |||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| case GUI_EXTERNAL_OSC: | case GUI_EXTERNAL_OSC: | ||||
| if (osc.data.target) | |||||
| { | |||||
| osc_send_hide(&osc.data); | |||||
| osc_send_quit(&osc.data); | |||||
| } | |||||
| if (osc.thread) | if (osc.thread) | ||||
| { | { | ||||
| // Wait a bit first, try safe quit, then force kill | // Wait a bit first, try safe quit, then force kill | ||||
| @@ -328,7 +322,6 @@ public: | |||||
| delete osc.thread; | delete osc.thread; | ||||
| } | } | ||||
| break; | break; | ||||
| #endif | #endif | ||||
| } | } | ||||
| @@ -1009,9 +1002,12 @@ public: | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| osc_send_hide(&osc.data); | |||||
| osc_send_quit(&osc.data); | |||||
| osc_clear_data(&osc.data); | |||||
| if (osc.data.target) | |||||
| { | |||||
| osc_send_hide(&osc.data); | |||||
| osc_send_quit(&osc.data); | |||||
| osc_clear_data(&osc.data); | |||||
| } | |||||
| if (! osc.thread->wait(500)) | if (! osc.thread->wait(500)) | ||||
| osc.thread->quit(); | osc.thread->quit(); | ||||
| @@ -1036,6 +1032,7 @@ public: | |||||
| void reload() | void reload() | ||||
| { | { | ||||
| qDebug("Lv2Plugin::reload() - start"); | qDebug("Lv2Plugin::reload() - start"); | ||||
| Q_ASSERT(descriptor && rdf_descriptor); | |||||
| // Safely disable plugin for reload | // Safely disable plugin for reload | ||||
| const ScopedDisabler m(this); | const ScopedDisabler m(this); | ||||
| @@ -1206,7 +1203,7 @@ public: | |||||
| paramBuffers = new float[params]; | paramBuffers = new float[params]; | ||||
| } | } | ||||
| const int portNameSize = CarlaEngine::maxPortNameSize() - 1; | |||||
| const int portNameSize = CarlaEngine::maxPortNameSize() - 2; | |||||
| char portName[portNameSize]; | char portName[portNameSize]; | ||||
| bool needsCtrlIn = false; | bool needsCtrlIn = false; | ||||
| bool needsCtrlOut = false; | bool needsCtrlOut = false; | ||||
| @@ -1670,7 +1667,7 @@ public: | |||||
| // Delete old programs | // Delete old programs | ||||
| if (midiprog.count > 0) | if (midiprog.count > 0) | ||||
| { | { | ||||
| for (uint32_t i=0; i < midiprog.count; i++) | |||||
| for (i=0; i < midiprog.count; i++) | |||||
| { | { | ||||
| if (midiprog.data[i].name) | if (midiprog.data[i].name) | ||||
| free((void*)midiprog.data[i].name); | free((void*)midiprog.data[i].name); | ||||
| @@ -1767,7 +1764,7 @@ public: | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Plugin processing | // Plugin processing | ||||
| void process(float* const* const inBuffer, float* const* const outBuffer, const uint32_t frames, const uint32_t framesOffset) | |||||
| void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t framesOffset) | |||||
| { | { | ||||
| uint32_t i, k; | uint32_t i, k; | ||||
| uint32_t midiEventCount = 0; | uint32_t midiEventCount = 0; | ||||
| @@ -1831,9 +1828,7 @@ public: | |||||
| if (aIn.count > 0) | if (aIn.count > 0) | ||||
| { | { | ||||
| uint32_t count = h2 ? 2 : aIn.count; | |||||
| if (count == 1) | |||||
| if (aIn.count == 1) | |||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| @@ -1841,7 +1836,7 @@ public: | |||||
| aInsPeak[0] = abs(inBuffer[0][k]); | aInsPeak[0] = abs(inBuffer[0][k]); | ||||
| } | } | ||||
| } | } | ||||
| else if (count > 1) | |||||
| else if (aIn.count > 1) | |||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| @@ -2349,16 +2344,14 @@ public: | |||||
| double bal_rangeL, bal_rangeR; | double bal_rangeL, bal_rangeR; | ||||
| float oldBufLeft[do_balance ? frames : 0]; | float oldBufLeft[do_balance ? frames : 0]; | ||||
| uint32_t count = h2 ? 2 : aOut.count; | |||||
| for (i=0; i < count; i++) | |||||
| for (i=0; i < aOut.count; i++) | |||||
| { | { | ||||
| // Dry/Wet | // Dry/Wet | ||||
| if (do_drywet) | if (do_drywet) | ||||
| { | { | ||||
| for (k=0; k < frames; k++) | for (k=0; k < frames; k++) | ||||
| { | { | ||||
| if (aOut.count == 1 && ! h2) | |||||
| if (aOut.count == 1) | |||||
| outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet)); | outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[0][k]*(1.0-x_dryWet)); | ||||
| else | else | ||||
| outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet)); | outBuffer[i][k] = (outBuffer[i][k]*x_dryWet)+(inBuffer[i][k]*(1.0-x_dryWet)); | ||||