Browse Source

Add and use PLUGIN_EXTRA_HINT_USES_MULTI_PROGS flag

tags/1.9.4
falkTX 11 years ago
parent
commit
4b6cb0d5a0
7 changed files with 17 additions and 9 deletions
  1. +1
    -1
      source/backend/plugin/CarlaPlugin.cpp
  2. +4
    -3
      source/backend/plugin/CarlaPluginInternal.hpp
  3. +3
    -1
      source/backend/plugin/FluidSynthPlugin.cpp
  4. +3
    -1
      source/backend/plugin/LinuxSamplerPlugin.cpp
  5. +3
    -0
      source/backend/plugin/NativePlugin.cpp
  6. +2
    -2
      source/modules/native-plugins/zynaddsubfx-synth.cpp
  7. +1
    -1
      source/plugin/carla-native-base.cpp

+ 1
- 1
source/backend/plugin/CarlaPlugin.cpp View File

@@ -547,7 +547,7 @@ const SaveState& CarlaPlugin::getSaveState()
void CarlaPlugin::loadSaveState(const SaveState& saveState) void CarlaPlugin::loadSaveState(const SaveState& saveState)
{ {
char strBuf[STR_MAX+1]; char strBuf[STR_MAX+1];
const bool usesMultiProgs(getType() == PLUGIN_FILE_GIG || getType() == PLUGIN_FILE_SF2 || (getType() == PLUGIN_INTERNAL && getCategory() == PLUGIN_CATEGORY_SYNTH));
const bool usesMultiProgs(pData->extraHints & PLUGIN_EXTRA_HINT_USES_MULTI_PROGS);


gIsLoadingProject = true; gIsLoadingProject = true;
ScopedValueSetter<bool>(gIsLoadingProject, false); ScopedValueSetter<bool>(gIsLoadingProject, false);


+ 4
- 3
source/backend/plugin/CarlaPluginInternal.hpp View File

@@ -57,9 +57,10 @@ const unsigned short kPluginMaxMidiEvents = 512;
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Extra plugin hints, hidden from backend // Extra plugin hints, hidden from backend


const unsigned int PLUGIN_EXTRA_HINT_HAS_MIDI_IN = 0x01;
const unsigned int PLUGIN_EXTRA_HINT_HAS_MIDI_OUT = 0x02;
const unsigned int PLUGIN_EXTRA_HINT_CAN_RUN_RACK = 0x04;
const unsigned int PLUGIN_EXTRA_HINT_HAS_MIDI_IN = 0x01;
const unsigned int PLUGIN_EXTRA_HINT_HAS_MIDI_OUT = 0x02;
const unsigned int PLUGIN_EXTRA_HINT_CAN_RUN_RACK = 0x04;
const unsigned int PLUGIN_EXTRA_HINT_USES_MULTI_PROGS = 0x08;


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------




+ 3
- 1
source/backend/plugin/FluidSynthPlugin.cpp View File

@@ -926,7 +926,9 @@ public:
pData->extraHints = 0x0; pData->extraHints = 0x0;
pData->extraHints |= PLUGIN_EXTRA_HINT_HAS_MIDI_IN; pData->extraHints |= PLUGIN_EXTRA_HINT_HAS_MIDI_IN;


if (! fUses16Outs)
if (fUses16Outs)
pData->extraHints |= PLUGIN_EXTRA_HINT_USES_MULTI_PROGS;
else
pData->extraHints |= PLUGIN_EXTRA_HINT_CAN_RUN_RACK; pData->extraHints |= PLUGIN_EXTRA_HINT_CAN_RUN_RACK;


bufferSizeChanged(pData->engine->getBufferSize()); bufferSizeChanged(pData->engine->getBufferSize());


+ 3
- 1
source/backend/plugin/LinuxSamplerPlugin.cpp View File

@@ -611,7 +611,9 @@ public:
pData->extraHints = 0x0; pData->extraHints = 0x0;
pData->extraHints |= PLUGIN_EXTRA_HINT_HAS_MIDI_IN; pData->extraHints |= PLUGIN_EXTRA_HINT_HAS_MIDI_IN;


if (! fUses16Outs)
if (fUses16Outs)
pData->extraHints |= PLUGIN_EXTRA_HINT_USES_MULTI_PROGS;
else
pData->extraHints |= PLUGIN_EXTRA_HINT_CAN_RUN_RACK; pData->extraHints |= PLUGIN_EXTRA_HINT_CAN_RUN_RACK;


bufferSizeChanged(pData->engine->getBufferSize()); bufferSizeChanged(pData->engine->getBufferSize());


+ 3
- 0
source/backend/plugin/NativePlugin.cpp View File

@@ -1077,6 +1077,9 @@ public:
if (aIns <= 2 && aOuts <= 2 && (aIns == aOuts || aIns == 0 || aOuts == 0) && mIns <= 1 && mOuts <= 1) if (aIns <= 2 && aOuts <= 2 && (aIns == aOuts || aIns == 0 || aOuts == 0) && mIns <= 1 && mOuts <= 1)
pData->extraHints |= PLUGIN_EXTRA_HINT_CAN_RUN_RACK; pData->extraHints |= PLUGIN_EXTRA_HINT_CAN_RUN_RACK;


if (fDescriptor->hints & ::PLUGIN_USES_MULTI_PROGS)
pData->extraHints |= PLUGIN_EXTRA_HINT_USES_MULTI_PROGS;

bufferSizeChanged(pData->engine->getBufferSize()); bufferSizeChanged(pData->engine->getBufferSize());
reloadPrograms(true); reloadPrograms(true);




+ 2
- 2
source/modules/native-plugins/zynaddsubfx-synth.cpp View File

@@ -789,9 +789,9 @@ public:
static const NativePluginDescriptor zynaddsubfxDesc = { static const NativePluginDescriptor zynaddsubfxDesc = {
/* category */ PLUGIN_CATEGORY_SYNTH, /* category */ PLUGIN_CATEGORY_SYNTH,
#ifdef WANT_ZYNADDSUBFX_UI #ifdef WANT_ZYNADDSUBFX_UI
/* hints */ static_cast<NativePluginHints>(PLUGIN_IS_SYNTH|PLUGIN_HAS_UI|PLUGIN_USES_STATE),
/* hints */ static_cast<NativePluginHints>(PLUGIN_IS_SYNTH|PLUGIN_HAS_UI|PLUGIN_USES_MULTI_PROGS|PLUGIN_USES_STATE),
#else #else
/* hints */ static_cast<NativePluginHints>(PLUGIN_IS_SYNTH|PLUGIN_USES_STATE),
/* hints */ static_cast<NativePluginHints>(PLUGIN_IS_SYNTH|PLUGIN_USES_MULTI_PROGS|PLUGIN_USES_STATE),
#endif #endif
/* supports */ static_cast<NativePluginSupports>(PLUGIN_SUPPORTS_CONTROL_CHANGES|PLUGIN_SUPPORTS_NOTE_AFTERTOUCH|PLUGIN_SUPPORTS_PITCHBEND|PLUGIN_SUPPORTS_ALL_SOUND_OFF), /* supports */ static_cast<NativePluginSupports>(PLUGIN_SUPPORTS_CONTROL_CHANGES|PLUGIN_SUPPORTS_NOTE_AFTERTOUCH|PLUGIN_SUPPORTS_PITCHBEND|PLUGIN_SUPPORTS_ALL_SOUND_OFF),
/* audioIns */ 0, /* audioIns */ 0,


+ 1
- 1
source/plugin/carla-native-base.cpp View File

@@ -1,6 +1,6 @@
/* /*
* Carla Native Plugins * Carla Native Plugins
* Copyright (C) 2013 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2013-2014 Filipe Coelho <falktx@falktx.com>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as


Loading…
Cancel
Save