Signed-off-by: falkTX <falktx@falktx.com>tags/v2.1-rc1
@@ -20,6 +20,7 @@ | |||
#ifdef HAVE_FLUIDSYNTH | |||
#include "CarlaBackendUtils.hpp" | |||
#include "CarlaMathUtils.hpp" | |||
#include "water/text/StringArray.h" | |||
@@ -1684,16 +1685,20 @@ public: | |||
} | |||
// --------------------------------------------------------------- | |||
// set default options | |||
// set options | |||
pData->options = 0x0; | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
pData->options = 0x0; | |||
if (options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CONTROL_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)) | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_PITCHBEND)) | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_ALL_SOUND_OFF)) | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_MAP_PROGRAM_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
return true; | |||
} | |||
@@ -1353,7 +1353,7 @@ public: | |||
} | |||
// --------------------------------------------------------------- | |||
// set default options | |||
// set options | |||
pData->options = 0x0; | |||
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS; | |||
@@ -1361,20 +1361,25 @@ public: | |||
if (fInstance->acceptsMidi()) | |||
{ | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
if (options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CONTROL_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; | |||
if (options & PLUGIN_OPTION_SEND_PROGRAM_CHANGES) | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)) | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH)) | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_PITCHBEND)) | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_ALL_SOUND_OFF)) | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_PROGRAM_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_SEND_PROGRAM_CHANGES; | |||
} | |||
if (fInstance->getNumPrograms() > 1 && ((pData->options & PLUGIN_OPTION_SEND_PROGRAM_CHANGES) == 0)) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
{ | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_MAP_PROGRAM_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
} | |||
return true; | |||
} | |||
@@ -2947,7 +2947,7 @@ public: | |||
#endif | |||
// --------------------------------------------------------------- | |||
// set default options | |||
// set options | |||
pData->options = 0x0; | |||
@@ -24,6 +24,7 @@ | |||
#include "CarlaLv2Utils.hpp" | |||
#include "CarlaBackendUtils.hpp" | |||
#include "CarlaBase64Utils.hpp" | |||
#include "CarlaEngineUtils.hpp" | |||
#include "CarlaPipeUtils.hpp" | |||
@@ -5864,7 +5865,7 @@ public: | |||
recheckExtensions(); | |||
// --------------------------------------------------------------- | |||
// set default options | |||
// set options | |||
pData->options = 0x0; | |||
@@ -5880,19 +5881,25 @@ public: | |||
if (getMidiInCount() != 0) | |||
{ | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
if (options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CONTROL_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; | |||
if (options & PLUGIN_OPTION_SEND_PROGRAM_CHANGES) | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)) | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH)) | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_PITCHBEND)) | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_ALL_SOUND_OFF)) | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_PROGRAM_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_SEND_PROGRAM_CHANGES; | |||
} | |||
if (fExt.programs != nullptr && (pData->options & PLUGIN_OPTION_SEND_PROGRAM_CHANGES) == 0) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
{ | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_MAP_PROGRAM_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
} | |||
// --------------------------------------------------------------- | |||
// gui stuff | |||
@@ -18,6 +18,7 @@ | |||
#include "CarlaPluginInternal.hpp" | |||
#include "CarlaEngine.hpp" | |||
#include "CarlaBackendUtils.hpp" | |||
#include "CarlaMathUtils.hpp" | |||
#include "CarlaNative.h" | |||
@@ -2831,7 +2832,7 @@ public: | |||
} | |||
// --------------------------------------------------------------- | |||
// set default options | |||
// set options | |||
bool hasMidiProgs = false; | |||
@@ -2854,28 +2855,39 @@ public: | |||
else if (options & PLUGIN_OPTION_FORCE_STEREO) | |||
pData->options |= PLUGIN_OPTION_FORCE_STEREO; | |||
if (fDescriptor->supports & NATIVE_PLUGIN_SUPPORTS_CONTROL_CHANGES) | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CONTROL_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; | |||
if (fDescriptor->supports & NATIVE_PLUGIN_SUPPORTS_CHANNEL_PRESSURE) | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)) | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
if (fDescriptor->supports & NATIVE_PLUGIN_SUPPORTS_NOTE_AFTERTOUCH) | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH)) | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
if (fDescriptor->supports & NATIVE_PLUGIN_SUPPORTS_PITCHBEND) | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
if (fDescriptor->supports & NATIVE_PLUGIN_SUPPORTS_ALL_SOUND_OFF) | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_PITCHBEND)) | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
if (fDescriptor->supports & NATIVE_PLUGIN_SUPPORTS_CONTROL_CHANGES) | |||
{ | |||
if (options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) | |||
pData->options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; | |||
} | |||
if (fDescriptor->supports & NATIVE_PLUGIN_SUPPORTS_ALL_SOUND_OFF) | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_ALL_SOUND_OFF)) | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
if (fDescriptor->supports & NATIVE_PLUGIN_SUPPORTS_PROGRAM_CHANGES) | |||
{ | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_PROGRAM_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_SEND_PROGRAM_CHANGES; | |||
// makes no sense for a plugin to set program changes supported, but it has no midi programs | |||
CARLA_SAFE_ASSERT(! hasMidiProgs); | |||
pData->options |= PLUGIN_OPTION_SEND_PROGRAM_CHANGES; | |||
} | |||
else if (hasMidiProgs) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
{ | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_MAP_PROGRAM_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
} | |||
return true; | |||
} | |||
@@ -16,6 +16,7 @@ | |||
*/ | |||
#include "CarlaPluginInternal.hpp" | |||
#include "CarlaBackendUtils.hpp" | |||
#include "CarlaEngine.hpp" | |||
#include "sfzero/SFZero.h" | |||
@@ -750,18 +751,22 @@ public: | |||
} | |||
// --------------------------------------------------------------- | |||
// set default options | |||
// set options | |||
pData->options = 0x0; | |||
pData->options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
pData->options = 0x0; | |||
return true; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CONTROL_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)) | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH)) | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_PITCHBEND)) | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_ALL_SOUND_OFF)) | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
(void)options; | |||
return true; | |||
} | |||
// ------------------------------------------------------------------- | |||
@@ -22,6 +22,7 @@ | |||
# define USE_JUCE_FOR_VST2 | |||
#endif | |||
#include "CarlaBackendUtils.hpp" | |||
#include "CarlaMathUtils.hpp" | |||
#include "CarlaScopeUtils.hpp" | |||
#include "CarlaVstUtils.hpp" | |||
@@ -2267,12 +2268,14 @@ protected: | |||
bool hasMidiInput() const noexcept | |||
{ | |||
return (canDo("receiveVstEvents") || canDo("receiveVstMidiEvent") || (fEffect->flags & effFlagsIsSynth) > 0 || (pData->hints & PLUGIN_WANTS_MIDI_INPUT)); | |||
return (fEffect->flags & effFlagsIsSynth) != 0 || | |||
(pData->hints & PLUGIN_WANTS_MIDI_INPUT) != 0 || | |||
canDo("receiveVstEvents") || canDo("receiveVstMidiEvent"); | |||
} | |||
bool hasMidiOutput() const noexcept | |||
{ | |||
return (canDo("sendVstEvents") || canDo("sendVstMidiEvent")); | |||
return canDo("sendVstEvents") || canDo("sendVstMidiEvent"); | |||
} | |||
// ------------------------------------------------------------------- | |||
@@ -2500,28 +2503,29 @@ public: | |||
pData->options = 0x0; | |||
if (pData->latency.frames != 0 || hasMidiOutput()) | |||
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS; | |||
else if (options & PLUGIN_OPTION_FIXED_BUFFERS) | |||
if (pData->latency.frames != 0 || hasMidiOutput() || isPluginOptionEnabled(options, PLUGIN_OPTION_FIXED_BUFFERS)) | |||
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS; | |||
if (fEffect->numPrograms > 1) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
if (fEffect->numPrograms > 1 || hasMidiInput()) | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_MAP_PROGRAM_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
if (fEffect->flags & effFlagsProgramChunks) | |||
pData->options |= PLUGIN_OPTION_USE_CHUNKS; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_USE_CHUNKS)) | |||
pData->options |= PLUGIN_OPTION_USE_CHUNKS; | |||
if (hasMidiInput()) | |||
{ | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
if (options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CONTROL_CHANGES)) | |||
pData->options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; | |||
if (options & PLUGIN_OPTION_MAP_PROGRAM_CHANGES) | |||
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_CHANNEL_PRESSURE)) | |||
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH)) | |||
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_PITCHBEND)) | |||
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | |||
if (isPluginOptionEnabled(options, PLUGIN_OPTION_SEND_ALL_SOUND_OFF)) | |||
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | |||
} | |||
return true; | |||