Browse Source

Misc

tags/1.9.4
falkTX 11 years ago
parent
commit
f4ee611e75
6 changed files with 28 additions and 36 deletions
  1. +9
    -9
      source/backend/CarlaHost.h
  2. +12
    -12
      source/backend/CarlaStandalone.cpp
  3. +1
    -13
      source/backend/engine/CarlaEngine.cpp
  4. +2
    -2
      source/backend/engine/CarlaEngineBridge.cpp
  5. +2
    -0
      source/backend/plugin/CarlaPlugin.cpp
  6. +2
    -0
      source/bridges-plugin/CarlaBridgePlugin.cpp

+ 9
- 9
source/backend/CarlaHost.h View File

@@ -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); 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. * Enable or disable a plugin.
* @param pluginId 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); CARLA_EXPORT void carla_set_active(uint pluginId, bool onOff);


#ifndef BUILD_BRIDGE
/*! /*!
* Change a plugin's internal dry/wet. * Change a plugin's internal dry/wet.
* @param pluginId Plugin * @param pluginId Plugin
@@ -856,6 +848,14 @@ CARLA_EXPORT void carla_set_panning(uint pluginId, float value);
* @param channel New channel * @param channel New channel
*/ */
CARLA_EXPORT void carla_set_ctrl_channel(uint pluginId, int8_t 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 #endif


/*! /*!


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

@@ -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) void carla_set_active(uint pluginId, bool onOff)
{ {
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); 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)); 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) void carla_set_drywet(uint pluginId, float value)
{ {
CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); 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); 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 #endif


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


+ 1
- 13
source/backend/engine/CarlaEngine.cpp View File

@@ -447,9 +447,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons
else else
#endif // ! BUILD_BRIDGE #endif // ! BUILD_BRIDGE
{ {
#ifndef BUILD_BRIDGE
bool use16Outs; bool use16Outs;
#endif
setLastError("Invalid or unsupported plugin type"); setLastError("Invalid or unsupported plugin type");


switch (ptype) switch (ptype)
@@ -458,7 +456,6 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons
break; break;


case PLUGIN_INTERNAL: case PLUGIN_INTERNAL:
#ifndef BUILD_BRIDGE
/*if (std::strcmp(label, "FluidSynth") == 0) /*if (std::strcmp(label, "FluidSynth") == 0)
{ {
use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 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::newLinuxSampler(initializer, "SFZ", use16Outs);
}*/ }*/
plugin = CarlaPlugin::newNative(initializer); plugin = CarlaPlugin::newNative(initializer);
#endif
break; break;


case PLUGIN_LADSPA: case PLUGIN_LADSPA:
@@ -508,23 +504,17 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons
break; break;


case PLUGIN_GIG: case PLUGIN_GIG:
#ifndef BUILD_BRIDGE
use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0); use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0);
plugin = CarlaPlugin::newFileGIG(initializer, use16Outs); plugin = CarlaPlugin::newFileGIG(initializer, use16Outs);
#endif
break; break;


case PLUGIN_SF2: case PLUGIN_SF2:
#ifndef BUILD_BRIDGE
use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0); use16Outs = (extra != nullptr && std::strcmp((const char*)extra, "true") == 0);
plugin = CarlaPlugin::newFileSF2(initializer, use16Outs); plugin = CarlaPlugin::newFileSF2(initializer, use16Outs);
#endif
break; break;


case PLUGIN_SFZ: case PLUGIN_SFZ:
#ifndef BUILD_BRIDGE
plugin = CarlaPlugin::newFileSFZ(initializer); plugin = CarlaPlugin::newFileSFZ(initializer);
#endif
break; break;
} }
} }
@@ -541,9 +531,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons
pluginData.outsPeak[0] = 0.0f; pluginData.outsPeak[0] = 0.0f;
pluginData.outsPeak[1] = 0.0f; pluginData.outsPeak[1] = 0.0f;


#ifdef BUILD_BRIDGE
plugin->setActive(true, true, true);
#else
#ifndef BUILD_BRIDGE
if (oldPlugin != nullptr) if (oldPlugin != nullptr)
{ {
// the engine thread might be reading from the old plugin // the engine thread might be reading from the old plugin


+ 2
- 2
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -388,12 +388,12 @@ public:


case kPluginBridgeNonRtActivate: case kPluginBridgeNonRtActivate:
if (plugin != nullptr && plugin->isEnabled()) if (plugin != nullptr && plugin->isEnabled())
plugin->activate();
plugin->setActive(true, false, false);
break; break;


case kPluginBridgeNonRtDeactivate: case kPluginBridgeNonRtDeactivate:
if (plugin != nullptr && plugin->isEnabled()) if (plugin != nullptr && plugin->isEnabled())
plugin->deactivate();
plugin->setActive(false, false, false);
break; break;


case kPluginBridgeNonRtSetBufferSize: { case kPluginBridgeNonRtSetBufferSize: {


+ 2
- 0
source/backend/plugin/CarlaPlugin.cpp View File

@@ -910,7 +910,9 @@ void CarlaPlugin::setEnabled(const bool yesNo) noexcept


void CarlaPlugin::setActive(const bool active, const bool sendOsc, const bool sendCallback) 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 CARLA_SAFE_ASSERT_RETURN(sendOsc || sendCallback,); // never call this from RT
#endif


if (pData->active == active) if (pData->active == active)
return; return;


+ 2
- 0
source/bridges-plugin/CarlaBridgePlugin.cpp View File

@@ -494,6 +494,8 @@ int main(int argc, char* argv[])
} }
else else
{ {
carla_set_active(0, true);

if (const CarlaPluginInfo* const pluginInfo = carla_get_plugin_info(0)) if (const CarlaPluginInfo* const pluginInfo = carla_get_plugin_info(0))
{ {
if (pluginInfo->hints & CarlaBackend::PLUGIN_HAS_CUSTOM_UI) if (pluginInfo->hints & CarlaBackend::PLUGIN_HAS_CUSTOM_UI)


Loading…
Cancel
Save