Browse Source

Save plugin options in projects, added ENGINE_CALLBACK_OPTION_CHANGED

tags/1.9.4
falkTX 10 years ago
parent
commit
0ff470a035
26 changed files with 259 additions and 436 deletions
  1. +36
    -27
      source/backend/CarlaBackend.h
  2. +1
    -1
      source/backend/CarlaPlugin.hpp
  3. +1
    -1
      source/backend/CarlaStandalone.cpp
  4. +1
    -1
      source/backend/engine/CarlaEngineNative.cpp
  5. +16
    -4
      source/backend/plugin/CarlaPlugin.cpp
  6. +0
    -106
      source/backend/plugin/CarlaPluginInternal.cpp
  7. +0
    -12
      source/backend/plugin/CarlaPluginInternal.hpp
  8. +19
    -44
      source/backend/plugin/DssiPlugin.cpp
  9. +6
    -25
      source/backend/plugin/FluidSynthPlugin.cpp
  10. +11
    -30
      source/backend/plugin/JucePlugin.cpp
  11. +8
    -27
      source/backend/plugin/LadspaPlugin.cpp
  12. +6
    -26
      source/backend/plugin/LinuxSamplerPlugin.cpp
  13. +13
    -31
      source/backend/plugin/Lv2Plugin.cpp
  14. +1
    -1
      source/backend/plugin/Makefile
  15. +17
    -34
      source/backend/plugin/NativePlugin.cpp
  16. +12
    -39
      source/backend/plugin/VstPlugin.cpp
  17. +1
    -0
      source/carla
  18. +34
    -27
      source/carla_backend.py
  19. +3
    -0
      source/carla_host.py
  20. +14
    -0
      source/carla_patchbay.py
  21. +14
    -0
      source/carla_rack.py
  22. +8
    -0
      source/carla_skin.py
  23. +26
    -0
      source/carla_widgets.py
  24. +2
    -0
      source/utils/CarlaBackendUtils.hpp
  25. +8
    -0
      source/utils/CarlaStateUtils.cpp
  26. +1
    -0
      source/utils/CarlaStateUtils.hpp

+ 36
- 27
source/backend/CarlaBackend.h View File

@@ -729,6 +729,15 @@ typedef enum {
*/
ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED = 10,

/*!
* A plugin option has changed.
* @param pluginId Plugin Id
* @param value1 Option
* @param value2 New on/off state (1 for on, 0 for off)
* @see PluginOptions
*/
ENGINE_CALLBACK_OPTION_CHANGED = 11,

/*!
* A plugin's custom UI state has changed.
* @param pluginId Plugin Id
@@ -737,7 +746,7 @@ typedef enum {
* 1: UI is now visible\n
* -1: UI has crashed and should not be shown again
*/
ENGINE_CALLBACK_UI_STATE_CHANGED = 11,
ENGINE_CALLBACK_UI_STATE_CHANGED = 12,

/*!
* A note has been pressed.
@@ -746,7 +755,7 @@ typedef enum {
* @param value2 Note
* @param value3 Velocity
*/
ENGINE_CALLBACK_NOTE_ON = 12,
ENGINE_CALLBACK_NOTE_ON = 13,

/*!
* A note has been released.
@@ -754,37 +763,37 @@ typedef enum {
* @param value1 Channel
* @param value2 Note
*/
ENGINE_CALLBACK_NOTE_OFF = 13,
ENGINE_CALLBACK_NOTE_OFF = 14,

/*!
* A plugin needs update.
* @param pluginId Plugin Id
*/
ENGINE_CALLBACK_UPDATE = 14,
ENGINE_CALLBACK_UPDATE = 15,

/*!
* A plugin's data/information has changed.
* @param pluginId Plugin Id
*/
ENGINE_CALLBACK_RELOAD_INFO = 15,
ENGINE_CALLBACK_RELOAD_INFO = 16,

/*!
* A plugin's parameters have changed.
* @param pluginId Plugin Id
*/
ENGINE_CALLBACK_RELOAD_PARAMETERS = 16,
ENGINE_CALLBACK_RELOAD_PARAMETERS = 17,

/*!
* A plugin's programs have changed.
* @param pluginId Plugin Id
*/
ENGINE_CALLBACK_RELOAD_PROGRAMS = 17,
ENGINE_CALLBACK_RELOAD_PROGRAMS = 18,

/*!
* A plugin state has changed.
* @param pluginId Plugin Id
*/
ENGINE_CALLBACK_RELOAD_ALL = 18,
ENGINE_CALLBACK_RELOAD_ALL = 19,

/*!
* A patchbay client has been added.
@@ -794,20 +803,20 @@ typedef enum {
* @param valueStr Client name
* @see PatchbayIcon
*/
ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED = 19,
ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED = 20,

/*!
* A patchbay client has been removed.
* @param pluginId Client Id
*/
ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED = 20,
ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED = 21,

/*!
* A patchbay client has been renamed.
* @param pluginId Client Id
* @param valueStr New client name
*/
ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED = 21,
ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED = 22,

/*!
* A patchbay client data has changed.
@@ -816,7 +825,7 @@ typedef enum {
* @param value2 New plugin Id (-1 if not a plugin)
* @see PatchbayIcon
*/
ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED = 22,
ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED = 23,

/*!
* A patchbay port has been added.
@@ -826,14 +835,14 @@ typedef enum {
* @param valueStr Port name
* @see PatchbayPortHints
*/
ENGINE_CALLBACK_PATCHBAY_PORT_ADDED = 23,
ENGINE_CALLBACK_PATCHBAY_PORT_ADDED = 24,

/*!
* A patchbay port has been removed.
* @param pluginId Client Id
* @param value1 Port Id
*/
ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED = 24,
ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED = 25,

/*!
* A patchbay port has been renamed.
@@ -841,20 +850,20 @@ typedef enum {
* @param value1 Port Id
* @param valueStr New port name
*/
ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED = 25,
ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED = 26,

/*!
* A patchbay connection has been added.
* @param pluginId Connection Id
* @param valueStr Out group and port plus in group and port, in "og:op:ig:ip" syntax.
*/
ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED = 26,
ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED = 27,

/*!
* A patchbay connection has been removed.
* @param pluginId Connection Id
*/
ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED = 27,
ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED = 28,

/*!
* Engine started.
@@ -864,62 +873,62 @@ typedef enum {
* @see EngineProcessMode
* @see EngineTransportMode
*/
ENGINE_CALLBACK_ENGINE_STARTED = 28,
ENGINE_CALLBACK_ENGINE_STARTED = 29,

/*!
* Engine stopped.
*/
ENGINE_CALLBACK_ENGINE_STOPPED = 29,
ENGINE_CALLBACK_ENGINE_STOPPED = 30,

/*!
* Engine process mode has changed.
* @param value1 New process mode
* @see EngineProcessMode
*/
ENGINE_CALLBACK_PROCESS_MODE_CHANGED = 30,
ENGINE_CALLBACK_PROCESS_MODE_CHANGED = 31,

/*!
* Engine transport mode has changed.
* @param value1 New transport mode
* @see EngineTransportMode
*/
ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED = 31,
ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED = 32,

/*!
* Engine buffer-size changed.
* @param value1 New buffer size
*/
ENGINE_CALLBACK_BUFFER_SIZE_CHANGED = 32,
ENGINE_CALLBACK_BUFFER_SIZE_CHANGED = 33,

/*!
* Engine sample-rate changed.
* @param value3 New sample rate
*/
ENGINE_CALLBACK_SAMPLE_RATE_CHANGED = 33,
ENGINE_CALLBACK_SAMPLE_RATE_CHANGED = 34,

/*!
* Idle frontend.\n
* This is used by the engine during long operations that might block the frontend,
* giving it the possibility to idle while the operation is still in place.
*/
ENGINE_CALLBACK_IDLE = 34,
ENGINE_CALLBACK_IDLE = 35,

/*!
* Show a message as information.
* @param valueStr The message
*/
ENGINE_CALLBACK_INFO = 35,
ENGINE_CALLBACK_INFO = 36,

/*!
* Show a message as an error.
* @param valueStr The message
*/
ENGINE_CALLBACK_ERROR = 36,
ENGINE_CALLBACK_ERROR = 37,

/*!
* The engine has crashed or malfunctioned and will no longer work.
*/
ENGINE_CALLBACK_QUIT = 37
ENGINE_CALLBACK_QUIT = 38

} EngineCallbackOpcode;



