From e2aa9e3b422500d631821e76828cb00f43a11792 Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 24 Oct 2013 20:02:07 +0100 Subject: [PATCH] Misc cleanup --- source/backend/plugin/BridgePlugin.cpp | 5 +---- source/backend/plugin/CsoundPlugin.cpp | 8 +++++++- source/backend/plugin/DssiPlugin.cpp | 2 +- source/backend/plugin/FluidSynthPlugin.cpp | 9 ++------- source/backend/plugin/LadspaPlugin.cpp | 2 +- source/backend/plugin/LinuxSamplerPlugin.cpp | 9 ++------- source/backend/plugin/Lv2Plugin.cpp | 17 ++++------------- source/backend/plugin/NativePlugin.cpp | 14 ++++---------- source/backend/plugin/VstPlugin.cpp | 9 ++------- source/modules/carla_native/vex-synth.cpp | 2 +- 10 files changed, 25 insertions(+), 52 deletions(-) diff --git a/source/backend/plugin/BridgePlugin.cpp b/source/backend/plugin/BridgePlugin.cpp index 889372aa5..f97115650 100644 --- a/source/backend/plugin/BridgePlugin.cpp +++ b/source/backend/plugin/BridgePlugin.cpp @@ -599,11 +599,8 @@ public: void reload() override { + CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); carla_debug("BridgePlugin::reload() - start"); - CARLA_ASSERT(pData->engine != nullptr); - - if (pData->engine == nullptr) - return; const ProcessMode processMode(pData->engine->getProccessMode()); diff --git a/source/backend/plugin/CsoundPlugin.cpp b/source/backend/plugin/CsoundPlugin.cpp index 894e8ccc2..172adb34d 100644 --- a/source/backend/plugin/CsoundPlugin.cpp +++ b/source/backend/plugin/CsoundPlugin.cpp @@ -58,11 +58,17 @@ public: void reload() override { + CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); + carla_debug("CsoundPlugin::reload() - start"); + + bufferSizeChanged(pData->engine->getBufferSize()); + reloadPrograms(true); + + carla_debug("CsoundPlugin::reload() - end"); } void process(float** const inBuffer, float** const outBuffer, const uint32_t frames) override { - } private: diff --git a/source/backend/plugin/DssiPlugin.cpp b/source/backend/plugin/DssiPlugin.cpp index d35c35a69..9551faa30 100644 --- a/source/backend/plugin/DssiPlugin.cpp +++ b/source/backend/plugin/DssiPlugin.cpp @@ -382,11 +382,11 @@ public: void reload() override { - carla_debug("DssiPlugin::reload() - start"); CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,); CARLA_SAFE_ASSERT_RETURN(fDssiDescriptor != nullptr,); CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr,); + carla_debug("DssiPlugin::reload() - start"); const ProcessMode processMode(pData->engine->getProccessMode()); diff --git a/source/backend/plugin/FluidSynthPlugin.cpp b/source/backend/plugin/FluidSynthPlugin.cpp index 6a452c9a0..e5daf5b69 100644 --- a/source/backend/plugin/FluidSynthPlugin.cpp +++ b/source/backend/plugin/FluidSynthPlugin.cpp @@ -510,14 +510,9 @@ public: void reload() override { + CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); + CARLA_SAFE_ASSERT_RETURN(fSynth != nullptr,); carla_debug("FluidSynthPlugin::reload() - start"); - CARLA_ASSERT(pData->engine != nullptr); - CARLA_ASSERT(fSynth != nullptr); - - if (pData->engine == nullptr) - return; - if (fSynth == nullptr) - return; const ProcessMode processMode(pData->engine->getProccessMode()); diff --git a/source/backend/plugin/LadspaPlugin.cpp b/source/backend/plugin/LadspaPlugin.cpp index a6e9c3039..e8d7e3183 100644 --- a/source/backend/plugin/LadspaPlugin.cpp +++ b/source/backend/plugin/LadspaPlugin.cpp @@ -392,10 +392,10 @@ public: void reload() override { - carla_debug("LadspaPlugin::reload() - start"); CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,); CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr,); + carla_debug("LadspaPlugin::reload() - start"); const ProcessMode processMode(pData->engine->getProccessMode()); diff --git a/source/backend/plugin/LinuxSamplerPlugin.cpp b/source/backend/plugin/LinuxSamplerPlugin.cpp index faaf4a6ef..4e4711ecf 100644 --- a/source/backend/plugin/LinuxSamplerPlugin.cpp +++ b/source/backend/plugin/LinuxSamplerPlugin.cpp @@ -336,14 +336,9 @@ public: void reload() override { + CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); + CARLA_SAFE_ASSERT_RETURN(fInstrument != nullptr,); carla_debug("LinuxSamplerPlugin::reload() - start"); - CARLA_ASSERT(pData->engine != nullptr); - CARLA_ASSERT(fInstrument != nullptr); - - if (pData->engine == nullptr) - return; - if (fInstrument == nullptr) - return; const ProcessMode processMode(pData->engine->getProccessMode()); diff --git a/source/backend/plugin/Lv2Plugin.cpp b/source/backend/plugin/Lv2Plugin.cpp index 02d07542e..f8aca4d0a 100644 --- a/source/backend/plugin/Lv2Plugin.cpp +++ b/source/backend/plugin/Lv2Plugin.cpp @@ -1283,20 +1283,11 @@ public: void reload() override { + CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); + CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr,); + CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,); + CARLA_SAFE_ASSERT_RETURN(fRdfDescriptor != nullptr,); carla_debug("Lv2Plugin::reload() - start"); - CARLA_ASSERT(pData->engine != nullptr); - CARLA_ASSERT(fHandle != nullptr); - CARLA_ASSERT(fDescriptor != nullptr); - CARLA_ASSERT(fRdfDescriptor != nullptr); - - if (pData->engine == nullptr) - return; - if (fHandle == nullptr) - return; - if (fDescriptor == nullptr) - return; - if (fRdfDescriptor == nullptr) - return; const ProcessMode processMode(pData->engine->getProccessMode()); diff --git a/source/backend/plugin/NativePlugin.cpp b/source/backend/plugin/NativePlugin.cpp index 8ccd20b6e..fa45d4ab9 100644 --- a/source/backend/plugin/NativePlugin.cpp +++ b/source/backend/plugin/NativePlugin.cpp @@ -602,16 +602,10 @@ public: { CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,); CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr,); - CARLA_ASSERT(index >= -1 && index < static_cast(pData->midiprog.count)); + CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast(pData->midiprog.count),); - if (index < -1) - index = -1; - else if (index > static_cast(pData->midiprog.count)) - return; - - // TODO - //if ((fHints & PLUGIN_IS_SYNTH) != 0 && (pData->ctrlChannel < 0 || pData->ctrlChannel >= MAX_MIDI_CHANNELS)) - // return; + if ((fHints & PLUGIN_IS_SYNTH) != 0 && (pData->ctrlChannel < 0 || pData->ctrlChannel >= MAX_MIDI_CHANNELS)) + return; if (index >= 0) { @@ -691,10 +685,10 @@ public: void reload() override { - carla_debug("NativePlugin::reload() - start"); CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,); CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr,); + carla_debug("NativePlugin::reload() - start"); const ProcessMode processMode(pData->engine->getProccessMode()); diff --git a/source/backend/plugin/VstPlugin.cpp b/source/backend/plugin/VstPlugin.cpp index 6b6cfafcf..b3421d662 100644 --- a/source/backend/plugin/VstPlugin.cpp +++ b/source/backend/plugin/VstPlugin.cpp @@ -494,14 +494,9 @@ public: void reload() override { + CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); + CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr,); carla_debug("VstPlugin::reload() - start"); - CARLA_ASSERT(pData->engine != nullptr); - CARLA_ASSERT(fEffect != nullptr); - - if (pData->engine == nullptr) - return; - if (fEffect == nullptr) - return; const ProcessMode processMode(pData->engine->getProccessMode()); diff --git a/source/modules/carla_native/vex-synth.cpp b/source/modules/carla_native/vex-synth.cpp index be51eae11..38a4d2ce3 100644 --- a/source/modules/carla_native/vex-synth.cpp +++ b/source/modules/carla_native/vex-synth.cpp @@ -891,7 +891,7 @@ protected: case 89: hints |= PARAMETER_IS_BOOLEAN; paramInfo.name = "Wave1 on/off"; - paramInfo.ranges.def = 0.1f; + paramInfo.ranges.def = 1.0f; break; case 90: hints |= PARAMETER_IS_BOOLEAN;