Browse Source

Force fixed-size buffers if a plugin has midi-out(s)

tags/1.9.4
falkTX 11 years ago
parent
commit
00385c5027
3 changed files with 23 additions and 6 deletions
  1. +3
    -3
      source/backend/plugin/Lv2Plugin.cpp
  2. +10
    -2
      source/backend/plugin/NativePlugin.cpp
  3. +10
    -1
      source/backend/plugin/VstPlugin.cpp

+ 3
- 3
source/backend/plugin/Lv2Plugin.cpp View File

@@ -659,7 +659,7 @@ public:


options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


if (! needsFixedBuffer())
if (midiInCount() == 0 || ! needsFixedBuffer())
options |= PLUGIN_OPTION_FIXED_BUFFER; options |= PLUGIN_OPTION_FIXED_BUFFER;


if (kData->engine->getProccessMode() != PROCESS_MODE_CONTINUOUS_RACK) if (kData->engine->getProccessMode() != PROCESS_MODE_CONTINUOUS_RACK)
@@ -4169,7 +4169,7 @@ public:


fOptions |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; fOptions |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


if (needsFixedBuffer())
if (midiInCount() > 0 || needsFixedBuffer())
fOptions |= PLUGIN_OPTION_FIXED_BUFFER; fOptions |= PLUGIN_OPTION_FIXED_BUFFER;


if (kData->engine->getOptions().forceStereo) if (kData->engine->getOptions().forceStereo)
@@ -4189,7 +4189,7 @@ public:
fOptions = kData->loadSettings(fOptions, availableOptions()); fOptions = kData->loadSettings(fOptions, availableOptions());


// ignore settings, we need this anyway // ignore settings, we need this anyway
if (needsFixedBuffer())
if (midiInCount() > 0 || needsFixedBuffer())
fOptions |= PLUGIN_OPTION_FIXED_BUFFER; fOptions |= PLUGIN_OPTION_FIXED_BUFFER;
} }




+ 10
- 2
source/backend/plugin/NativePlugin.cpp View File

@@ -289,9 +289,11 @@ public:


unsigned int options = 0x0; unsigned int options = 0x0;


options |= PLUGIN_OPTION_FIXED_BUFFER;
options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


if (midiInCount() == 0)
options |= PLUGIN_OPTION_FIXED_BUFFER;

if (kData->engine->getProccessMode() != PROCESS_MODE_CONTINUOUS_RACK) if (kData->engine->getProccessMode() != PROCESS_MODE_CONTINUOUS_RACK)
{ {
if (fOptions & PLUGIN_OPTION_FORCE_STEREO) if (fOptions & PLUGIN_OPTION_FORCE_STEREO)
@@ -2137,9 +2139,11 @@ public:
// set default options // set default options
fOptions = 0x0; fOptions = 0x0;


fOptions |= PLUGIN_OPTION_FIXED_BUFFER;
fOptions |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; fOptions |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


if (midiInCount() > 0)
fOptions |= PLUGIN_OPTION_FIXED_BUFFER;

if (kData->engine->getOptions().forceStereo) if (kData->engine->getOptions().forceStereo)
fOptions |= PLUGIN_OPTION_FORCE_STEREO; fOptions |= PLUGIN_OPTION_FORCE_STEREO;


@@ -2155,6 +2159,10 @@ public:
kData->idStr = "Native/"; kData->idStr = "Native/";
kData->idStr += label; kData->idStr += label;
fOptions = kData->loadSettings(fOptions, availableOptions()); fOptions = kData->loadSettings(fOptions, availableOptions());

// ignore settings, we need this anyway
if (midiInCount() > 0)
fOptions |= PLUGIN_OPTION_FIXED_BUFFER;
} }


return true; return true;


+ 10
- 1
source/backend/plugin/VstPlugin.cpp View File

@@ -192,9 +192,11 @@ public:


unsigned int options = 0x0; unsigned int options = 0x0;


options |= PLUGIN_OPTION_FIXED_BUFFER;
options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


if (midiInCount() == 0)
options |= PLUGIN_OPTION_FIXED_BUFFER;

if (fEffect->flags & effFlagsProgramChunks) if (fEffect->flags & effFlagsProgramChunks)
options |= PLUGIN_OPTION_USE_CHUNKS; options |= PLUGIN_OPTION_USE_CHUNKS;


@@ -2291,6 +2293,9 @@ public:


fOptions |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; fOptions |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


if (midiInCount() > 0)
fOptions |= PLUGIN_OPTION_FIXED_BUFFER;

if (fEffect->flags & effFlagsProgramChunks) if (fEffect->flags & effFlagsProgramChunks)
fOptions |= PLUGIN_OPTION_USE_CHUNKS; fOptions |= PLUGIN_OPTION_USE_CHUNKS;


@@ -2308,6 +2313,10 @@ public:
kData->idStr += "/"; kData->idStr += "/";
kData->idStr += CarlaString(uniqueId()); kData->idStr += CarlaString(uniqueId());
fOptions = kData->loadSettings(fOptions, availableOptions()); fOptions = kData->loadSettings(fOptions, availableOptions());

// ignore settings, we need this anyway
if (midiInCount() > 0)
fOptions |= PLUGIN_OPTION_FIXED_BUFFER;
} }


return true; return true;


Loading…
Cancel
Save