diff options
author | falkTX <falktx@falktx.com> | 2022-12-12 10:36:15 +0000 |
---|---|---|
committer | falkTX <falktx@falktx.com> | 2022-12-12 11:15:08 +0000 |
commit | f6182e6f63efb87d0b70e7ff39873cda7a7e63ee (patch) | |
tree | cf58efa0bd9400d309f82f01a9c2dc7a5d4f97f6 | |
parent | 78f2e532ecff0d4190a04f7d06dd75655cde622c (diff) |
Fix invalid use of dpf states
Signed-off-by: falkTX <falktx@falktx.com>
m--------- | dpf | 0 | ||||
-rw-r--r-- | plugins/ZamHeadX2/DistrhoPluginInfo.h | 3 | ||||
-rw-r--r-- | plugins/ZamHeadX2/ZamHeadX2Plugin.cpp | 80 | ||||
-rw-r--r-- | plugins/ZamHeadX2/ZamHeadX2Plugin.hpp | 4 | ||||
-rw-r--r-- | plugins/ZamHeadX2/ZamHeadX2UI.cpp | 4 | ||||
-rw-r--r-- | plugins/ZamHeadX2/ZamHeadX2UI.hpp | 2 | ||||
-rw-r--r-- | plugins/ZamVerb/DistrhoPluginInfo.h | 3 | ||||
-rw-r--r-- | plugins/ZamVerb/ZamVerbPlugin.cpp | 41 | ||||
-rw-r--r-- | plugins/ZamVerb/ZamVerbPlugin.hpp | 6 | ||||
-rw-r--r-- | plugins/ZamVerb/ZamVerbUI.cpp | 4 | ||||
-rw-r--r-- | plugins/ZamVerb/ZamVerbUI.hpp | 1 |
11 files changed, 50 insertions, 98 deletions
diff --git a/dpf b/dpf -Subproject e8405098f40d0730ef4cdb4bb743897f6e7472a +Subproject 29be789407cf14f4b074159c5bbf5cbbba4701c diff --git a/plugins/ZamHeadX2/DistrhoPluginInfo.h b/plugins/ZamHeadX2/DistrhoPluginInfo.h index a5fb549..ba918d7 100644 --- a/plugins/ZamHeadX2/DistrhoPluginInfo.h +++ b/plugins/ZamHeadX2/DistrhoPluginInfo.h @@ -31,8 +31,7 @@ #define DISTRHO_PLUGIN_WANT_LATENCY 0 #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 -#define DISTRHO_PLUGIN_WANT_STATE 1 -#define DISTRHO_PLUGIN_WANT_FULL_STATE 1 +#define DISTRHO_PLUGIN_WANT_STATE 0 #define DISTRHO_PLUGIN_WANT_TIMEPOS 0 #define DISTRHO_PLUGIN_IS_RT_SAFE 1 diff --git a/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp b/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp index af45b4f..7b5db22 100644 --- a/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp +++ b/plugins/ZamHeadX2/ZamHeadX2Plugin.cpp @@ -23,7 +23,7 @@ START_NAMESPACE_DISTRHO // ----------------------------------------------------------------------- ZamHeadX2Plugin::ZamHeadX2Plugin() - : Plugin(paramCount, 1, 1) + : Plugin(paramCount, 1, 0) { signal = false; swap = 0; @@ -133,13 +133,10 @@ float ZamHeadX2Plugin::getParameterValue(uint32_t index) const { case paramAzimuth: return azimuth; - break; case paramElevation: return elevation; - break; case paramWidth: return width; - break; } return 0.f; } @@ -150,11 +147,11 @@ void ZamHeadX2Plugin::setParameterValue(uint32_t index, float value) { case paramAzimuth: azimuth = value; - setState("reload", ""); + reload(); break; case paramElevation: elevation = value; - setState("reload", ""); + reload(); break; case paramWidth: width = value; @@ -167,7 +164,7 @@ void ZamHeadX2Plugin::setParameterValue(uint32_t index, float value) void ZamHeadX2Plugin::activate() { - setState("reload", ""); + reload(); signal = true; } @@ -176,49 +173,34 @@ void ZamHeadX2Plugin::deactivate() signal = false; } -String ZamHeadX2Plugin::getState(const char*) const -{ - return String(""); -} - -void ZamHeadX2Plugin::initState(unsigned int index, String& key, String& defval) +void ZamHeadX2Plugin::reload() { - if (index == 0) { - key = String("reload"); - } - defval = String(""); -} - -void ZamHeadX2Plugin::setState(const char* key, const char*) -{ - uint8_t other = 0; - char elev[4] = { 0 }; - char azim[4] = { 0 }; - int az = 0; - int el = 0; - - if (strcmp(key, "reload") == 0) { - el = (int)((elevation + 45.) * 24. / 135.); - if (el >= 24) el = 24; - if (el < 0) el = 0; - az = (int)((azimuth + 90.) * 49. / 360.); - if (az >= 49) az = 49; - if (az < 0) az = 0; - if (az > 24) az = 49 - az; - snprintf(elev, 3, "%d", el); - snprintf(azim, 3, "%d", az); - if ((az != azold) || (el != elold)) { - other = !active; - signal = false; - clv[other]->clv_release(); - clv[other]->clv_configure("convolution.ir.preset", elev, azim); - clv[other]->clv_initialize(getSampleRate(), 2, 2, getBufferSize()); - swap = other; - signal = true; - } - azold = az; - elold = el; - } + uint8_t other = 0; + char elev[4] = { 0 }; + char azim[4] = { 0 }; + int az = 0; + int el = 0; + + el = (int)((elevation + 45.) * 24. / 135.); + if (el >= 24) el = 24; + if (el < 0) el = 0; + az = (int)((azimuth + 90.) * 49. / 360.); + if (az >= 49) az = 49; + if (az < 0) az = 0; + if (az > 24) az = 49 - az; + snprintf(elev, 3, "%d", el); + snprintf(azim, 3, "%d", az); + if ((az != azold) || (el != elold)) { + other = !active; + signal = false; + clv[other]->clv_release(); + clv[other]->clv_configure("convolution.ir.preset", elev, azim); + clv[other]->clv_initialize(getSampleRate(), 2, 2, getBufferSize()); + swap = other; + signal = true; + } + azold = az; + elold = el; } diff --git a/plugins/ZamHeadX2/ZamHeadX2Plugin.hpp b/plugins/ZamHeadX2/ZamHeadX2Plugin.hpp index 3268e17..dcf1d44 100644 --- a/plugins/ZamHeadX2/ZamHeadX2Plugin.hpp +++ b/plugins/ZamHeadX2/ZamHeadX2Plugin.hpp @@ -89,9 +89,7 @@ protected: void setParameterValue(uint32_t index, float value) override; void loadProgram(uint32_t index); - String getState(const char*) const override; - void initState(unsigned int index, String& key, String& defval) override; - void setState(const char* key, const char*) override; + void reload(); // ------------------------------------------------------------------- // Process diff --git a/plugins/ZamHeadX2/ZamHeadX2UI.cpp b/plugins/ZamHeadX2/ZamHeadX2UI.cpp index aeee784..460a17c 100644 --- a/plugins/ZamHeadX2/ZamHeadX2UI.cpp +++ b/plugins/ZamHeadX2/ZamHeadX2UI.cpp @@ -120,10 +120,6 @@ void ZamHeadX2UI::onDisplay() fImgBackground.draw(context); } -void ZamHeadX2UI::stateChanged(const char*, const char*) -{ -} - // ----------------------------------------------------------------------- UI* createUI() diff --git a/plugins/ZamHeadX2/ZamHeadX2UI.hpp b/plugins/ZamHeadX2/ZamHeadX2UI.hpp index 0ef1332..ac4f1a3 100644 --- a/plugins/ZamHeadX2/ZamHeadX2UI.hpp +++ b/plugins/ZamHeadX2/ZamHeadX2UI.hpp @@ -51,8 +51,6 @@ protected: void onDisplay() override; - void stateChanged(const char*, const char*) override; - private: Image fImgBackground; ScopedPointer<ZamKnob> fKnobAzimuth, fKnobElevation, fKnobWidth; diff --git a/plugins/ZamVerb/DistrhoPluginInfo.h b/plugins/ZamVerb/DistrhoPluginInfo.h index 64a7104..7960342 100644 --- a/plugins/ZamVerb/DistrhoPluginInfo.h +++ b/plugins/ZamVerb/DistrhoPluginInfo.h @@ -31,8 +31,7 @@ #define DISTRHO_PLUGIN_WANT_LATENCY 0 #define DISTRHO_PLUGIN_WANT_PROGRAMS 1 -#define DISTRHO_PLUGIN_WANT_STATE 1 -#define DISTRHO_PLUGIN_WANT_FULL_STATE 1 +#define DISTRHO_PLUGIN_WANT_STATE 0 #define DISTRHO_PLUGIN_WANT_TIMEPOS 0 #define DISTRHO_UI_DEFAULT_WIDTH ZamVerbArtwork::zamverbWidth diff --git a/plugins/ZamVerb/ZamVerbPlugin.cpp b/plugins/ZamVerb/ZamVerbPlugin.cpp index a625f6f..da62c57 100644 --- a/plugins/ZamVerb/ZamVerbPlugin.cpp +++ b/plugins/ZamVerb/ZamVerbPlugin.cpp @@ -22,7 +22,7 @@ START_NAMESPACE_DISTRHO // ----------------------------------------------------------------------- ZamVerbPlugin::ZamVerbPlugin() - : Plugin(paramCount, 1, 1) // 1 program, 1 states + : Plugin(paramCount, 1, 0) // 1 program, 0 states { signal = false; swap = 0; @@ -89,7 +89,7 @@ void ZamVerbPlugin::initParameter(uint32_t index, Parameter& parameter) parameter.ranges.max = 100.f; break; case paramRoom: - parameter.hints = kParameterIsAutomatable | kParameterIsInteger; + parameter.hints = kParameterIsInteger; parameter.name = "Room"; parameter.symbol = "room"; parameter.unit = " "; @@ -141,7 +141,7 @@ void ZamVerbPlugin::setParameterValue(uint32_t index, float value) break; case paramRoom: room = value; - setState("reload", ""); + reload(); break; } } @@ -164,7 +164,7 @@ void ZamVerbPlugin::loadProgram(uint32_t index) void ZamVerbPlugin::activate() { - setState("reload", ""); + reload(); signal = true; } @@ -173,34 +173,19 @@ void ZamVerbPlugin::deactivate() signal = false; } -String ZamVerbPlugin::getState(const char*) const -{ - return String(""); -} - -void ZamVerbPlugin::initState(unsigned int index, String& key, String& defval) -{ - if (index == 0) { - key = String("reload"); - } - defval = String(""); -} - -void ZamVerbPlugin::setState(const char* key, const char*) +void ZamVerbPlugin::reload() { uint8_t other; char preset[2] = { 0 }; - if (strcmp(key, "reload") == 0) { - snprintf(preset, 2, "%d", (int)room); - other = !active; - signal = false; - clv[other]->clv_release(); - clv[other]->clv_configure("convolution.ir.preset", preset); - clv[other]->clv_initialize(getSampleRate(), 2, 2, getBufferSize()); - swap = other; - signal = true; - } + snprintf(preset, 2, "%d", (int)room); + other = !active; + signal = false; + clv[other]->clv_release(); + clv[other]->clv_configure("convolution.ir.preset", preset); + clv[other]->clv_initialize(getSampleRate(), 2, 2, getBufferSize()); + swap = other; + signal = true; } void ZamVerbPlugin::run(const float** inputs, float** outputs, uint32_t frames) diff --git a/plugins/ZamVerb/ZamVerbPlugin.hpp b/plugins/ZamVerb/ZamVerbPlugin.hpp index 5c2a814..8c81814 100644 --- a/plugins/ZamVerb/ZamVerbPlugin.hpp +++ b/plugins/ZamVerb/ZamVerbPlugin.hpp @@ -88,9 +88,9 @@ protected: float getParameterValue(uint32_t index) const override; void setParameterValue(uint32_t index, float value) override; void loadProgram(uint32_t index) override; - void setState(const char *key, const char *index) override; - String getState(const char* key) const override; - void initState(unsigned int index, String& key, String& defval) override; + + void reload(); + // ------------------------------------------------------------------- // Process diff --git a/plugins/ZamVerb/ZamVerbUI.cpp b/plugins/ZamVerb/ZamVerbUI.cpp index a5ec755..55f3cb8 100644 --- a/plugins/ZamVerb/ZamVerbUI.cpp +++ b/plugins/ZamVerb/ZamVerbUI.cpp @@ -98,10 +98,6 @@ void ZamVerbUI::programLoaded(uint32_t index) fSliderNotch->setValue(0.0f); } -void ZamVerbUI::stateChanged(const char*, const char*) -{ -} - // ----------------------------------------------------------------------- // Widget Callbacks diff --git a/plugins/ZamVerb/ZamVerbUI.hpp b/plugins/ZamVerb/ZamVerbUI.hpp index ade08b4..0616cde 100644 --- a/plugins/ZamVerb/ZamVerbUI.hpp +++ b/plugins/ZamVerb/ZamVerbUI.hpp @@ -41,7 +41,6 @@ protected: void parameterChanged(uint32_t index, float value) override; void programLoaded(uint32_t index) override; - void stateChanged(const char*, const char*) override; // ------------------------------------------------------------------- // Widget Callbacks |