Browse Source

States in VST (using chunks) confirmed working 100%, remove warning

gh-pages
falkTX 11 years ago
parent
commit
77ed9260b2
1 changed files with 3 additions and 8 deletions
  1. +3
    -8
      distrho/src/DistrhoPluginVST.cpp

+ 3
- 8
distrho/src/DistrhoPluginVST.cpp View File

@@ -56,9 +56,6 @@ struct ERect {
# include "vst/aeffectx.h"
#endif

#if DISTRHO_PLUGIN_WANT_STATE
# warning VST State still TODO (working but needs final testing)
#endif
#if DISTRHO_PLUGIN_WANT_TIMEPOS
# warning VST TimePos still TODO (only basic BBT working)
#endif
@@ -444,7 +441,7 @@ public:
fVstUi->idle();

#if DISTRHO_PLUGIN_WANT_STATE
if (fStateMap.size() > 0)
if (fPlugin.getStateCount() == 0)
{
for (StringMap::const_iterator cit=fStateMap.cbegin(), cite=fStateMap.cend(); cit != cite; ++cit)
{
@@ -488,7 +485,7 @@ public:
fStateChunk = nullptr;
}

if (fStateMap.size() == 0)
if (fPlugin.getStateCount() == 0)
{
fStateChunk = new char[1];
fStateChunk[0] = '\0';
@@ -516,8 +513,8 @@ public:
const std::size_t chunkSize(chunkStr.length()+1);

fStateChunk = new char[chunkSize];
std::memset(fStateChunk, 0, chunkSize);
std::memcpy(fStateChunk, chunkStr.buffer(), chunkStr.length());
fStateChunk[chunkSize] = '\0';

for (std::size_t i=0; i<chunkSize; ++i)
{
@@ -545,8 +542,6 @@ public:

value = key+(std::strlen(key)+1);

d_stdout("setting state \"%s\" | \"%s\"", key, value);

setStateFromUi(key, value);

if (fVstUi != nullptr)


Loading…
Cancel
Save