Browse Source

Fix build

Signed-off-by: falkTX <falktx@falktx.com>
pull/367/head
falkTX 3 years ago
parent
commit
249c2e0470
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 24 additions and 11 deletions
  1. +1
    -1
      distrho/DistrhoPlugin.hpp
  2. +20
    -7
      distrho/src/DistrhoPlugin.cpp
  3. +3
    -3
      examples/FileHandling/FileHandlingPlugin.cpp

+ 1
- 1
distrho/DistrhoPlugin.hpp View File

@@ -1026,7 +1026,7 @@ protected:


#if DISTRHO_PLUGIN_WANT_STATEFILES #if DISTRHO_PLUGIN_WANT_STATEFILES
DISTRHO_DEPRECATED_BY("getStateHints") DISTRHO_DEPRECATED_BY("getStateHints")
virtual bool isStateFile(uint32_t index) { return false; }
virtual bool isStateFile(uint32_t) { return false; }
#endif #endif


/* -------------------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------------------


+ 20
- 7
distrho/src/DistrhoPlugin.cpp View File

@@ -181,10 +181,6 @@ void Plugin::initProgramName(uint32_t, String&) {}
void Plugin::initState(uint32_t, String&, String&) {} void Plugin::initState(uint32_t, String&, String&) {}
#endif #endif


#if DISTRHO_PLUGIN_WANT_STATEFILES
bool Plugin::isStateFile(uint32_t) { return false; }
#endif

/* ------------------------------------------------------------------------------------------------------------ /* ------------------------------------------------------------------------------------------------------------
* Init */ * Init */


@@ -202,12 +198,29 @@ String Plugin::getState(const char*) const { return String(); }
#if DISTRHO_PLUGIN_WANT_STATE #if DISTRHO_PLUGIN_WANT_STATE
uint32_t Plugin::getStateHints(const uint32_t index) 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 #endif
return kStateIsFilenamePath;
#endif


return 0x0; return 0x0;

#if !DISTRHO_PLUGIN_WANT_STATEFILES
// unused
(void)index;
#endif
} }


void Plugin::setState(const char*, const char*) {} void Plugin::setState(const char*, const char*) {}


+ 3
- 3
examples/FileHandling/FileHandlingPlugin.cpp View File

@@ -149,17 +149,17 @@ protected:
/** /**
TODO API under construction TODO API under construction
*/ */
bool isStateFile(uint32_t index) override
uint32_t getStateHints(uint32_t index) override
{ {
switch (index) switch (index)
{ {
case kStateFile1: case kStateFile1:
case kStateFile2: case kStateFile2:
case kStateFile3: case kStateFile3:
return true;
return kStateIsFilenamePath;
} }


return false;
return 0x0;
} }


/* -------------------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------------------


Loading…
Cancel
Save