1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-21 01:24:21 +00:00

Added an assertion to warn if a plugin reports no programs, because this can cause problems in some Sony hosts.

This commit is contained in:
jules 2014-06-17 08:54:41 +01:00
parent 20020a83fe
commit 8a2af98497
2 changed files with 6 additions and 2 deletions

View file

@ -56,10 +56,10 @@ public:
double getTailLengthSeconds() const override;
//==============================================================================
int getNumPrograms() override { return 0; }
int getNumPrograms() override { return 1; }
int getCurrentProgram() override { return 0; }
void setCurrentProgram (int /*index*/) override {}
const String getProgramName (int /*index*/) override { return String::empty; }
const String getProgramName (int /*index*/) override { return "Default"; }
void changeProgramName (int /*index*/, const String& /*newName*/) override {}
//==============================================================================

View file

@ -281,6 +281,10 @@ public:
setInitialDelay (filter->getLatencySamples());
programsAreChunks (true);
// NB: For reasons best known to themselves, some hosts fail to load/save plugin
// state correctly if the plugin doesn't report that it has at least 1 program.
jassert (af->getNumPrograms() > 0);
activePlugins.add (this);
}