@@ -799,15 +799,6 @@ CARLA_EXPORT float carla_get_input_peak_value(uint pluginId, bool isLeft); | |||
*/ | |||
CARLA_EXPORT float carla_get_output_peak_value(uint pluginId, bool isLeft); | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Enable a plugin's option. | |||
* @param pluginId Plugin | |||
* @param option An option from PluginOptions | |||
* @param yesNo New enabled state | |||
*/ | |||
CARLA_EXPORT void carla_set_option(uint pluginId, uint option, bool yesNo); | |||
/*! | |||
* Enable or disable a plugin. | |||
* @param pluginId Plugin | |||
@@ -815,6 +806,7 @@ CARLA_EXPORT void carla_set_option(uint pluginId, uint option, bool yesNo); | |||
*/ | |||
CARLA_EXPORT void carla_set_active(uint pluginId, bool onOff); | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Change a plugin's internal dry/wet. | |||
* @param pluginId Plugin | |||
@@ -856,6 +848,14 @@ CARLA_EXPORT void carla_set_panning(uint pluginId, float value); | |||
* @param channel New channel | |||
*/ | |||
CARLA_EXPORT void carla_set_ctrl_channel(uint pluginId, int8_t channel); | |||
/*! | |||
* Enable a plugin's option. | |||
* @param pluginId Plugin | |||
* @param option An option from PluginOptions | |||
* @param yesNo New enabled state | |||
*/ | |||
CARLA_EXPORT void carla_set_option(uint pluginId, uint option, bool yesNo); | |||
#endif | |||
/*! | |||
@@ -1932,18 +1932,6 @@ float carla_get_output_peak_value(uint pluginId, bool isLeft) | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
#ifndef BUILD_BRIDGE | |||
void carla_set_option(uint pluginId, uint option, bool yesNo) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); | |||
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, false); | |||
carla_stderr2("carla_set_option(%i, %i, %s) - could not find plugin", pluginId, option, bool2str(yesNo)); | |||
} | |||
void carla_set_active(uint pluginId, bool onOff) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); | |||
@@ -1955,6 +1943,7 @@ void carla_set_active(uint pluginId, bool onOff) | |||
carla_stderr2("carla_set_active(%i, %s) - could not find plugin", pluginId, bool2str(onOff)); | |||
} | |||
#ifndef BUILD_BRIDGE | |||
void carla_set_drywet(uint pluginId, float value) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); | |||
@@ -2021,6 +2010,17 @@ void carla_set_ctrl_channel(uint pluginId, int8_t channel) | |||
carla_stderr2("carla_set_ctrl_channel(%i, %i) - could not find plugin", pluginId, channel); | |||
} | |||
void carla_set_option(uint pluginId, uint option, bool yesNo) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); | |||
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, false); | |||
carla_stderr2("carla_set_option(%i, %i, %s) - could not find plugin", pluginId, option, bool2str(yesNo)); | |||
} | |||
#endif | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
@@ -447,9 +447,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
else | |||
#endif // ! BUILD_BRIDGE | |||
{ | |||
#ifndef BUILD_BRIDGE | |||
bool use16Outs; | |||
#endif | |||
setLastError("Invalid or unsupported plugin type"); | |||
switch (ptype) | |||
@@ -458,7 +456,6 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
break; | |||
case PLUGIN_INTERNAL: | |||
#ifndef BUILD_BRIDGE | |||
/*if (std::strcmp(label, "FluidSynth") == 0) | |||
{ | |||
use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0); | |||
@@ -480,7 +477,6 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
plugin = CarlaPlugin::newLinuxSampler(initializer, "SFZ", use16Outs); | |||
}*/ | |||
plugin = CarlaPlugin::newNative(initializer); | |||
#endif | |||
break; | |||
case PLUGIN_LADSPA: | |||
@@ -508,23 +504,17 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
break; | |||
case PLUGIN_GIG: | |||
#ifndef BUILD_BRIDGE | |||
use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0); | |||
plugin = CarlaPlugin::newFileGIG(initializer, use16Outs); | |||
#endif | |||
break; | |||
case PLUGIN_SF2: | |||
#ifndef BUILD_BRIDGE | |||
use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0); | |||
plugin = CarlaPlugin::newFileSF2(initializer, use16Outs); | |||
#endif | |||
break; | |||
case PLUGIN_SFZ: | |||
#ifndef BUILD_BRIDGE | |||
plugin = CarlaPlugin::newFileSFZ(initializer); | |||
#endif | |||
break; | |||
} | |||
} | |||
@@ -541,9 +531,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
pluginData.outsPeak[0] = 0.0f; | |||
pluginData.outsPeak[1] = 0.0f; | |||
#ifdef BUILD_BRIDGE | |||
plugin->setActive(true, true, true); | |||
#else | |||
#ifndef BUILD_BRIDGE | |||
if (oldPlugin != nullptr) | |||
{ | |||
// the engine thread might be reading from the old plugin | |||
@@ -388,12 +388,12 @@ public: | |||
case kPluginBridgeNonRtActivate: | |||
if (plugin != nullptr && plugin->isEnabled()) | |||
plugin->activate(); | |||
plugin->setActive(true, false, false); | |||
break; | |||
case kPluginBridgeNonRtDeactivate: | |||
if (plugin != nullptr && plugin->isEnabled()) | |||
plugin->deactivate(); | |||
plugin->setActive(false, false, false); | |||
break; | |||
case kPluginBridgeNonRtSetBufferSize: { | |||
@@ -910,7 +910,9 @@ void CarlaPlugin::setEnabled(const bool yesNo) noexcept | |||
void CarlaPlugin::setActive(const bool active, const bool sendOsc, const bool sendCallback) noexcept | |||
{ | |||
#ifndef BUILD_BRIDGE | |||
CARLA_SAFE_ASSERT_RETURN(sendOsc || sendCallback,); // never call this from RT | |||
#endif | |||
if (pData->active == active) | |||
return; | |||
@@ -494,6 +494,8 @@ int main(int argc, char* argv[]) | |||
} | |||
else | |||
{ | |||
carla_set_active(0, true); | |||
if (const CarlaPluginInfo* const pluginInfo = carla_get_plugin_info(0)) | |||
{ | |||
if (pluginInfo->hints & CarlaBackend::PLUGIN_HAS_CUSTOM_UI) | |||