| @@ -765,9 +765,9 @@ bool CarlaEngine::removePlugin(const unsigned int id) | |||||
| CarlaPlugin* const plugin = kData->plugins[id].plugin; | CarlaPlugin* const plugin = kData->plugins[id].plugin; | ||||
| CARLA_ASSERT(plugin); | |||||
| CARLA_ASSERT(plugin != nullptr); | |||||
| if (plugin) | |||||
| if (plugin != nullptr) | |||||
| { | { | ||||
| CARLA_ASSERT(plugin->id() == id); | CARLA_ASSERT(plugin->id() == id); | ||||
| @@ -780,8 +780,10 @@ bool CarlaEngine::removePlugin(const unsigned int id) | |||||
| if (isRunning()) | if (isRunning()) | ||||
| { | { | ||||
| qWarning("CarlaEngine::removePlugin(%i) - remove blocking START", id); | |||||
| // block wait for unlock on proccessing side | // block wait for unlock on proccessing side | ||||
| kData->nextAction.mutex.lock(); | kData->nextAction.mutex.lock(); | ||||
| qWarning("CarlaEngine::removePlugin(%i) - remove blocking DONE", id); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -821,6 +823,16 @@ void CarlaEngine::removeAllPlugins() | |||||
| kData->curPluginCount = 0; | kData->curPluginCount = 0; | ||||
| for (unsigned int i=0; i < oldCount; i++) | |||||
| { | |||||
| CarlaPlugin* const plugin = kData->plugins[i].plugin; | |||||
| CARLA_ASSERT(plugin != nullptr); | |||||
| if (plugin != nullptr) | |||||
| plugin->setEnabled(false); | |||||
| } | |||||
| // wait for processing | // wait for processing | ||||
| waitForProccessEnd(); | waitForProccessEnd(); | ||||
| @@ -828,9 +840,9 @@ void CarlaEngine::removeAllPlugins() | |||||
| { | { | ||||
| CarlaPlugin* const plugin = kData->plugins[i].plugin; | CarlaPlugin* const plugin = kData->plugins[i].plugin; | ||||
| CARLA_ASSERT(plugin); | |||||
| CARLA_ASSERT(plugin != nullptr); | |||||
| if (plugin) | |||||
| if (plugin != nullptr) | |||||
| delete plugin; | delete plugin; | ||||
| // clear this plugin | // clear this plugin | ||||
| @@ -84,8 +84,8 @@ public: | |||||
| fBuffer = (float*)jackbridge_port_get_buffer(kPort, engine->getBufferSize()); | fBuffer = (float*)jackbridge_port_get_buffer(kPort, engine->getBufferSize()); | ||||
| //if (! kIsInput) | |||||
| // carla_zeroFloat(fBuffer, engine->getBufferSize()); | |||||
| if (! kIsInput) | |||||
| carla_zeroFloat(fBuffer, engine->getBufferSize()); | |||||
| } | } | ||||
| private: | private: | ||||
| @@ -975,6 +975,8 @@ protected: | |||||
| #endif | #endif | ||||
| } | } | ||||
| #endif | #endif | ||||
| proccessPendingEvents(); | |||||
| } | } | ||||
| void handleJackLatencyCallback(const jack_latency_callback_mode_t mode) | void handleJackLatencyCallback(const jack_latency_callback_mode_t mode) | ||||
| @@ -975,7 +975,7 @@ public: | |||||
| if (time >= frames) | if (time >= frames) | ||||
| continue; | continue; | ||||
| CARLA_ASSERT(time >= timeOffset); | |||||
| CARLA_ASSERT_INT2(time >= timeOffset, time, timeOffset); | |||||
| if (time > timeOffset && sampleAccurate) | if (time > timeOffset && sampleAccurate) | ||||
| { | { | ||||
| @@ -1227,18 +1227,15 @@ public: | |||||
| fMidiEvents[midiEventCount].data.note.note = note; | fMidiEvents[midiEventCount].data.note.note = note; | ||||
| fMidiEvents[midiEventCount].data.note.velocity = pressure; | fMidiEvents[midiEventCount].data.note.velocity = pressure; | ||||
| } | } | ||||
| else if (MIDI_IS_STATUS_CONTROL_CHANGE(status)) | |||||
| else if (MIDI_IS_STATUS_CONTROL_CHANGE(status) && (fHints & PLUGIN_OPTION_SELF_AUTOMATION) != 0) | |||||
| { | { | ||||
| if (fHints & PLUGIN_OPTION_SELF_AUTOMATION) | |||||
| { | |||||
| const uint8_t control = midiEvent.data[1]; | |||||
| const uint8_t value = midiEvent.data[2]; | |||||
| const uint8_t control = midiEvent.data[1]; | |||||
| const uint8_t value = midiEvent.data[2]; | |||||
| fMidiEvents[midiEventCount].type = SND_SEQ_EVENT_CONTROLLER; | |||||
| fMidiEvents[midiEventCount].data.control.channel = channel; | |||||
| fMidiEvents[midiEventCount].data.control.param = control; | |||||
| fMidiEvents[midiEventCount].data.control.value = value; | |||||
| } | |||||
| fMidiEvents[midiEventCount].type = SND_SEQ_EVENT_CONTROLLER; | |||||
| fMidiEvents[midiEventCount].data.control.channel = channel; | |||||
| fMidiEvents[midiEventCount].data.control.param = control; | |||||
| fMidiEvents[midiEventCount].data.control.value = value; | |||||
| } | } | ||||
| else if (MIDI_IS_STATUS_AFTERTOUCH(status)) | else if (MIDI_IS_STATUS_AFTERTOUCH(status)) | ||||
| { | { | ||||
| @@ -901,7 +901,7 @@ public: | |||||
| if (time >= frames) | if (time >= frames) | ||||
| continue; | continue; | ||||
| CARLA_ASSERT(time >= timeOffset); | |||||
| CARLA_ASSERT_INT2(time >= timeOffset, time, timeOffset); | |||||
| if (time > timeOffset) | if (time > timeOffset) | ||||
| { | { | ||||
| @@ -1011,7 +1011,7 @@ public: | |||||
| } | } | ||||
| case kEngineControlEventTypeMidiBank: | case kEngineControlEventTypeMidiBank: | ||||
| if (event.channel < 16) | |||||
| if (event.channel < 16 && event.channel != 9) // FIXME | |||||
| nextBankIds[event.channel] = ctrlEvent.param; | nextBankIds[event.channel] = ctrlEvent.param; | ||||
| break; | break; | ||||
| @@ -811,7 +811,7 @@ public: | |||||
| if (time >= frames) | if (time >= frames) | ||||
| continue; | continue; | ||||
| CARLA_ASSERT(time >= timeOffset); | |||||
| CARLA_ASSERT_INT2(time >= timeOffset, time, timeOffset); | |||||
| if (time > timeOffset && sampleAccurate) | if (time > timeOffset && sampleAccurate) | ||||
| { | { | ||||