diff --git a/source/modules/dgl/App.hpp b/source/modules/dgl/App.hpp index 6bc817fe7..c658c604e 100644 --- a/source/modules/dgl/App.hpp +++ b/source/modules/dgl/App.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/Base.hpp b/source/modules/dgl/Base.hpp index d1fd807de..943d466d1 100644 --- a/source/modules/dgl/Base.hpp +++ b/source/modules/dgl/Base.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/CairoWidget.hpp b/source/modules/dgl/CairoWidget.hpp index 693dc945b..6de2ad3d7 100644 --- a/source/modules/dgl/CairoWidget.hpp +++ b/source/modules/dgl/CairoWidget.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/Geometry.hpp b/source/modules/dgl/Geometry.hpp index 94089462b..c11fd407d 100644 --- a/source/modules/dgl/Geometry.hpp +++ b/source/modules/dgl/Geometry.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/Image.hpp b/source/modules/dgl/Image.hpp index dd2acd74f..89d853205 100644 --- a/source/modules/dgl/Image.hpp +++ b/source/modules/dgl/Image.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/ImageAboutWindow.hpp b/source/modules/dgl/ImageAboutWindow.hpp index b46a7f112..acdaa22ea 100644 --- a/source/modules/dgl/ImageAboutWindow.hpp +++ b/source/modules/dgl/ImageAboutWindow.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/ImageButton.hpp b/source/modules/dgl/ImageButton.hpp index 6180cd72e..d0f474fb1 100644 --- a/source/modules/dgl/ImageButton.hpp +++ b/source/modules/dgl/ImageButton.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/ImageKnob.hpp b/source/modules/dgl/ImageKnob.hpp index 395a066b4..3e9ef11ec 100644 --- a/source/modules/dgl/ImageKnob.hpp +++ b/source/modules/dgl/ImageKnob.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/ImageSlider.hpp b/source/modules/dgl/ImageSlider.hpp index ea2507c26..029e1da53 100644 --- a/source/modules/dgl/ImageSlider.hpp +++ b/source/modules/dgl/ImageSlider.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/StandaloneWindow.hpp b/source/modules/dgl/StandaloneWindow.hpp index a3de65eaa..e3fa84002 100644 --- a/source/modules/dgl/StandaloneWindow.hpp +++ b/source/modules/dgl/StandaloneWindow.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/Widget.hpp b/source/modules/dgl/Widget.hpp index ca4caf935..ec65887f3 100644 --- a/source/modules/dgl/Widget.hpp +++ b/source/modules/dgl/Widget.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/Window.hpp b/source/modules/dgl/Window.hpp index 3c2b7a1ac..64d5fd3f4 100644 --- a/source/modules/dgl/Window.hpp +++ b/source/modules/dgl/Window.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/App.cpp b/source/modules/dgl/src/App.cpp index d75685505..99d5f0194 100644 --- a/source/modules/dgl/src/App.cpp +++ b/source/modules/dgl/src/App.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/Base.cpp b/source/modules/dgl/src/Base.cpp index 11e64e0c5..58c44c4d0 100644 --- a/source/modules/dgl/src/Base.cpp +++ b/source/modules/dgl/src/Base.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/Geometry.cpp b/source/modules/dgl/src/Geometry.cpp index 2e4d61052..e3a893d67 100644 --- a/source/modules/dgl/src/Geometry.cpp +++ b/source/modules/dgl/src/Geometry.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/Image.cpp b/source/modules/dgl/src/Image.cpp index 41b85a21f..0fb7298a7 100644 --- a/source/modules/dgl/src/Image.cpp +++ b/source/modules/dgl/src/Image.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/ImageAboutWindow.cpp b/source/modules/dgl/src/ImageAboutWindow.cpp index 897596ff3..67b288606 100644 --- a/source/modules/dgl/src/ImageAboutWindow.cpp +++ b/source/modules/dgl/src/ImageAboutWindow.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/ImageButton.cpp b/source/modules/dgl/src/ImageButton.cpp index b3f678008..01ca424a0 100644 --- a/source/modules/dgl/src/ImageButton.cpp +++ b/source/modules/dgl/src/ImageButton.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/ImageKnob.cpp b/source/modules/dgl/src/ImageKnob.cpp index 63c2f521e..5e40bbdf8 100644 --- a/source/modules/dgl/src/ImageKnob.cpp +++ b/source/modules/dgl/src/ImageKnob.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/ImageSlider.cpp b/source/modules/dgl/src/ImageSlider.cpp index f5d3362d9..1c7f5b1fb 100644 --- a/source/modules/dgl/src/ImageSlider.cpp +++ b/source/modules/dgl/src/ImageSlider.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/Widget.cpp b/source/modules/dgl/src/Widget.cpp index 549857781..0aa46f7a1 100644 --- a/source/modules/dgl/src/Widget.cpp +++ b/source/modules/dgl/src/Widget.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/dgl/src/Window.cpp b/source/modules/dgl/src/Window.cpp index bc941a54a..477bd3b18 100644 --- a/source/modules/dgl/src/Window.cpp +++ b/source/modules/dgl/src/Window.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/DistrhoPlugin.hpp b/source/modules/distrho/DistrhoPlugin.hpp index 56a29d4e4..7cd35a347 100644 --- a/source/modules/distrho/DistrhoPlugin.hpp +++ b/source/modules/distrho/DistrhoPlugin.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -19,6 +19,12 @@ #include "DistrhoUtils.hpp" +#include + +#ifndef M_PI +# define M_PI 3.14159265358979323846 +#endif + START_NAMESPACE_DISTRHO // ----------------------------------------------------------------------- diff --git a/source/modules/distrho/DistrhoPluginMain.cpp b/source/modules/distrho/DistrhoPluginMain.cpp index b624fe4ee..0671344d5 100644 --- a/source/modules/distrho/DistrhoPluginMain.cpp +++ b/source/modules/distrho/DistrhoPluginMain.cpp @@ -1,5 +1,5 @@ /* - * DISTRHO Plugin Toolkit (DPT) + * DISTRHO Plugin Framework (DPF) * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with diff --git a/source/modules/distrho/DistrhoUI.hpp b/source/modules/distrho/DistrhoUI.hpp index 58abaddbc..180ed3806 100644 --- a/source/modules/distrho/DistrhoUI.hpp +++ b/source/modules/distrho/DistrhoUI.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/DistrhoUIMain.cpp b/source/modules/distrho/DistrhoUIMain.cpp index b4f0a245b..27f219ae3 100644 --- a/source/modules/distrho/DistrhoUIMain.cpp +++ b/source/modules/distrho/DistrhoUIMain.cpp @@ -1,5 +1,5 @@ /* - * DISTRHO Plugin Toolkit (DPT) + * DISTRHO Plugin Framework (DPF) * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with diff --git a/source/modules/distrho/DistrhoUtils.hpp b/source/modules/distrho/DistrhoUtils.hpp index eb400de4d..3f88d0458 100644 --- a/source/modules/distrho/DistrhoUtils.hpp +++ b/source/modules/distrho/DistrhoUtils.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoDefines.h b/source/modules/distrho/src/DistrhoDefines.h index 5f73ae887..bd72a1f38 100644 --- a/source/modules/distrho/src/DistrhoDefines.h +++ b/source/modules/distrho/src/DistrhoDefines.h @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoPlugin.cpp b/source/modules/distrho/src/DistrhoPlugin.cpp index 8629ff67a..7e9f382c8 100644 --- a/source/modules/distrho/src/DistrhoPlugin.cpp +++ b/source/modules/distrho/src/DistrhoPlugin.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoPluginCarla.cpp b/source/modules/distrho/src/DistrhoPluginCarla.cpp index 6eab38ca4..334bb8766 100644 --- a/source/modules/distrho/src/DistrhoPluginCarla.cpp +++ b/source/modules/distrho/src/DistrhoPluginCarla.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/source/modules/distrho/src/DistrhoPluginInternal.hpp b/source/modules/distrho/src/DistrhoPluginInternal.hpp index aafec70fe..ad10e566a 100644 --- a/source/modules/distrho/src/DistrhoPluginInternal.hpp +++ b/source/modules/distrho/src/DistrhoPluginInternal.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoPluginLADSPA+DSSI.cpp b/source/modules/distrho/src/DistrhoPluginLADSPA+DSSI.cpp index 861a4b451..2a2b18260 100644 --- a/source/modules/distrho/src/DistrhoPluginLADSPA+DSSI.cpp +++ b/source/modules/distrho/src/DistrhoPluginLADSPA+DSSI.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoPluginLV2.cpp b/source/modules/distrho/src/DistrhoPluginLV2.cpp index 4c1d9c338..64d878971 100644 --- a/source/modules/distrho/src/DistrhoPluginLV2.cpp +++ b/source/modules/distrho/src/DistrhoPluginLV2.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoPluginLV2export.cpp b/source/modules/distrho/src/DistrhoPluginLV2export.cpp index 5240c63d0..b78b3037b 100644 --- a/source/modules/distrho/src/DistrhoPluginLV2export.cpp +++ b/source/modules/distrho/src/DistrhoPluginLV2export.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoPluginVST.cpp b/source/modules/distrho/src/DistrhoPluginVST.cpp index a45220c27..98a17a96b 100644 --- a/source/modules/distrho/src/DistrhoPluginVST.cpp +++ b/source/modules/distrho/src/DistrhoPluginVST.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -60,7 +60,7 @@ struct ERect { # warning VST State still TODO (working but needs final testing) #endif #if DISTRHO_PLUGIN_WANT_TIMEPOS -# warning VST TimePos still TODO +# warning VST TimePos still TODO (only basic BBT working) #endif typedef std::map StringMap; @@ -75,66 +75,52 @@ void strncpy(char* const dst, const char* const src, const size_t size) dst[size] = '\0'; } +#if DISTRHO_PLUGIN_HAS_UI // ----------------------------------------------------------------------- -#if DISTRHO_PLUGIN_WANT_STATE -class StateHelper +class UiHelper { public: - virtual ~StateHelper() {} - virtual void setSharedState(const char* const newKey, const char* const newValue) = 0; -}; -#else -typedef void StateHelper; + UiHelper() + : parameterChecks(nullptr), + parameterValues(nullptr), + nextProgram(-1) {} + + virtual ~UiHelper() + { + if (parameterChecks != nullptr) + { + delete[] parameterChecks; + parameterChecks = nullptr; + } + if (parameterValues != nullptr) + { + delete[] parameterValues; + parameterValues = nullptr; + } + } + + bool* parameterChecks; + float* parameterValues; + int32_t nextProgram; + +#if DISTRHO_PLUGIN_WANT_STATE + virtual void setStateFromUi(const char* const newKey, const char* const newValue) = 0; #endif +}; // ----------------------------------------------------------------------- -#if DISTRHO_PLUGIN_HAS_UI class UIVst { public: - UIVst(const audioMasterCallback audioMaster, AEffect* const effect, PluginExporter* const plugin, StateHelper* const stateHelper, const intptr_t winId) + UIVst(const audioMasterCallback audioMaster, AEffect* const effect, UiHelper* const uiHelper, PluginExporter* const plugin, const intptr_t winId) : fAudioMaster(audioMaster), fEffect(effect), + fUiHelper(uiHelper), fPlugin(plugin), - fStateHelper(stateHelper), - fUI(this, winId, editParameterCallback, setParameterCallback, setStateCallback, sendNoteCallback, uiResizeCallback), - fParameterChecks(nullptr), - fParameterValues(nullptr) - { - const uint32_t paramCount(plugin->getParameterCount()); - - if (paramCount > 0) - { - fParameterChecks = new bool[paramCount]; - fParameterValues = new float[paramCount]; - - for (uint32_t i=0; i < paramCount; ++i) - { - fParameterChecks[i] = false; - fParameterValues[i] = 0.0f; - } - } - -#if DISTRHO_PLUGIN_WANT_PROGRAMS - fNextProgram = -1; -#endif - } - - ~UIVst() + fUI(this, winId, editParameterCallback, setParameterCallback, setStateCallback, sendNoteCallback, uiResizeCallback) { - if (fParameterChecks != nullptr) - { - delete[] fParameterChecks; - fParameterChecks = nullptr; - } - - if (fParameterValues != nullptr) - { - delete[] fParameterValues; - fParameterValues = nullptr; - } } // ------------------------------------------------------------------- @@ -142,19 +128,19 @@ public: void idle() { #if DISTRHO_PLUGIN_WANT_PROGRAMS - if (fNextProgram != -1) + if (fUiHelper->nextProgram != -1) { - fUI.programChanged(fNextProgram); - fNextProgram = -1; + fUI.programChanged(fUiHelper->nextProgram); + fUiHelper->nextProgram = -1; } #endif for (uint32_t i=0, count = fPlugin->getParameterCount(); i < count; ++i) { - if (fParameterChecks[i]) + if (fUiHelper->parameterChecks[i]) { - fParameterChecks[i] = false; - fUI.parameterChanged(i, fParameterValues[i]); + fUiHelper->parameterChecks[i] = false; + fUI.parameterChanged(i, fUiHelper->parameterValues[i]); } } @@ -172,27 +158,7 @@ public: } // ------------------------------------------------------------------- - // functions called from the plugin side, RT no block - - void setParameterValueFromPlugin(const uint32_t index, const float perValue) - { - fParameterChecks[index] = true; - fParameterValues[index] = perValue; - } - -#if DISTRHO_PLUGIN_WANT_PROGRAMS - void setProgramFromPlugin(const uint32_t index) - { - fNextProgram = index; - - // set previous parameters invalid - for (uint32_t i=0, count = fPlugin->getParameterCount(); i < count; ++i) - fParameterChecks[i] = false; - } -#endif - - // ------------------------------------------------------------------- - // functions called from the plugin side, block + // functions called from the plugin side, may block #if DISTRHO_PLUGIN_WANT_STATE void setStateFromPlugin(const char* const key, const char* const value) @@ -229,7 +195,7 @@ protected: void setState(const char* const key, const char* const value) { #if DISTRHO_PLUGIN_WANT_STATE - fStateHelper->setSharedState(key, value); + fUiHelper->setStateFromUi(key, value); #else return; // unused (void)key; @@ -259,19 +225,12 @@ private: // Vst stuff const audioMasterCallback fAudioMaster; AEffect* const fEffect; + UiHelper* const fUiHelper; PluginExporter* const fPlugin; - StateHelper* const fStateHelper; // Plugin UI UIExporter fUI; - // Temporary data - bool* fParameterChecks; - float* fParameterValues; -#if DISTRHO_PLUGIN_WANT_PROGRAMS - int32_t fNextProgram; -#endif - // ------------------------------------------------------------------- // Callbacks @@ -308,8 +267,8 @@ private: // ----------------------------------------------------------------------- -#if DISTRHO_PLUGIN_WANT_STATE -class PluginVst : public StateHelper +#if DISTRHO_PLUGIN_HAS_UI +class PluginVst : public UiHelper #else class PluginVst #endif @@ -333,6 +292,18 @@ public: fVstRect.left = 0; fVstRect.bottom = 0; fVstRect.right = 0; + + if (const uint32_t paramCount = fPlugin.getParameterCount()) + { + parameterChecks = new bool[paramCount]; + parameterValues = new float[paramCount]; + + for (uint32_t i=0; i < paramCount; ++i) + { + parameterChecks[i] = false; + parameterValues[i] = 0.0f; + } + } #endif #if DISTRHO_PLUGIN_WANT_STATE @@ -368,7 +339,7 @@ public: #if DISTRHO_PLUGIN_HAS_UI if (fVstUi != nullptr) - fVstUi->setProgramFromPlugin(fCurProgram); + setProgramFromPlugin(fCurProgram); #endif ret = 1; @@ -452,14 +423,14 @@ public: d_lastUiSampleRate = fAudioMaster(fEffect, audioMasterGetSampleRate, 0, 0, nullptr, 0.0f); - fVstUi = new UIVst(fAudioMaster, fEffect, &fPlugin, this, (intptr_t)ptr); + fVstUi = new UIVst(fAudioMaster, fEffect, this, &fPlugin, (intptr_t)ptr); # if DISTRHO_PLUGIN_WANT_PROGRAMS if (fCurProgram >= 0) - fVstUi->setProgramFromPlugin(fCurProgram); + setProgramFromPlugin(fCurProgram); # endif for (uint32_t i=0, count = fPlugin.getParameterCount(); i < count; ++i) - fVstUi->setParameterValueFromPlugin(i, fPlugin.getParameterValue(i)); + setParameterValueFromPlugin(i, fPlugin.getParameterValue(i)); fVstUi->idle(); @@ -663,20 +634,31 @@ public: #if DISTRHO_PLUGIN_HAS_UI if (fVstUi != nullptr) - fVstUi->setParameterValueFromPlugin(index, realValue); + setParameterValueFromPlugin(index, realValue); #endif } void vst_processReplacing(float** const inputs, float** const outputs, const int32_t sampleFrames) { #if DISTRHO_PLUGIN_WANT_TIMEPOS - if (const VstTimeInfo* const timeInfo = (const VstTimeInfo*)fEffect->dispatcher(fEffect, audioMasterGetTime, 0, kVstTempoValid, nullptr, 0.0f)) + static const int kWantedVstTimeFlags(kVstTransportPlaying|kVstTempoValid|kVstTimeSigValid); + + if (const VstTimeInfo* const vstTimeInfo = (const VstTimeInfo*)fAudioMaster(fEffect, audioMasterGetTime, 0, kWantedVstTimeFlags, nullptr, 0.0f)) { - fTimePos.playing = (timeInfo->flags & kVstTransportPlaying); - fTimePos.frame = timeInfo->samplePos; + fTimePos.playing = (vstTimeInfo->flags & kVstTransportPlaying); + fTimePos.frame = vstTimeInfo->samplePos; - // TODO: BBT - // timeInfo->tempo etc + if (vstTimeInfo->flags & kVstTempoValid) + { + fTimePos.bbt.valid = true; + fTimePos.bbt.beatsPerMinute = vstTimeInfo->tempo; + } + if (vstTimeInfo->flags & kVstTimeSigValid) + { + fTimePos.bbt.valid = true; + fTimePos.bbt.beatsPerBar = vstTimeInfo->timeSigNumerator; + fTimePos.bbt.beatType = vstTimeInfo->timeSigDenominator; + } fPlugin.setTimePos(fTimePos); } @@ -688,6 +670,17 @@ public: #else fPlugin.run(inputs, outputs, sampleFrames); #endif + +#if DISTRHO_PLUGIN_HAS_UI + if (fVstUi == nullptr) + return; + + for (uint32_t i=0, count = fPlugin.getParameterCount(); i < count; ++i) + { + if (fPlugin.isParameterOutput(i)) + setParameterValueFromPlugin(i, fPlugin.getParameterValue(i)); + } +#endif } // ------------------------------------------------------------------- @@ -725,8 +718,33 @@ private: #if DISTRHO_PLUGIN_WANT_STATE char* fStateChunk; StringMap fStateMap; +#endif + + // ------------------------------------------------------------------- + // functions called from the plugin side, RT no block + + void setParameterValueFromPlugin(const uint32_t index, const float realValue) + { + parameterValues[index] = realValue; + parameterChecks[index] = true; + } + +#if DISTRHO_PLUGIN_WANT_PROGRAMS + void setProgramFromPlugin(const uint32_t index) + { + // set previous parameters invalid + for (uint32_t i=0, count = fPlugin.getParameterCount(); i < count; ++i) + parameterChecks[i] = false; + + nextProgram = index; + } +#endif + +#if DISTRHO_PLUGIN_WANT_STATE + // ------------------------------------------------------------------- + // functions called from the UI side, may block - void setSharedState(const char* const newKey, const char* const newValue) override + void setStateFromUi(const char* const newKey, const char* const newValue) override { fPlugin.setState(newKey, newValue); diff --git a/source/modules/distrho/src/DistrhoUI.cpp b/source/modules/distrho/src/DistrhoUI.cpp index 25e4965b4..eda6412f5 100644 --- a/source/modules/distrho/src/DistrhoUI.cpp +++ b/source/modules/distrho/src/DistrhoUI.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoUIDSSI.cpp b/source/modules/distrho/src/DistrhoUIDSSI.cpp index 354369917..e59a96067 100644 --- a/source/modules/distrho/src/DistrhoUIDSSI.cpp +++ b/source/modules/distrho/src/DistrhoUIDSSI.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoUIInternal.hpp b/source/modules/distrho/src/DistrhoUIInternal.hpp index 3fe8d812d..fae40cee6 100644 --- a/source/modules/distrho/src/DistrhoUIInternal.hpp +++ b/source/modules/distrho/src/DistrhoUIInternal.hpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this diff --git a/source/modules/distrho/src/DistrhoUILV2.cpp b/source/modules/distrho/src/DistrhoUILV2.cpp index b1e5a36dd..9bb6acf50 100644 --- a/source/modules/distrho/src/DistrhoUILV2.cpp +++ b/source/modules/distrho/src/DistrhoUILV2.cpp @@ -1,6 +1,6 @@ /* - * DISTRHO Plugin Toolkit (DPT) - * Copyright (C) 2012-2013 Filipe Coelho + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this