DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 249c2e047060e105122698dfabfc979dcb8cbcb7
parent 07de97ba7201ae22705a4f1101afa0f853c845ae
Author: falkTX <falktx@falktx.com>
Date:   Tue,  8 Feb 2022 22:47:01 +0000

Fix build

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mdistrho/DistrhoPlugin.hpp | 2+-
Mdistrho/src/DistrhoPlugin.cpp | 27++++++++++++++++++++-------
Mexamples/FileHandling/FileHandlingPlugin.cpp | 6+++---
3 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/distrho/DistrhoPlugin.hpp b/distrho/DistrhoPlugin.hpp @@ -1026,7 +1026,7 @@ protected: #if DISTRHO_PLUGIN_WANT_STATEFILES DISTRHO_DEPRECATED_BY("getStateHints") - virtual bool isStateFile(uint32_t index) { return false; } + virtual bool isStateFile(uint32_t) { return false; } #endif /* -------------------------------------------------------------------------------------------------------- diff --git a/distrho/src/DistrhoPlugin.cpp b/distrho/src/DistrhoPlugin.cpp @@ -181,10 +181,6 @@ void Plugin::initProgramName(uint32_t, String&) {} void Plugin::initState(uint32_t, String&, String&) {} #endif -#if DISTRHO_PLUGIN_WANT_STATEFILES -bool Plugin::isStateFile(uint32_t) { return false; } -#endif - /* ------------------------------------------------------------------------------------------------------------ * Init */ @@ -202,12 +198,29 @@ String Plugin::getState(const char*) const { return String(); } #if DISTRHO_PLUGIN_WANT_STATE uint32_t Plugin::getStateHints(const uint32_t index) { - #if DISTRHO_PLUGIN_WANT_STATEFILES - if isStateFile(index) - return kStateIsFilenamePath; + #if DISTRHO_PLUGIN_WANT_STATEFILES + #if defined(__clang__) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" + #endif + if (isStateFile(index)) + #if defined(__clang__) + #pragma clang diagnostic pop + #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) + #pragma GCC diagnostic pop #endif + return kStateIsFilenamePath; + #endif return 0x0; + + #if !DISTRHO_PLUGIN_WANT_STATEFILES + // unused + (void)index; + #endif } void Plugin::setState(const char*, const char*) {} diff --git a/examples/FileHandling/FileHandlingPlugin.cpp b/examples/FileHandling/FileHandlingPlugin.cpp @@ -149,17 +149,17 @@ protected: /** TODO API under construction */ - bool isStateFile(uint32_t index) override + uint32_t getStateHints(uint32_t index) override { switch (index) { case kStateFile1: case kStateFile2: case kStateFile3: - return true; + return kStateIsFilenamePath; } - return false; + return 0x0; } /* --------------------------------------------------------------------------------------------------------