+ 1
- 1
source/backend/CarlaPlugin.hpp View File

@@ -430,7 +430,7 @@ public:
*
* \see getOptions() and getAvailableOptions()
*/
void setOption(const uint option, const bool yesNo);
void setOption(const uint option, const bool yesNo, const bool sendCallback);

/*!
* Enable or disable the plugin according to \a yesNo. \n


+ 1
- 1
source/backend/CarlaStandalone.cpp View File

@@ -2069,7 +2069,7 @@ void carla_set_option(uint pluginId, uint option, bool yesNo)
carla_debug("carla_set_option(%i, %i, %s)", pluginId, option, bool2str(yesNo));

if (CarlaPlugin* const plugin = gStandalone.engine->getPlugin(pluginId))
return plugin->setOption(option, yesNo);
return plugin->setOption(option, yesNo, false);

carla_stderr2("carla_set_option(%i, %i, %s) - could not find plugin", pluginId, option, bool2str(yesNo));
}


+ 1
- 1
source/backend/engine/CarlaEngineNative.cpp View File

@@ -296,7 +296,7 @@ protected:
CARLA_SAFE_ASSERT_RETURN(readNextLineAsBool(yesNo), true);

if (CarlaPlugin* const plugin = fEngine->getPlugin(pluginId))
plugin->setOption(option, yesNo);
plugin->setOption(option, yesNo, false);
}
else if (std::strcmp(msg, "set_active") == 0)
{


+ 16
- 4
source/backend/plugin/CarlaPlugin.cpp View File

@@ -528,6 +528,8 @@ const StateSave& CarlaPlugin::getStateSave()
pData->stateSave.name = carla_strdup(pData->name);
pData->stateSave.label = carla_strdup(strBuf);
pData->stateSave.uniqueId = getUniqueId();
pData->stateSave.options = pData->options;
carla_stdout("Options: 0x%x | 0x%x", pData->options, pData->stateSave.options);

if (pData->filename != nullptr)
pData->stateSave.binary = carla_strdup(pData->filename);
@@ -844,6 +846,17 @@ void CarlaPlugin::loadStateSave(const StateSave& stateSave)
// ---------------------------------------------------------------
// Part 6 - set internal stuff

const uint availOptions(getOptionsAvailable());

for (int i=0; i<10; ++i) // FIXME - get this value somehow...
{
const uint option(1 << i);

if (availOptions & option)
setOption(option, (stateSave.options & option) != 0, true);

}

#ifndef BUILD_BRIDGE
setDryWet(stateSave.dryWet, true, true);
setVolume(stateSave.volume, true, true);
@@ -918,7 +931,7 @@ void CarlaPlugin::setName(const char* const newName)
pData->name = carla_strdup(newName);
}

void CarlaPlugin::setOption(const uint option, const bool yesNo)
void CarlaPlugin::setOption(const uint option, const bool yesNo, const bool sendCallback)
{
CARLA_SAFE_ASSERT_RETURN(getOptionsAvailable() & option,);

@@ -927,9 +940,8 @@ void CarlaPlugin::setOption(const uint option, const bool yesNo)
else
pData->options &= ~option;

#ifndef BUILD_BRIDGE
pData->saveSetting(option, yesNo);
#endif
if (sendCallback)
pData->engine->callback(ENGINE_CALLBACK_OPTION_CHANGED, pData->id, option, yesNo ? 1 : 0, 0.0f, nullptr);
}

void CarlaPlugin::setEnabled(const bool yesNo) noexcept


+ 0
- 106
source/backend/plugin/CarlaPluginInternal.cpp View File

@@ -21,17 +21,8 @@
#include "CarlaLibCounter.hpp"
#include "CarlaMathUtils.hpp"

// FIXME
#include <QtCore/QSettings>

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

CARLA_BACKEND_START_NAMESPACE

#if 0
} // Fix editor indentation
#endif

// -------------------------------------------------------------------
// Fallback data

@@ -465,9 +456,6 @@ CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx
name(nullptr),
filename(nullptr),
iconName(nullptr),
#ifndef BUILD_BRIDGE
identifier(nullptr),
#endif
osc(eng, plug) {}

CarlaPlugin::ProtectedData::~ProtectedData() noexcept
@@ -516,14 +504,6 @@ CarlaPlugin::ProtectedData::~ProtectedData() noexcept
iconName = nullptr;
}

#ifndef BUILD_BRIDGE
if (identifier != nullptr)
{
delete[] identifier;
identifier = nullptr;
}
#endif

for (LinkedList<CustomData>::Itenerator it = custom.begin(); it.valid(); it.next())
{
CustomData& cData(it.getValue());
@@ -704,91 +684,6 @@ void* CarlaPlugin::ProtectedData::uiLibSymbol(const char* const symbol) const no
return lib_symbol(uiLib, symbol);
}

#ifndef BUILD_BRIDGE
// -----------------------------------------------------------------------
// Settings functions

void CarlaPlugin::ProtectedData::saveSetting(const uint option, const bool yesNo) const
{
CARLA_SAFE_ASSERT_RETURN(identifier != nullptr && identifier[0] != '\0',);

QSettings settings("falkTX", "CarlaPluginSettings");
settings.beginGroup(identifier);

switch (option)
{
case PLUGIN_OPTION_FIXED_BUFFERS:
settings.setValue("FixedBuffers", yesNo);
break;
case PLUGIN_OPTION_FORCE_STEREO:
settings.setValue("ForceStereo", yesNo);
break;
case PLUGIN_OPTION_MAP_PROGRAM_CHANGES:
settings.setValue("MapProgramChanges", yesNo);
break;
case PLUGIN_OPTION_USE_CHUNKS:
settings.setValue("UseChunks", yesNo);
break;
case PLUGIN_OPTION_SEND_CONTROL_CHANGES:
settings.setValue("SendControlChanges", yesNo);
break;
case PLUGIN_OPTION_SEND_CHANNEL_PRESSURE:
settings.setValue("SendChannelPressure", yesNo);
break;
case PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH:
settings.setValue("SendNoteAftertouch", yesNo);
break;
case PLUGIN_OPTION_SEND_PITCHBEND:
settings.setValue("SendPitchbend", yesNo);
break;
case PLUGIN_OPTION_SEND_ALL_SOUND_OFF:
settings.setValue("SendAllSoundOff", yesNo);
break;
default:
break;
}

settings.endGroup();
}

uint CarlaPlugin::ProtectedData::loadSettings(const uint curOptions, const uint availOptions) const
{
CARLA_SAFE_ASSERT_RETURN(identifier != nullptr && identifier[0] != '\0', 0x0);

QSettings settings("falkTX", "CarlaPluginSettings");
settings.beginGroup(identifier);

uint newOptions = 0x0;

#define CHECK_AND_SET_OPTION(STR, BIT) \
if ((availOptions & BIT) != 0 || BIT == PLUGIN_OPTION_FORCE_STEREO) \
{ \
if (settings.contains(STR)) \
{ \
if (settings.value(STR, bool((curOptions & BIT) != 0)).toBool()) \
newOptions |= BIT; \
} \
else if (curOptions & BIT) \
newOptions |= BIT; \
}

CHECK_AND_SET_OPTION("FixedBuffers", PLUGIN_OPTION_FIXED_BUFFERS);
CHECK_AND_SET_OPTION("ForceStereo", PLUGIN_OPTION_FORCE_STEREO);
CHECK_AND_SET_OPTION("MapProgramChanges", PLUGIN_OPTION_MAP_PROGRAM_CHANGES);
CHECK_AND_SET_OPTION("UseChunks", PLUGIN_OPTION_USE_CHUNKS);
CHECK_AND_SET_OPTION("SendControlChanges", PLUGIN_OPTION_SEND_CONTROL_CHANGES);
CHECK_AND_SET_OPTION("SendChannelPressure", PLUGIN_OPTION_SEND_CHANNEL_PRESSURE);
CHECK_AND_SET_OPTION("SendNoteAftertouch", PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH);
CHECK_AND_SET_OPTION("SendPitchbend", PLUGIN_OPTION_SEND_PITCHBEND);
CHECK_AND_SET_OPTION("SendAllSoundOff", PLUGIN_OPTION_SEND_ALL_SOUND_OFF);

#undef CHECK_AND_SET_OPTION

settings.endGroup();

return newOptions;
}

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

void CarlaPlugin::ProtectedData::tryTransient() noexcept
@@ -796,7 +691,6 @@ void CarlaPlugin::ProtectedData::tryTransient() noexcept
if (engine->getOptions().frontendWinId != 0)
transientTryCounter = 1;
}
#endif

void CarlaPlugin::ProtectedData::updateParameterValues(CarlaPlugin* const plugin, const bool sendOsc, const bool sendCallback, const bool useDefault) noexcept
{


+ 0
- 12
source/backend/plugin/CarlaPluginInternal.hpp View File

@@ -240,9 +240,6 @@ struct CarlaPlugin::ProtectedData {
const char* name;
const char* filename;
const char* iconName;
#ifndef BUILD_BRIDGE
const char* identifier; // used for save/restore settings per plugin
#endif

// data 2
PluginAudioData audioIn;
@@ -345,19 +342,10 @@ struct CarlaPlugin::ProtectedData {
bool uiLibClose() noexcept;
void* uiLibSymbol(const char* const symbol) const noexcept;

#ifndef BUILD_BRIDGE
// -------------------------------------------------------------------
// Settings functions

void saveSetting(const uint option, const bool yesNo) const;
uint loadSettings(const uint options, const uint availOptions) const;

// -------------------------------------------------------------------
// Misc

void tryTransient() noexcept;
#endif

void updateParameterValues(CarlaPlugin* const plugin, const bool sendOsc, const bool sendCallback, const bool useDefault) noexcept;

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


+ 19
- 44
source/backend/plugin/DssiPlugin.cpp View File

@@ -2103,60 +2103,35 @@ public:
}

// ---------------------------------------------------------------
// load plugin settings
// set default options

{
#ifdef __USE_GNU
const bool isDssiVst(strcasestr(pData->filename, "dssi-vst") != nullptr);
const bool isDssiVst(strcasestr(pData->filename, "dssi-vst") != nullptr);
#else
const bool isDssiVst(std::strstr(pData->filename, "dssi-vst") != nullptr);
const bool isDssiVst(std::strstr(pData->filename, "dssi-vst") != nullptr);
#endif

// set default options
pData->options = 0x0;

pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

if (fLatencyIndex >= 0 || isDssiVst)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
pData->options = 0x0;
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

if (pData->engine->getOptions().forceStereo)
pData->options |= PLUGIN_OPTION_FORCE_STEREO;

if (fUsesCustomData)
pData->options |= PLUGIN_OPTION_USE_CHUNKS;

if (fDssiDescriptor->run_synth != nullptr || fDssiDescriptor->run_multiple_synths != nullptr)
{
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 (fDssiDescriptor->run_synth == nullptr)
carla_stderr("WARNING: Plugin can ONLY use run_multiple_synths!");
}
if (fLatencyIndex >= 0 || isDssiVst)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;

#ifndef BUILD_BRIDGE
// set identifier string
CarlaString identifier("DSSI/");

if (const char* const shortname = std::strrchr(filename, OS_SEP))
{
identifier += shortname+1;
identifier += ",";
}
if (pData->engine->getOptions().forceStereo)
pData->options |= PLUGIN_OPTION_FORCE_STEREO;

identifier += label;
pData->identifier = identifier.dup();
if (fUsesCustomData)
pData->options |= PLUGIN_OPTION_USE_CHUNKS;

// load settings
pData->options = pData->loadSettings(pData->options, getOptionsAvailable());
if (fDssiDescriptor->run_synth != nullptr || fDssiDescriptor->run_multiple_synths != nullptr)
{
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;

// ignore settings, we need this anyway
if (fLatencyIndex >= 0 || isDssiVst)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
#endif
if (fDssiDescriptor->run_synth == nullptr)
carla_stderr("WARNING: Plugin can ONLY use run_multiple_synths!");
}

return true;


+ 6
- 25
source/backend/plugin/FluidSynthPlugin.cpp View File

@@ -1621,32 +1621,13 @@ public:
}

// ---------------------------------------------------------------
// load plugin settings
// set default options

{
// set default 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;

#ifndef BUILD_BRIDGE
// set identifier string
CarlaString identifier("SF2/");

if (const char* const shortname = std::strrchr(filename, OS_SEP))
identifier += shortname+1;
else
identifier += label;

pData->identifier = identifier.dup();

// load settings
pData->options = pData->loadSettings(pData->options, getOptionsAvailable());
#endif
}
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;

return true;
}


+ 11
- 30
source/backend/plugin/JucePlugin.cpp View File

@@ -1101,38 +1101,19 @@ public:
}

// ---------------------------------------------------------------
// load plugin settings
// set default options

{
// set default options
pData->options = 0x0;

pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;
//pData->options |= PLUGIN_OPTION_USE_CHUNKS;

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;
}

#ifndef BUILD_BRIDGE
// set identifier string
String juceId(fDesc.createIdentifierString());

CarlaString identifier("Juce/");
identifier += juceId.toRawUTF8();
pData->identifier = identifier.dup();

// load settings
pData->options = pData->loadSettings(pData->options, getOptionsAvailable());
pData->options = 0x0;
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;
//pData->options |= PLUGIN_OPTION_USE_CHUNKS;

// ignore settings, we need this anyway
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
#endif
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;
}

return true;


+ 8
- 27
source/backend/plugin/LadspaPlugin.cpp View File

@@ -1604,40 +1604,21 @@ public:
}

// ---------------------------------------------------------------
// load plugin settings
// set default options

{
#ifdef __USE_GNU
const bool isDssiVst(strcasestr(pData->filename, "dssi-vst") != nullptr);
const bool isDssiVst(strcasestr(pData->filename, "dssi-vst") != nullptr);
#else
const bool isDssiVst(std::strstr(pData->filename, "dssi-vst") != nullptr);
const bool isDssiVst(std::strstr(pData->filename, "dssi-vst") != nullptr);
#endif

// set default options
pData->options = 0x0;

if (fLatencyIndex >= 0 || isDssiVst)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
pData->options = 0x0;

if (pData->engine->getOptions().forceStereo)
pData->options |= PLUGIN_OPTION_FORCE_STEREO;
if (fLatencyIndex >= 0 || isDssiVst)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;

#ifndef BUILD_BRIDGE
// set identifier string
CarlaString identifier("LADSPA/");
identifier += CarlaString(getUniqueId());
identifier += ",";
identifier += label;
pData->identifier = identifier.dup();

// load settings
pData->options = pData->loadSettings(pData->options, getOptionsAvailable());

// ignore settings, we need this anyway
if (fLatencyIndex >= 0 || isDssiVst)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
#endif
}
if (pData->engine->getOptions().forceStereo)
pData->options |= PLUGIN_OPTION_FORCE_STEREO;

return true;
}


+ 6
- 26
source/backend/plugin/LinuxSamplerPlugin.cpp View File

@@ -1304,33 +1304,13 @@ public:
}

// ---------------------------------------------------------------
// load plugin settings
// set default options

{
// set default 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;

#ifndef BUILD_BRIDGE
// set identifier string
CarlaString identifier(fFormat);
identifier += "/";

if (const char* const shortname = std::strrchr(filename, OS_SEP))
identifier += shortname+1;
else
identifier += label;

pData->identifier = identifier.dup();

// load settings
pData->options = pData->loadSettings(pData->options, getOptionsAvailable());
#endif
}
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;

return true;
}


+ 13
- 31
source/backend/plugin/Lv2Plugin.cpp View File

@@ -4758,41 +4758,23 @@ public:
}

// ---------------------------------------------------------------
// load plugin settings
// set default options

{
// set default options
pData->options = 0x0;

pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

if (fLatencyIndex >= 0 || getMidiInCount() > 0 || needsFixedBuffer())
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
pData->options = 0x0;
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

if (pData->engine->getOptions().forceStereo)
pData->options |= PLUGIN_OPTION_FORCE_STEREO;

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 (fLatencyIndex >= 0 || getMidiInCount() > 0 || needsFixedBuffer())
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;

#ifndef BUILD_BRIDGE
// set identifier string
CarlaString identifier("LV2/");
identifier += uri;
pData->identifier = identifier.dup();

// load settings
pData->options = pData->loadSettings(pData->options, getOptionsAvailable());
if (pData->engine->getOptions().forceStereo)
pData->options |= PLUGIN_OPTION_FORCE_STEREO;

// ignore settings, we need this anyway
if (fLatencyIndex >= 0 || getMidiInCount() > 0 || needsFixedBuffer())
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
#endif
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;
}

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


+ 1
- 1
source/backend/plugin/Makefile View File

@@ -53,7 +53,7 @@ CarlaPlugin.cpp.o: CarlaPlugin.cpp $(CARLA_PLUGIN_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@

CarlaPluginInternal.cpp.o: CarlaPluginInternal.cpp $(CARLA_PLUGIN_INTERNAL_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) $(QTCORE_FLAGS) -c -o $@
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@

CarlaPluginThread.cpp.o: CarlaPluginThread.cpp $(CARLA_PLUGIN_THREAD_CPP_DEPS)
$(CXX) $< $(BUILD_CXX_FLAGS) $(QTCORE_FLAGS) -c -o $@


+ 17
- 34
source/backend/plugin/NativePlugin.cpp View File

@@ -2326,46 +2326,29 @@ public:
}

// ---------------------------------------------------------------
// load plugin settings
// set default options

{
const bool hasMidiProgs(fDescriptor->get_midi_program_count != nullptr && fDescriptor->get_midi_program_count(fHandle) > 0);

// set default options
pData->options = 0x0;

if (hasMidiProgs && (fDescriptor->supports & ::PLUGIN_SUPPORTS_PROGRAM_CHANGES) == 0)
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

if (getMidiInCount() > 0 || (fDescriptor->hints & ::PLUGIN_NEEDS_FIXED_BUFFERS) != 0)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
const bool hasMidiProgs(fDescriptor->get_midi_program_count != nullptr && fDescriptor->get_midi_program_count(fHandle) > 0);

if (pData->engine->getOptions().forceStereo)
pData->options |= PLUGIN_OPTION_FORCE_STEREO;
pData->options = 0x0;

if (fDescriptor->supports & ::PLUGIN_SUPPORTS_CHANNEL_PRESSURE)
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE;
if (fDescriptor->supports & ::PLUGIN_SUPPORTS_NOTE_AFTERTOUCH)
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH;
if (fDescriptor->supports & ::PLUGIN_SUPPORTS_PITCHBEND)
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND;
if (fDescriptor->supports & ::PLUGIN_SUPPORTS_ALL_SOUND_OFF)
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF;
if (hasMidiProgs && (fDescriptor->supports & ::PLUGIN_SUPPORTS_PROGRAM_CHANGES) == 0)
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

#ifndef BUILD_BRIDGE
// set identifier string
CarlaString identifier("Native/");
identifier += label;
pData->identifier = identifier.dup();
if (getMidiInCount() > 0 || (fDescriptor->hints & ::PLUGIN_NEEDS_FIXED_BUFFERS) != 0)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;

// load settings
pData->options = pData->loadSettings(pData->options, getOptionsAvailable());
if (pData->engine->getOptions().forceStereo)
pData->options |= PLUGIN_OPTION_FORCE_STEREO;

// ignore settings, we need this anyway
if (getMidiInCount() > 0 || (fDescriptor->hints & ::PLUGIN_NEEDS_FIXED_BUFFERS) != 0)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
#endif
}
if (fDescriptor->supports & ::PLUGIN_SUPPORTS_CHANNEL_PRESSURE)
pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE;
if (fDescriptor->supports & ::PLUGIN_SUPPORTS_NOTE_AFTERTOUCH)
pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH;
if (fDescriptor->supports & ::PLUGIN_SUPPORTS_PITCHBEND)
pData->options |= PLUGIN_OPTION_SEND_PITCHBEND;
if (fDescriptor->supports & ::PLUGIN_SUPPORTS_ALL_SOUND_OFF)
pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF;

return true;
}


+ 12
- 39
source/backend/plugin/VstPlugin.cpp View File

@@ -2306,48 +2306,21 @@ public:
}

// ---------------------------------------------------------------
// load plugin settings
// set default options

{
const bool hasMidiIn(hasMidiInput());

// set default options
pData->options = 0x0;

pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

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

if (hasMidiIn)
{
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
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;
}

#ifndef BUILD_BRIDGE
// set identifier string
CarlaString identifier("VST/");
pData->options = 0x0;
pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;

if (const char* const shortname = std::strrchr(filename, OS_SEP))
{
identifier += shortname+1;
identifier += ",";
}

identifier += CarlaString(static_cast<long>(fEffect->uniqueID));
pData->identifier = identifier.dup();

// load settings
pData->options = pData->loadSettings(pData->options, getOptionsAvailable());
if (fEffect->flags & effFlagsProgramChunks)
pData->options |= PLUGIN_OPTION_USE_CHUNKS;

// ignore settings, we need this anyway
if (hasMidiIn)
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
#endif
if (hasMidiInput())
{
pData->options |= PLUGIN_OPTION_FIXED_BUFFERS;
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;
}

return true;


+ 1
- 0
source/carla View File

@@ -87,6 +87,7 @@ class CarlaMultiW(QTabWidget):
parent.ParameterMidiCcChangedCallback.connect(self.fRack.slot_handleParameterMidiCcChangedCallback)
parent.ProgramChangedCallback.connect(self.fRack.slot_handleProgramChangedCallback)
parent.MidiProgramChangedCallback.connect(self.fRack.slot_handleMidiProgramChangedCallback)
parent.OptionChangedCallback.connect(self.fRack.slot_handleOptionChangedCallback)
parent.UiStateChangedCallback.connect(self.fRack.slot_handleUiStateChangedCallback)
parent.NoteOnCallback.connect(self.fRack.slot_handleNoteOnCallback)
parent.NoteOnCallback.connect(self.fPatchbay.slot_handleNoteOnCallback)


+ 34
- 27
source/carla_backend.py View File

@@ -540,46 +540,53 @@ ENGINE_CALLBACK_PROGRAM_CHANGED = 9
# @param value1 New MIDI program index
ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED = 10

# A plugin option has changed.
# @param pluginId Plugin Id
# @param value1 Option
# @param value2 New on/off state (1 for on, 0 for off)
# @see PluginOptions
ENGINE_CALLBACK_OPTION_CHANGED = 11

# A plugin's custom UI state has changed.
# @param pluginId Plugin Id
# @param value1 New state, as follows:
# 0: UI is now hidden
# 1: UI is now visible
# -1: UI has crashed and should not be shown again
ENGINE_CALLBACK_UI_STATE_CHANGED = 11
ENGINE_CALLBACK_UI_STATE_CHANGED = 12

# A note has been pressed.
# @param pluginId Plugin Id
# @param value1 Channel
# @param value2 Note
# @param value3 Velocity
ENGINE_CALLBACK_NOTE_ON = 12
ENGINE_CALLBACK_NOTE_ON = 13

# A note has been released.
# @param pluginId Plugin Id
# @param value1 Channel
# @param value2 Note
ENGINE_CALLBACK_NOTE_OFF = 13
ENGINE_CALLBACK_NOTE_OFF = 14

# A plugin needs update.
# @param pluginId Plugin Id
ENGINE_CALLBACK_UPDATE = 14
ENGINE_CALLBACK_UPDATE = 15

# A plugin's data/information has changed.
# @param pluginId Plugin Id
ENGINE_CALLBACK_RELOAD_INFO = 15
ENGINE_CALLBACK_RELOAD_INFO = 16

# A plugin's parameters have changed.
# @param pluginId Plugin Id
ENGINE_CALLBACK_RELOAD_PARAMETERS = 16
ENGINE_CALLBACK_RELOAD_PARAMETERS = 17

# A plugin's programs have changed.
# @param pluginId Plugin Id
ENGINE_CALLBACK_RELOAD_PROGRAMS = 17
ENGINE_CALLBACK_RELOAD_PROGRAMS = 18

# A plugin state has changed.
# @param pluginId Plugin Id
ENGINE_CALLBACK_RELOAD_ALL = 18
ENGINE_CALLBACK_RELOAD_ALL = 19

# A patchbay client has been added.
# @param pluginId Client Id
@@ -587,23 +594,23 @@ ENGINE_CALLBACK_RELOAD_ALL = 18
# @param value2 Plugin Id (-1 if not a plugin)
# @param valueStr Client name
# @see PatchbayIcon
ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED = 19
ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED = 20

# A patchbay client has been removed.
# @param pluginId Client Id
ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED = 20
ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED = 21

# A patchbay client has been renamed.
# @param pluginId Client Id
# @param valueStr New client name
ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED = 21
ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED = 22

# A patchbay client data has changed.
# @param pluginId Client Id
# @param value1 New icon
# @param value2 New plugin Id (-1 if not a plugin)
# @see PatchbayIcon
ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED = 22
ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED = 23

# A patchbay port has been added.
# @param pluginId Client Id
@@ -611,27 +618,27 @@ ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED = 22
# @param value2 Port hints
# @param valueStr Port name
# @see PatchbayPortHints
ENGINE_CALLBACK_PATCHBAY_PORT_ADDED = 23
ENGINE_CALLBACK_PATCHBAY_PORT_ADDED = 24

# A patchbay port has been removed.
# @param pluginId Client Id
# @param value1 Port Id
ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED = 24
ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED = 25

# A patchbay port has been renamed.
# @param pluginId Client Id
# @param value1 Port Id
# @param valueStr New port name
ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED = 25
ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED = 26

# A patchbay connection has been added.
# @param pluginId Connection Id
# @param valueStr Out group, port plus in group and port, in "og:op:ig:ip" syntax.
ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED = 26
ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED = 27

# A patchbay connection has been removed.
# @param pluginId Connection Id
ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED = 27
ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED = 28

# Engine started.
# @param value1 Process mode
@@ -639,44 +646,44 @@ ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED = 27
# @param valuestr Engine driver
# @see EngineProcessMode
# @see EngineTransportMode
ENGINE_CALLBACK_ENGINE_STARTED = 28
ENGINE_CALLBACK_ENGINE_STARTED = 29

# Engine stopped.
ENGINE_CALLBACK_ENGINE_STOPPED = 29
ENGINE_CALLBACK_ENGINE_STOPPED = 30

# Engine process mode has changed.
# @param value1 New process mode
# @see EngineProcessMode
ENGINE_CALLBACK_PROCESS_MODE_CHANGED = 30
ENGINE_CALLBACK_PROCESS_MODE_CHANGED = 31

# Engine transport mode has changed.
# @param value1 New transport mode
# @see EngineTransportMode
ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED = 31
ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED = 32

# Engine buffer-size changed.
# @param value1 New buffer size
ENGINE_CALLBACK_BUFFER_SIZE_CHANGED = 32
ENGINE_CALLBACK_BUFFER_SIZE_CHANGED = 33

# Engine sample-rate changed.
# @param value3 New sample rate
ENGINE_CALLBACK_SAMPLE_RATE_CHANGED = 33
ENGINE_CALLBACK_SAMPLE_RATE_CHANGED = 34

# Idle frontend.
# This is used by the engine during long operations that might block the frontend,
# giving it the possibility to idle while the operation is still in place.
ENGINE_CALLBACK_IDLE = 34
ENGINE_CALLBACK_IDLE = 35

# Show a message as information.
# @param valueStr The message
ENGINE_CALLBACK_INFO = 35
ENGINE_CALLBACK_INFO = 36

# Show a message as an error.
# @param valueStr The message
ENGINE_CALLBACK_ERROR = 36
ENGINE_CALLBACK_ERROR = 37

# The engine has crashed or malfunctioned and will no longer work.
ENGINE_CALLBACK_QUIT = 37
ENGINE_CALLBACK_QUIT = 38

# ------------------------------------------------------------------------------------------------------------
# Engine Option


+ 3
- 0
source/carla_host.py View File

@@ -134,6 +134,7 @@ class HostWindow(QMainWindow):
ParameterMidiChannelChangedCallback = pyqtSignal(int, int, int)
ProgramChangedCallback = pyqtSignal(int, int)
MidiProgramChangedCallback = pyqtSignal(int, int)
OptionChangedCallback = pyqtSignal(int, int, bool)
UiStateChangedCallback = pyqtSignal(int, int)
NoteOnCallback = pyqtSignal(int, int, int, int)
NoteOffCallback = pyqtSignal(int, int, int)
@@ -1262,6 +1263,8 @@ def engineCallback(ptr, action, pluginId, value1, value2, value3, valueStr):
gCarla.gui.ProgramChangedCallback.emit(pluginId, value1)
elif action == ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED:
gCarla.gui.MidiProgramChangedCallback.emit(pluginId, value1)
elif action == ENGINE_CALLBACK_OPTION_CHANGED:
gCarla.gui.OptionChangedCallback.emit(pluginId, value1, bool(value2))
elif action == ENGINE_CALLBACK_UI_STATE_CHANGED:
gCarla.gui.UiStateChangedCallback.emit(pluginId, value1)
elif action == ENGINE_CALLBACK_NOTE_ON:


+ 14
- 0
source/carla_patchbay.py View File

@@ -225,6 +225,7 @@ class CarlaPatchbayW(QFrame):
parent.ParameterMidiCcChangedCallback.connect(self.slot_handleParameterMidiCcChangedCallback)
parent.ProgramChangedCallback.connect(self.slot_handleProgramChangedCallback)
parent.MidiProgramChangedCallback.connect(self.slot_handleMidiProgramChangedCallback)
parent.OptionChangedCallback.connect(self.slot_handleOptionChangedCallback)
parent.NoteOnCallback.connect(self.slot_handleNoteOnCallback)
parent.NoteOffCallback.connect(self.slot_handleNoteOffCallback)
parent.UpdateCallback.connect(self.slot_handleUpdateCallback)
@@ -728,6 +729,19 @@ class CarlaPatchbayW(QFrame):

# -----------------------------------------------------------------

@pyqtSlot(int, int, bool)
def slot_handleOptionChangedCallback(self, pluginId, option, yesNo):
if pluginId >= self.fPluginCount:
return

pitem = self.fPluginList[pluginId]
if pitem is None:
return

pitem.setOption(option, yesNo)

# -----------------------------------------------------------------

@pyqtSlot(int, int, int, int)
def slot_handleNoteOnCallback(self, pluginId, channel, note, velo):
if pluginId in self.fSelectedPlugins:


+ 14
- 0
source/carla_rack.py View File

@@ -297,6 +297,7 @@ class CarlaRackW(QFrame):
parent.ParameterMidiCcChangedCallback.connect(self.slot_handleParameterMidiCcChangedCallback)
parent.ProgramChangedCallback.connect(self.slot_handleProgramChangedCallback)
parent.MidiProgramChangedCallback.connect(self.slot_handleMidiProgramChangedCallback)
parent.OptionChangedCallback.connect(self.slot_handleOptionChangedCallback)
parent.UiStateChangedCallback.connect(self.slot_handleUiStateChangedCallback)
parent.NoteOnCallback.connect(self.slot_handleNoteOnCallback)
parent.NoteOffCallback.connect(self.slot_handleNoteOffCallback)
@@ -600,6 +601,19 @@ class CarlaRackW(QFrame):

# -----------------------------------------------------------------

@pyqtSlot(int, int, bool)
def slot_handleOptionChangedCallback(self, pluginId, option, yesNo):
if pluginId >= self.fPluginCount:
return

pitem = self.fPluginList[pluginId]
if pitem is None:
return

pitem.widget.setOption(option, yesNo)

# -----------------------------------------------------------------

@pyqtSlot(int, int)
def slot_handleUiStateChangedCallback(self, pluginId, state):
if pluginId >= self.fPluginCount:


+ 8
- 0
source/carla_skin.py View File

@@ -297,6 +297,11 @@ class AbstractPluginSlot(QFrame):

#------------------------------------------------------------------

def setOption(self, option, yesNo):
self.fEditDialog.setOption(option, yesNo)

#------------------------------------------------------------------

def sendNoteOn(self, channel, note):
if self.fEditDialog.sendNoteOn(channel, note):
self.midiActivityChanged(True)
@@ -379,6 +384,9 @@ class AbstractPluginSlot(QFrame):
self.cb_presets.setCurrentIndex(index)
self.cb_presets.blockSignals(False)

def optionChanged(self, option, yesNo):
pass

def notePressed(self, note):
pass



+ 26
- 0
source/carla_widgets.py View File

@@ -942,6 +942,32 @@ class PluginEdit(QDialog):
self.ui.cb_midi_programs.setCurrentIndex(index)
self.ui.cb_midi_programs.blockSignals(False)

def setOption(self, option, yesNo):
if option == PLUGIN_OPTION_FIXED_BUFFERS:
widget = self.ui.ch_fixed_buffer
elif option == PLUGIN_OPTION_FORCE_STEREO:
widget = self.ui.ch_force_stereo
elif option == PLUGIN_OPTION_MAP_PROGRAM_CHANGES:
widget = self.ui.ch_map_program_changes
elif option == PLUGIN_OPTION_USE_CHUNKS:
widget = self.ui.ch_use_chunks
elif option == PLUGIN_OPTION_SEND_CONTROL_CHANGES:
widget = self.ui.ch_send_control_changes
elif option == PLUGIN_OPTION_SEND_CHANNEL_PRESSURE:
widget = self.ui.ch_send_channel_pressure
elif option == PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH:
widget = self.ui.ch_send_note_aftertouch
elif option == PLUGIN_OPTION_SEND_PITCHBEND:
widget = self.ui.ch_send_pitchbend
elif option == PLUGIN_OPTION_SEND_ALL_SOUND_OFF:
widget = self.ui.ch_send_all_sound_off
else:
return

widget.blockSignals(True)
widget.setChecked(yesNo)
widget.blockSignals(False)

#------------------------------------------------------------------

def sendNoteOn(self, channel, note):


+ 2
- 0
source/utils/CarlaBackendUtils.hpp View File

@@ -217,6 +217,8 @@ const char* EngineCallbackOpcode2Str(const EngineCallbackOpcode opcode) noexcept
return "ENGINE_CALLBACK_PROGRAM_CHANGED";
case ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED:
return "ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED";
case ENGINE_CALLBACK_OPTION_CHANGED:
return "ENGINE_CALLBACK_OPTION_CHANGED";
case ENGINE_CALLBACK_UI_STATE_CHANGED:
return "ENGINE_CALLBACK_UI_STATE_CHANGED";
case ENGINE_CALLBACK_NOTE_ON:


+ 8
- 0
source/utils/CarlaStateUtils.cpp View File

@@ -141,6 +141,7 @@ StateSave::StateSave() noexcept
balanceRight(1.0f),
panning(0.0f),
ctrlChannel(-1),
options(0x0),
currentProgramIndex(-1),
currentProgramName(nullptr),
currentMidiBank(-1),
@@ -193,6 +194,7 @@ void StateSave::clear() noexcept
balanceRight = 1.0f;
panning = 0.0f;
ctrlChannel = -1;
options = 0x0;
currentProgramIndex = -1;
currentMidiBank = -1;
currentMidiProgram = -1;
@@ -295,6 +297,10 @@ bool StateSave::fillFromXmlElement(const XmlElement* const xmlElement)
ctrlChannel = static_cast<int8_t>(value-1);
}
}
else if (tag.equalsIgnoreCase("options"))
{
options = text.getHexValue32();
}

// -------------------------------------------------------
// Program (current)
@@ -496,6 +502,8 @@ String StateSave::toString() const
else
dataXml << " <ControlChannel>" << int(ctrlChannel+1) << "</ControlChannel>\n";

dataXml << " <Options>0x" << String::toHexString(static_cast<int>(options)) << "</Options>\n";

content << dataXml;
}



+ 1
- 0
source/utils/CarlaStateUtils.hpp View File

@@ -76,6 +76,7 @@ struct StateSave {
float balanceRight;
float panning;
int8_t ctrlChannel;
uint options;

int32_t currentProgramIndex;
const char* currentProgramName;


Loading…
Cancel
Save