Browse Source

General cleanup

tags/1.9.4
falkTX 12 years ago
parent
commit
ce1fbe0bc1
27 changed files with 818 additions and 786 deletions
  1. +6
    -6
      source/backend/CarlaBackend.hpp
  2. +5
    -5
      source/backend/CarlaEngine.hpp
  3. +18
    -1
      source/backend/CarlaPlugin.hpp
  4. +175
    -173
      source/backend/engine/CarlaEngine.cpp
  5. +1
    -1
      source/backend/engine/CarlaEngineJack.cpp
  6. +1
    -1
      source/backend/engine/CarlaEngineOsc.cpp
  7. +1
    -1
      source/backend/engine/CarlaEngineOsc.hpp
  8. +71
    -83
      source/backend/plugin/BridgePlugin.cpp
  9. +28
    -26
      source/backend/plugin/CarlaPlugin.cpp
  10. +33
    -13
      source/backend/plugin/CarlaPluginInternal.hpp
  11. +94
    -99
      source/backend/plugin/DssiPlugin.cpp
  12. +0
    -1
      source/backend/plugin/FluidSynthPlugin.cpp
  13. +72
    -58
      source/backend/plugin/LadspaPlugin.cpp
  14. +10
    -9
      source/backend/plugin/LinuxSamplerPlugin.cpp
  15. +47
    -47
      source/backend/plugin/Lv2Plugin.cpp
  16. +8
    -12
      source/backend/plugin/NativePlugin.cpp
  17. +36
    -38
      source/backend/plugin/VstPlugin.cpp
  18. +1
    -1
      source/backend/standalone/CarlaStandalone.cpp
  19. +1
    -1
      source/bridges/CarlaBridgeOsc.hpp
  20. +32
    -32
      source/bridges/CarlaBridgeUI-LV2.cpp
  21. +20
    -20
      source/bridges/CarlaBridgeUI-VST.cpp
  22. +1
    -1
      source/carla_backend.py
  23. +32
    -32
      source/discovery/carla-discovery.cpp
  24. +1
    -1
      source/tests/ANSI.cpp
  25. +2
    -2
      source/tests/Makefile
  26. +71
    -71
      source/utils/CarlaLv2Utils.hpp
  27. +51
    -51
      source/utils/CarlaOscUtils.hpp

+ 6
- 6
source/backend/CarlaBackend.hpp View File

@@ -565,17 +565,17 @@ typedef void (*CallbackFunc)(void* ptr, CallbackType action, unsigned int plugin
*/
struct ParameterData {
ParameterType type;
int32_t index;
int32_t rindex;
int32_t hints;
uint8_t midiChannel;
int16_t midiCC;
int32_t index;
int32_t rindex;
uint32_t hints;
uint8_t midiChannel;
int16_t midiCC;

ParameterData()
: type(PARAMETER_UNKNOWN),
index(-1),
rindex(-1),
hints(0),
hints(0x0),
midiChannel(0),
midiCC(-1) {}
};


+ 5
- 5
source/backend/CarlaEngine.hpp View File

@@ -147,7 +147,7 @@ enum EngineControlEventType {
struct EngineControlEvent {
EngineControlEventType type; //!< Control-Event type.
uint16_t param; //!< Parameter ID, midi bank or midi program.
double value; //!< Parameter value, normalized to 0.0<->1.0.
float value; //!< Parameter value, normalized to 0.0f<->1.0f.

#ifndef CARLA_PROPER_CPP11_SUPPORT
EngineControlEvent()
@@ -160,7 +160,7 @@ struct EngineControlEvent {
{
type = kEngineControlEventTypeNull;
param = 0;
value = 0.0;
value = 0.0f;
}
};

@@ -588,7 +588,7 @@ public:
* Add a new port of type \a portType.
* \note This function does nothing in rack processing mode since ports are static there (2 audio + 1 event for both input and output).
*/
virtual const CarlaEnginePort* addPort(const EnginePortType portType, const char* const name, const bool isInput);
virtual CarlaEnginePort* addPort(const EnginePortType portType, const char* const name, const bool isInput);

protected:
const EngineType kEngineType;
@@ -895,9 +895,9 @@ public:
void setAboutToClose();

/*!
* Safely block-wait until the current proccessing callback ends.
* Safely block-wait until a plugin proccessing callback ends.
*/
void waitForProccessEnd();
void waitForProccessEnd(const unsigned int pluginId);

#ifndef BUILD_BRIDGE
// -------------------------------------------------------------------


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

@@ -727,7 +727,7 @@ public:
* Post pone an event of type \a type.\n
* The event will be processed later, but as soon as possible.
*/
void postponeRtEvent(const PluginPostRtEventType type, const int32_t value1, const int32_t value2, const double value3);
void postponeRtEvent(const PluginPostRtEventType type, const int32_t value1, const int32_t value2, const float value3);

/*!
* Process all the post-poned events.
@@ -836,6 +836,8 @@ protected:
friend struct CarlaPluginProtectedData;
CarlaPluginProtectedData* const kData;

// Fully disable plugin in scope and also its engine client
// May wait-block on constructor for plugin process to end
class ScopedDisabler
{
public:
@@ -848,6 +850,21 @@ protected:
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ScopedDisabler)
};

// Lock the plugin's own run/process call
// Plugin will still work as normal, but output only silence
// On destructor needsReset flag is set, as the plugin might have missed some events
class ScopedProcessLocker
{
public:
ScopedProcessLocker(CarlaPlugin* const plugin);
~ScopedProcessLocker();

private:
CarlaPlugin* const kPlugin;

CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ScopedProcessLocker)
};

private:
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaPlugin)
};


+ 175
- 173
source/backend/engine/CarlaEngine.cpp View File

@@ -306,7 +306,7 @@ void CarlaEngineClient::setLatency(const uint32_t samples)
fLatency = samples;
}

const CarlaEnginePort* CarlaEngineClient::addPort(const EnginePortType portType, const char* const name, const bool isInput)
CarlaEnginePort* CarlaEngineClient::addPort(const EnginePortType portType, const char* const name, const bool isInput)
{
carla_debug("CarlaEngineClient::addPort(%s, \"%s\", %s)", EnginePortType2Str(portType), name, bool2str(isInput));

@@ -434,7 +434,7 @@ CarlaEngine* CarlaEngine::newDriverByName(const char* const driverName)
carla_debug("CarlaEngine::newDriverByName(\"%s\")", driverName);

#ifdef WANT_JACK
if (strcmp(driverName, "JACK") == 0)
if (std::strcmp(driverName, "JACK") == 0)
return newJack();
#else
if (false)
@@ -443,31 +443,31 @@ CarlaEngine* CarlaEngine::newDriverByName(const char* const driverName)

#ifdef WANT_RTAUDIO
# ifdef __LINUX_ALSA__
else if (strcmp(driverName, "ALSA") == 0)
else if (std::strcmp(driverName, "ALSA") == 0)
return newRtAudio(RTAUDIO_LINUX_ALSA);
# endif
# ifdef __LINUX_PULSE__
else if (strcmp(driverName, "PulseAudio") == 0)
else if (std::strcmp(driverName, "PulseAudio") == 0)
return newRtAudio(RTAUDIO_LINUX_PULSE);
# endif
# ifdef __LINUX_OSS__
else if (strcmp(driverName, "OSS") == 0)
else if (std::strcmp(driverName, "OSS") == 0)
return newRtAudio(RTAUDIO_LINUX_OSS);
# endif
# ifdef __UNIX_JACK__
else if (strcmp(driverName, "JACK (RtAudio)") == 0)
else if (std::strcmp(driverName, "JACK (RtAudio)") == 0)
return newRtAudio(RTAUDIO_UNIX_JACK);
# endif
# ifdef __MACOSX_CORE__
else if (strcmp(driverName, "CoreAudio") == 0)
else if (std::strcmp(driverName, "CoreAudio") == 0)
return newRtAudio(RTAUDIO_MACOSX_CORE);
# endif
# ifdef __WINDOWS_ASIO__
else if (strcmp(driverName, "ASIO") == 0)
else if (std::strcmp(driverName, "ASIO") == 0)
return newRtAudio(RTAUDIO_WINDOWS_ASIO);
# endif
# ifdef __WINDOWS_DS__
else if (strcmp(driverName, "DirectSound") == 0)
else if (std::strcmp(driverName, "DirectSound") == 0)
return newRtAudio(RTAUDIO_WINDOWS_DS);
# endif
#endif
@@ -543,7 +543,7 @@ bool CarlaEngine::init(const char* const clientName)
#endif

#ifndef BUILD_BRIDGE
//if (strcmp(clientName, "Carla") != 0)
//if (std::strcmp(clientName, "Carla") != 0)
carla_setprocname(clientName);
#endif

@@ -739,6 +739,8 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons
if (plugin == nullptr)
return false;

plugin->registerToOscClient();

kData->plugins[id].plugin = plugin;
kData->plugins[id].insPeak[0] = 0.0f;
kData->plugins[id].insPeak[1] = 0.0f;
@@ -839,7 +841,7 @@ void CarlaEngine::removeAllPlugins()
}

// wait for processing
waitForProccessEnd();
waitForProccessEnd(0);

for (unsigned int i=0; i < oldCount; i++)
{
@@ -1104,11 +1106,11 @@ void CarlaEngine::setAboutToClose()
// -----------------------------------------------------------------------
// Misc

void CarlaEngine::waitForProccessEnd()
void CarlaEngine::waitForProccessEnd(const unsigned int pluginId)
{
carla_debug("CarlaEngine::waitForProccessEnd()");

kData->nextAction.pluginId = 0;
kData->nextAction.pluginId = pluginId;
kData->nextAction.opcode = EnginePostActionIdle;

kData->nextAction.mutex.lock();
@@ -1498,10 +1500,10 @@ void CarlaEngine::osc_send_control_add_plugin_start(const int32_t pluginId, cons

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+18];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/add_plugin_start");
lo_send(kData->oscData->target, target_path, "is", pluginId, pluginName);
char targetPath[std::strlen(kData->oscData->path)+18];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/add_plugin_start");
lo_send(kData->oscData->target, targetPath, "is", pluginId, pluginName);
}
}

@@ -1513,10 +1515,10 @@ void CarlaEngine::osc_send_control_add_plugin_end(const int32_t pluginId)

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+16];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/add_plugin_end");
lo_send(kData->oscData->target, target_path, "i", pluginId);
char targetPath[std::strlen(kData->oscData->path)+16];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/add_plugin_end");
lo_send(kData->oscData->target, targetPath, "i", pluginId);
}
}

@@ -1528,10 +1530,10 @@ void CarlaEngine::osc_send_control_remove_plugin(const int32_t pluginId)

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+15];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/remove_plugin");
lo_send(kData->oscData->target, target_path, "i", pluginId);
char targetPath[std::strlen(kData->oscData->path)+15];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/remove_plugin");
lo_send(kData->oscData->target, targetPath, "i", pluginId);
}
}

@@ -1544,10 +1546,10 @@ void CarlaEngine::osc_send_control_set_plugin_data(const int32_t pluginId, const

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+17];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_plugin_data");
lo_send(kData->oscData->target, target_path, "iiiissssh", pluginId, type, category, hints, realName, label, maker, copyright, uniqueId);
char targetPath[std::strlen(kData->oscData->path)+17];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_plugin_data");
lo_send(kData->oscData->target, targetPath, "iiiissssh", pluginId, type, category, hints, realName, label, maker, copyright, uniqueId);
}
}

@@ -1559,10 +1561,10 @@ void CarlaEngine::osc_send_control_set_plugin_ports(const int32_t pluginId, cons

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+18];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_plugin_ports");
lo_send(kData->oscData->target, target_path, "iiiiiiii", pluginId, audioIns, audioOuts, midiIns, midiOuts, cIns, cOuts, cTotals);
char targetPath[std::strlen(kData->oscData->path)+18];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_plugin_ports");
lo_send(kData->oscData->target, targetPath, "iiiiiiii", pluginId, audioIns, audioOuts, midiIns, midiOuts, cIns, cOuts, cTotals);
}
}

@@ -1576,10 +1578,10 @@ void CarlaEngine::osc_send_control_set_parameter_data(const int32_t pluginId, co

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+20];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_parameter_data");
lo_send(kData->oscData->target, target_path, "iiiissd", pluginId, index, type, hints, name, label, current);
char targetPath[std::strlen(kData->oscData->path)+20];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_parameter_data");
lo_send(kData->oscData->target, targetPath, "iiiissd", pluginId, index, type, hints, name, label, current);
}
}

@@ -1593,10 +1595,10 @@ void CarlaEngine::osc_send_control_set_parameter_ranges(const int32_t pluginId,

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+22];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_parameter_ranges");
lo_send(kData->oscData->target, target_path, "iidddddd", pluginId, index, min, max, def, step, stepSmall, stepLarge);
char targetPath[std::strlen(kData->oscData->path)+22];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_parameter_ranges");
lo_send(kData->oscData->target, targetPath, "iidddddd", pluginId, index, min, max, def, step, stepSmall, stepLarge);
}
}

@@ -1609,10 +1611,10 @@ void CarlaEngine::osc_send_control_set_parameter_midi_cc(const int32_t pluginId,

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+23];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_parameter_midi_cc");
lo_send(kData->oscData->target, target_path, "iii", pluginId, index, cc);
char targetPath[std::strlen(kData->oscData->path)+23];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_parameter_midi_cc");
lo_send(kData->oscData->target, targetPath, "iii", pluginId, index, cc);
}
}

@@ -1626,10 +1628,10 @@ void CarlaEngine::osc_send_control_set_parameter_midi_channel(const int32_t plug

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+28];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_parameter_midi_channel");
lo_send(kData->oscData->target, target_path, "iii", pluginId, index, channel);
char targetPath[std::strlen(kData->oscData->path)+28];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_parameter_midi_channel");
lo_send(kData->oscData->target, targetPath, "iii", pluginId, index, channel);
}
}

@@ -1646,10 +1648,10 @@ void CarlaEngine::osc_send_control_set_parameter_value(const int32_t pluginId, c

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+21];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_parameter_value");
lo_send(kData->oscData->target, target_path, "iid", pluginId, index, value);
char targetPath[std::strlen(kData->oscData->path)+21];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_parameter_value");
lo_send(kData->oscData->target, targetPath, "iid", pluginId, index, value);
}
}

@@ -1662,10 +1664,10 @@ void CarlaEngine::osc_send_control_set_default_value(const int32_t pluginId, con

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+19];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_default_value");
lo_send(kData->oscData->target, target_path, "iid", pluginId, index, value);
char targetPath[std::strlen(kData->oscData->path)+19];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_default_value");
lo_send(kData->oscData->target, targetPath, "iid", pluginId, index, value);
}
}

@@ -1677,10 +1679,10 @@ void CarlaEngine::osc_send_control_set_program(const int32_t pluginId, const int

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+13];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_program");
lo_send(kData->oscData->target, target_path, "ii", pluginId, index);
char targetPath[std::strlen(kData->oscData->path)+13];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_program");
lo_send(kData->oscData->target, targetPath, "ii", pluginId, index);
}
}

@@ -1693,10 +1695,10 @@ void CarlaEngine::osc_send_control_set_program_count(const int32_t pluginId, con

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+19];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_program_count");
lo_send(kData->oscData->target, target_path, "ii", pluginId, count);
char targetPath[std::strlen(kData->oscData->path)+19];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_program_count");
lo_send(kData->oscData->target, targetPath, "ii", pluginId, count);
}
}

@@ -1710,10 +1712,10 @@ void CarlaEngine::osc_send_control_set_program_name(const int32_t pluginId, cons

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+18];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_program_name");
lo_send(kData->oscData->target, target_path, "iis", pluginId, index, name);
char targetPath[std::strlen(kData->oscData->path)+18];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_program_name");
lo_send(kData->oscData->target, targetPath, "iis", pluginId, index, name);
}
}

@@ -1725,10 +1727,10 @@ void CarlaEngine::osc_send_control_set_midi_program(const int32_t pluginId, cons

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+18];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_midi_program");
lo_send(kData->oscData->target, target_path, "ii", pluginId, index);
char targetPath[std::strlen(kData->oscData->path)+18];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_midi_program");
lo_send(kData->oscData->target, targetPath, "ii", pluginId, index);
}
}

@@ -1741,10 +1743,10 @@ void CarlaEngine::osc_send_control_set_midi_program_count(const int32_t pluginId

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+24];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_midi_program_count");
lo_send(kData->oscData->target, target_path, "ii", pluginId, count);
char targetPath[std::strlen(kData->oscData->path)+24];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_midi_program_count");
lo_send(kData->oscData->target, targetPath, "ii", pluginId, count);
}
}

@@ -1760,10 +1762,10 @@ void CarlaEngine::osc_send_control_set_midi_program_data(const int32_t pluginId,

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+23];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_midi_program_data");
lo_send(kData->oscData->target, target_path, "iiiis", pluginId, index, bank, program, name);
char targetPath[std::strlen(kData->oscData->path)+23];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_midi_program_data");
lo_send(kData->oscData->target, targetPath, "iiiis", pluginId, index, bank, program, name);
}
}

@@ -1778,10 +1780,10 @@ void CarlaEngine::osc_send_control_note_on(const int32_t pluginId, const int32_t

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+9];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/note_on");
lo_send(kData->oscData->target, target_path, "iiii", pluginId, channel, note, velo);
char targetPath[std::strlen(kData->oscData->path)+9];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/note_on");
lo_send(kData->oscData->target, targetPath, "iiii", pluginId, channel, note, velo);
}
}

@@ -1795,10 +1797,10 @@ void CarlaEngine::osc_send_control_note_off(const int32_t pluginId, const int32_

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+10];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/note_off");
lo_send(kData->oscData->target, target_path, "iii", pluginId, channel, note);
char targetPath[std::strlen(kData->oscData->path)+10];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/note_off");
lo_send(kData->oscData->target, targetPath, "iii", pluginId, channel, note);
}
}

@@ -1811,10 +1813,10 @@ void CarlaEngine::osc_send_control_set_peaks(const int32_t pluginId)

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+22];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/set_peaks");
lo_send(kData->oscData->target, target_path, "iffff", pluginId, pData.insPeak[0], pData.insPeak[1], pData.outsPeak[0], pData.outsPeak[1]);
char targetPath[std::strlen(kData->oscData->path)+22];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/set_peaks");
lo_send(kData->oscData->target, targetPath, "iffff", pluginId, pData.insPeak[0], pData.insPeak[1], pData.outsPeak[0], pData.outsPeak[1]);
}
}

@@ -1825,10 +1827,10 @@ void CarlaEngine::osc_send_control_exit()

if (kData->oscData && kData->oscData->target)
{
char target_path[strlen(kData->oscData->path)+6];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/exit");
lo_send(kData->oscData->target, target_path, "");
char targetPath[std::strlen(kData->oscData->path)+6];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/exit");
lo_send(kData->oscData->target, targetPath, "");
}
}
#else
@@ -1840,10 +1842,10 @@ void CarlaEngine::osc_send_bridge_audio_count(const int32_t ins, const int32_t o

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+20];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_audio_count");
lo_send(kData->oscData->target, target_path, "iii", ins, outs, total);
char targetPath[std::strlen(kData->oscData->path)+20];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_audio_count");
lo_send(kData->oscData->target, targetPath, "iii", ins, outs, total);
}
}

@@ -1855,10 +1857,10 @@ void CarlaEngine::osc_send_bridge_midi_count(const int32_t ins, const int32_t ou

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+19];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_midi_count");
lo_send(kData->oscData->target, target_path, "iii", ins, outs, total);
char targetPath[std::strlen(kData->oscData->path)+19];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_midi_count");
lo_send(kData->oscData->target, targetPath, "iii", ins, outs, total);
}
}

@@ -1870,10 +1872,10 @@ void CarlaEngine::osc_send_bridge_parameter_count(const int32_t ins, const int32

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+24];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_parameter_count");
lo_send(kData->oscData->target, target_path, "iii", ins, outs, total);
char targetPath[std::strlen(kData->oscData->path)+24];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_parameter_count");
lo_send(kData->oscData->target, targetPath, "iii", ins, outs, total);
}
}

@@ -1885,10 +1887,10 @@ void CarlaEngine::osc_send_bridge_program_count(const int32_t count)

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+22];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_program_count");
lo_send(kData->oscData->target, target_path, "i", count);
char targetPath[std::strlen(kData->oscData->path)+22];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_program_count");
lo_send(kData->oscData->target, targetPath, "i", count);
}
}

@@ -1900,10 +1902,10 @@ void CarlaEngine::osc_send_bridge_midi_program_count(const int32_t count)

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+27];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_midi_program_count");
lo_send(kData->oscData->target, target_path, "i", count);
char targetPath[std::strlen(kData->oscData->path)+27];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_midi_program_count");
lo_send(kData->oscData->target, targetPath, "i", count);
}
}

@@ -1918,10 +1920,10 @@ void CarlaEngine::osc_send_bridge_plugin_info(const int32_t category, const int3

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+20];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_plugin_info");
lo_send(kData->oscData->target, target_path, "iissssh", category, hints, name, label, maker, copyright, uniqueId);
char targetPath[std::strlen(kData->oscData->path)+20];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_plugin_info");
lo_send(kData->oscData->target, targetPath, "iissssh", category, hints, name, label, maker, copyright, uniqueId);
}
}

@@ -1934,10 +1936,10 @@ void CarlaEngine::osc_send_bridge_parameter_info(const int32_t index, const char

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+23];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_parameter_info");
lo_send(kData->oscData->target, target_path, "iss", index, name, unit);
char targetPath[std::strlen(kData->oscData->path)+23];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_parameter_info");
lo_send(kData->oscData->target, targetPath, "iss", index, name, unit);
}
}

@@ -1948,10 +1950,10 @@ void CarlaEngine::osc_send_bridge_parameter_data(const int32_t index, const int3

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+23];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_parameter_data");
lo_send(kData->oscData->target, target_path, "iiiiii", index, type, rindex, hints, midiChannel, midiCC);
char targetPath[std::strlen(kData->oscData->path)+23];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_parameter_data");
lo_send(kData->oscData->target, targetPath, "iiiiii", index, type, rindex, hints, midiChannel, midiCC);
}
}

@@ -1962,10 +1964,10 @@ void CarlaEngine::osc_send_bridge_parameter_ranges(const int32_t index, const fl

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+25];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_parameter_ranges");
lo_send(kData->oscData->target, target_path, "idddddd", index, def, min, max, step, stepSmall, stepLarge);
char targetPath[std::strlen(kData->oscData->path)+25];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_parameter_ranges");
lo_send(kData->oscData->target, targetPath, "idddddd", index, def, min, max, step, stepSmall, stepLarge);
}
}

@@ -1976,10 +1978,10 @@ void CarlaEngine::osc_send_bridge_program_info(const int32_t index, const char*

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+21];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_program_info");
lo_send(kData->oscData->target, target_path, "is", index, name);
char targetPath[std::strlen(kData->oscData->path)+21];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_program_info");
lo_send(kData->oscData->target, targetPath, "is", index, name);
}
}

@@ -1990,10 +1992,10 @@ void CarlaEngine::osc_send_bridge_midi_program_info(const int32_t index, const i

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+26];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_midi_program_info");
lo_send(kData->oscData->target, target_path, "iiis", index, bank, program, label);
char targetPath[std::strlen(kData->oscData->path)+26];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_midi_program_info");
lo_send(kData->oscData->target, targetPath, "iiis", index, bank, program, label);
}
}

@@ -2006,10 +2008,10 @@ void CarlaEngine::osc_send_bridge_configure(const char* const key, const char* c

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+18];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_configure");
lo_send(kData->oscData->target, target_path, "ss", key, value);
char targetPath[std::strlen(kData->oscData->path)+18];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_configure");
lo_send(kData->oscData->target, targetPath, "ss", key, value);
}
}

@@ -2020,10 +2022,10 @@ void CarlaEngine::osc_send_bridge_set_parameter_value(const int32_t index, const

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+28];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_set_parameter_value");
lo_send(kData->oscData->target, target_path, "id", index, value);
char targetPath[std::strlen(kData->oscData->path)+28];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_set_parameter_value");
lo_send(kData->oscData->target, targetPath, "id", index, value);
}
}

@@ -2034,10 +2036,10 @@ void CarlaEngine::osc_send_bridge_set_default_value(const int32_t index, const f

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+26];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_set_default_value");
lo_send(kData->oscData->target, target_path, "id", index, value);
char targetPath[std::strlen(kData->oscData->path)+26];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_set_default_value");
lo_send(kData->oscData->target, targetPath, "id", index, value);
}
}

@@ -2048,10 +2050,10 @@ void CarlaEngine::osc_send_bridge_set_program(const int32_t index)

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+20];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_set_program");
lo_send(kData->oscData->target, target_path, "i", index);
char targetPath[std::strlen(kData->oscData->path)+20];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_set_program");
lo_send(kData->oscData->target, targetPath, "i", index);
}
}

@@ -2062,10 +2064,10 @@ void CarlaEngine::osc_send_bridge_set_midi_program(const int32_t index)

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+25];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_set_midi_program");
lo_send(kData->oscData->target, target_path, "i", index);
char targetPath[std::strlen(kData->oscData->path)+25];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_set_midi_program");
lo_send(kData->oscData->target, targetPath, "i", index);
}
}

@@ -2076,10 +2078,10 @@ void CarlaEngine::osc_send_bridge_set_custom_data(const char* const type, const

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+24];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_set_custom_data");
lo_send(kData->oscData->target, target_path, "sss", type, key, value);
char targetPath[std::strlen(kData->oscData->path)+24];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_set_custom_data");
lo_send(kData->oscData->target, targetPath, "sss", type, key, value);
}
}

@@ -2090,10 +2092,10 @@ void CarlaEngine::osc_send_bridge_set_chunk_data(const char* const chunkFile)

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+23];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_set_chunk_data");
lo_send(kData->oscData->target, target_path, "s", chunkFile);
char targetPath[std::strlen(kData->oscData->path)+23];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_set_chunk_data");
lo_send(kData->oscData->target, targetPath, "s", chunkFile);
}
}

@@ -2105,10 +2107,10 @@ void CarlaEngine::osc_send_bridge_set_peaks()

if (kData->oscData != nullptr && kData->oscData->target != nullptr)
{
char target_path[strlen(kData->oscData->path)+22];
strcpy(target_path, kData->oscData->path);
strcat(target_path, "/bridge_set_peaks");
lo_send(kData->oscData->target, target_path, "ffff", pData.insPeak[0], pData.insPeak[1], pData.outsPeak[0], pData.outsPeak[1]);
char targetPath[std::strlen(kData->oscData->path)+22];
std::strcpy(targetPath, kData->oscData->path);
std::strcat(targetPath, "/bridge_set_peaks");
lo_send(kData->oscData->target, targetPath, "ffff", pData.insPeak[0], pData.insPeak[1], pData.outsPeak[0], pData.outsPeak[1]);
}
}
#endif


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

@@ -439,7 +439,7 @@ public:
jackbridge_recompute_total_latencies(kClient);
}

const CarlaEnginePort* addPort(const EnginePortType portType, const char* const name, const bool isInput)
CarlaEnginePort* addPort(const EnginePortType portType, const char* const name, const bool isInput)
{
carla_debug("CarlaEngineJackClient::addPort(%s, \"%s\", %s)", EnginePortType2Str(portType), name, bool2str(isInput));



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

@@ -321,7 +321,7 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons
return handleMsgNoteOff(plugin, argc, argv, types);

// Plugin Bridges
if ((plugin->hints() & PLUGIN_IS_BRIDGE) > 0 && strlen(method) > 11 && strncmp(method, "bridge_", 7) == 0)
if ((plugin->hints() & PLUGIN_IS_BRIDGE) > 0 && std::strlen(method) > 11 && std::strncmp(method, "bridge_", 7) == 0)
{
if (std::strcmp(method+7, "set_peaks") == 0)
return handleMsgBridgeSetPeaks(plugin, argc, argv, types);


+ 1
- 1
source/backend/engine/CarlaEngineOsc.hpp View File

@@ -41,7 +41,7 @@
return 1; \
} \
/* check argument types */ \
if (strcmp(types, typesToCompare) != 0) \
if (std::strcmp(types, typesToCompare) != 0) \
{ \
carla_stderr("CarlaEngineOsc::%s() - argument types mismatch: '%s' != '%s'", __FUNCTION__, types, typesToCompare); \
return 1; \


+ 71
- 83
source/backend/plugin/BridgePlugin.cpp View File

@@ -17,6 +17,8 @@

#include "CarlaPluginInternal.hpp"

#if 1//ndef BUILD_BRIDGE

#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QStringList>
@@ -38,7 +40,7 @@
return 1; \
} \
/* check argument types */ \
if (strcmp(types, typesToCompare) != 0) \
if (std::strcmp(types, typesToCompare) != 0) \
{ \
carla_stderr("BridgePlugin::%s() - argument types mismatch: '%s' != '%s'", __FUNCTION__, types, typesToCompare); \
return 1; \
@@ -48,48 +50,29 @@
CARLA_BACKEND_START_NAMESPACE

struct BridgeParamInfo {
double value;
QString name;
QString unit;
float value;
CarlaString name;
CarlaString unit;

BridgeParamInfo()
: value(0.0) {}
: value(0.0f) {}
};

class BridgePlugin : public CarlaPlugin
{
public:
BridgePlugin(CarlaEngine* const engine, const unsigned int id, const BinaryType btype, const PluginType ptype)
: CarlaPlugin(engine, id)//,
//m_binary(btype)
: CarlaPlugin(engine, id),
fBinaryType(btype),
fPluginType(ptype),
fInitiated(false),
fInitError(false),
fSaved(false),
fParams(nullptr)
{
carla_debug("BridgePlugin::BridgePlugin()");

#if 0
m_type = ptype;
m_hints = PLUGIN_IS_BRIDGE;

m_initiated = false;
m_initError = false;
m_saved = false;

info.aIns = 0;
info.aOuts = 0;
info.mIns = 0;
info.mOuts = 0;

info.category = PLUGIN_CATEGORY_NONE;
info.uniqueId = 0;

info.name = nullptr;
info.label = nullptr;
info.maker = nullptr;
info.copyright = nullptr;

params = nullptr;
carla_debug("BridgePlugin::BridgePlugin(%p, %i, %s, %s)", engine, id, BinaryType2Str(btype), PluginType2Str(ptype));

osc.thread = new CarlaPluginThread(engine, this, CarlaPluginThread::PLUGIN_THREAD_BRIDGE);
#endif
kData->osc.thread.setMode(CarlaPluginThread::PLUGIN_THREAD_BRIDGE);
}

#if 0
@@ -116,32 +99,26 @@ public:
delete osc.thread;
}

if (info.name)
free((void*)info.name);

if (info.label)
free((void*)info.label);

if (info.maker)
free((void*)info.maker);

if (info.copyright)
free((void*)info.copyright);

info.chunk.clear();
}
#endif

// -------------------------------------------------------------------
// Information (base)

PluginCategory category()
PluginType type() const
{
return info.category;
return fPluginType;
}

PluginCategory category() const
{
return fInfo.category;
}

long uniqueId()
{
return info.uniqueId;
return fInfo.uniqueId;
}

// -------------------------------------------------------------------
@@ -149,24 +126,25 @@ public:

uint32_t audioInCount()
{
return info.aIns;
return fInfo.aIns;
}

uint32_t audioOutCount()
{
return info.aOuts;
return fInfo.aOuts;
}

uint32_t midiInCount()
{
return info.mIns;
return fInfo.mIns;
}

uint32_t midiOutCount()
{
return info.mOuts;
return fInfo.mOuts;
}

#if 0
// -------------------------------------------------------------------
// Information (current data)

@@ -584,11 +562,11 @@ public:
// invalid
pass();
}
else if (strcmp(key, CARLA_BRIDGE_MSG_HIDE_GUI) == 0)
else if (std::strcmp(key, CARLA_BRIDGE_MSG_HIDE_GUI) == 0)
{
x_engine->callback(CALLBACK_SHOW_GUI, m_id, 0, 0, 0.0, nullptr);
}
else if (strcmp(key, CARLA_BRIDGE_MSG_SAVED) == 0)
else if (std::strcmp(key, CARLA_BRIDGE_MSG_SAVED) == 0)
{
m_saved = true;
}
@@ -972,65 +950,74 @@ public:

return true;
}
#endif

private:
const BinaryType m_binary;
const BinaryType fBinaryType;
const PluginType fPluginType;

bool m_initiated;
bool m_initError;
bool m_saved;
bool fInitiated;
bool fInitError;
bool fSaved;

struct {
struct Info {
uint32_t aIns, aOuts;
uint32_t mIns, mOuts;
PluginCategory category;
long uniqueId;
const char* name;
const char* label;
const char* maker;
const char* copyright;
QByteArray chunk;
} info;

BridgeParamInfo* params;
#endif
CarlaString name;
CarlaString label;
CarlaString maker;
CarlaString copyright;
//QByteArray chunk;

Info()
: aIns(0),
aOuts(0),
mIns(0),
mOuts(0),
category(PLUGIN_CATEGORY_NONE),
uniqueId(0) {}
} fInfo;

BridgeParamInfo* fParams;
};

CARLA_BACKEND_END_NAMESPACE

#endif // ! BUILD_BRIDGE

CARLA_BACKEND_START_NAMESPACE

CarlaPlugin* CarlaPlugin::newBridge(const Initializer& init, BinaryType btype, PluginType ptype, const char* const extra)
{
carla_debug("CarlaPlugin::newBridge(%p, \"%s\", \"%s\", \"%s\", %s, %s)", init.engine, init.filename, init.name, init.label, BinaryType2Str(btype), PluginType2Str(ptype));
carla_debug("CarlaPlugin::newBridge({%p, \"%s\", \"%s\", \"%s\"}, %s, %s)", init.engine, init.filename, init.name, init.label, BinaryType2Str(btype), PluginType2Str(ptype));

#if 0
if (! extra)
#if 1//ndef BUILD_BRIDGE
if (extra == nullptr)
{
init.engine->setLastError("Bridge not possible, bridge-binary not found");
return nullptr;
}

short id = init.engine->getNewPluginId();

if (id < 0 || id > init.engine->maxPluginNumber())
{
init.engine->setLastError("Maximum number of plugins reached");
return nullptr;
}

BridgePlugin* const plugin = new BridgePlugin(init.engine, id, btype, ptype);
BridgePlugin* const plugin = new BridgePlugin(init.engine, init.id, btype, ptype);

if (! plugin->init(init.filename, init.name, init.label, (const char*)extra))
//if (! plugin->init(init.filename, init.name, init.label, (const char*)extra))
{
delete plugin;
return nullptr;
}

//plugin->reload();
plugin->registerToOscClient();

return plugin;
#endif
#else
init.engine->setLastError("Plugin bridge support not available");
return nullptr;
#endif
}

#if 1//ndef BUILD_BRIDGE
// -------------------------------------------------------------------
// Bridge Helper

@@ -1039,5 +1026,6 @@ int CarlaPluginSetOscBridgeInfo(CarlaPlugin* const plugin, const PluginBridgeInf
{
return ((BridgePlugin*)plugin)->setOscPluginBridgeInfo(type, argc, argv, types);
}
#endif

CARLA_BACKEND_END_NAMESPACE

+ 28
- 26
source/backend/plugin/CarlaPlugin.cpp View File

@@ -41,12 +41,12 @@ CarlaEngine* CarlaPluginGetEngine(CarlaPlugin* const plugin)
return CarlaPluginProtectedData::getEngine(plugin);
}

CarlaEngineAudioPort* CarlaPluginGetAudioInPort(CarlaPlugin* const plugin, uint32_t index)
CarlaEngineAudioPort* CarlaPluginGetAudioInPort(CarlaPlugin* const plugin, const uint32_t index)
{
return CarlaPluginProtectedData::getAudioInPort(plugin, index);
}

CarlaEngineAudioPort* CarlaPluginGetAudioOutPort(CarlaPlugin* const plugin, uint32_t index)
CarlaEngineAudioPort* CarlaPluginGetAudioOutPort(CarlaPlugin* const plugin, const uint32_t index)
{
return CarlaPluginProtectedData::getAudioOutPort(plugin, index);
}
@@ -59,7 +59,7 @@ CarlaPlugin::CarlaPlugin(CarlaEngine* const engine, const unsigned int id)
fHints(0x0),
fOptions(0x0),
fEnabled(false),
kData(new CarlaPluginProtectedData(engine, this, CarlaPluginThread::PLUGIN_THREAD_NULL))
kData(new CarlaPluginProtectedData(engine, this))
{
CARLA_ASSERT(kData != nullptr);
CARLA_ASSERT(engine != nullptr);
@@ -725,7 +725,7 @@ void CarlaPlugin::setCustomData(const char* const type, const char* const key, c
// Ignore some keys
if (std::strncmp(key, "OSC:", 4) == 0 || std::strcmp(key, "guiVisible") == 0)
saveData = false;
//else if (strcmp(key, CARLA_BRIDGE_MSG_SAVE_NOW) == 0 || strcmp(key, CARLA_BRIDGE_MSG_SET_CHUNK) == 0 || strcmp(key, CARLA_BRIDGE_MSG_SET_CUSTOM) == 0)
//else if (std::strcmp(key, CARLA_BRIDGE_MSG_SAVE_NOW) == 0 || std::strcmp(key, CARLA_BRIDGE_MSG_SET_CHUNK) == 0 || std::strcmp(key, CARLA_BRIDGE_MSG_SET_CUSTOM) == 0)
// saveData = false;
}

@@ -735,7 +735,7 @@ void CarlaPlugin::setCustomData(const char* const type, const char* const key, c
// Check if we already have this key
for (size_t i=0; i < kData->custom.count(); i++)
{
if (strcmp(custom[i].key, key) == 0)
if (std::strcmp(custom[i].key, key) == 0)
{
delete[] custom[i].value;
custom[i].value = carla_strdup(value);
@@ -1192,9 +1192,7 @@ void CarlaPlugin::sendMidiSingleNote(const uint8_t channel, const uint8_t note,
extNote.note = note;
extNote.velo = velo;

kData->extNotes.mutex.lock();
kData->extNotes.append(extNote);
kData->extNotes.mutex.unlock();

if (sendGui)
{
@@ -1243,7 +1241,7 @@ void CarlaPlugin::sendMidiAllNotesOff()
// -------------------------------------------------------------------
// Post-poned events

void CarlaPlugin::postponeRtEvent(const PluginPostRtEventType type, const int32_t value1, const int32_t value2, const double value3)
void CarlaPlugin::postponeRtEvent(const PluginPostRtEventType type, const int32_t value1, const int32_t value2, const float value3)
{
PluginPostRtEvent event;
event.type = type;
@@ -1256,26 +1254,11 @@ void CarlaPlugin::postponeRtEvent(const PluginPostRtEventType type, const int32_

void CarlaPlugin::postRtEventsRun()
{
// TODO: optimize
unsigned short k = 0;
PluginPostRtEvent listData[MAX_RT_EVENTS];

// Make a safe copy of events while clearing them
kData->postRtEvents.mutex.lock();
const CarlaMutex::ScopedLocker sl(&kData->postRtEvents.mutex);

while (! kData->postRtEvents.data.isEmpty())
{
PluginPostRtEvent& event = kData->postRtEvents.data.getFirst(true);
listData[k++] = event;
//std::memcpy(&listData[k++], &event, sizeof(PluginPostRtEvent));
}

kData->postRtEvents.mutex.unlock();

// Handle events now
for (unsigned short i=0; i < k; i++)
{
const PluginPostRtEvent& event = listData[i];
const PluginPostRtEvent& event = kData->postRtEvents.data.getFirst(true);

switch (event.type)
{
@@ -1484,13 +1467,32 @@ CarlaPlugin::ScopedDisabler::ScopedDisabler(CarlaPlugin* const plugin)
if (plugin->fEnabled)
{
plugin->fEnabled = false;
plugin->kData->engine->waitForProccessEnd();
plugin->kData->engine->waitForProccessEnd(plugin->id());
}

if (plugin->kData->client->isActive())
plugin->kData->client->deactivate();
}

CarlaPlugin::ScopedDisabler::~ScopedDisabler()
{
kPlugin->fEnabled = true;
kPlugin->kData->client->activate();
}

// -------------------------------------------------------------------
// Scoped Process Locker

CarlaPlugin::ScopedProcessLocker::ScopedProcessLocker(CarlaPlugin* const plugin)
: kPlugin(plugin)
{
plugin->kData->mutex.lock();
}

CarlaPlugin::ScopedProcessLocker::~ScopedProcessLocker()
{
kPlugin->kData->needsReset = true;
kPlugin->kData->mutex.unlock();
}

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


+ 33
- 13
source/backend/plugin/CarlaPluginInternal.hpp View File

@@ -332,13 +332,13 @@ struct PluginPostRtEvent {
PluginPostRtEventType type;
int32_t value1;
int32_t value2;
double value3;
float value3;

PluginPostRtEvent()
: type(kPluginPostRtEventNull),
value1(-1),
value2(-1),
value3(0.0) {}
value3(0.0f) {}

CARLA_DECLARE_NON_COPY_STRUCT(PluginPostRtEvent)
};
@@ -402,11 +402,11 @@ struct CarlaPluginProtectedData {
float** latencyBuffers;

// data
PluginAudioData audioIn;
PluginAudioData audioOut;
PluginEventData event;
PluginParameterData param;
PluginProgramData prog;
PluginAudioData audioIn;
PluginAudioData audioOut;
PluginEventData event;
PluginParameterData param;
PluginProgramData prog;
PluginMidiProgramData midiprog;
NonRtListNew<CustomData> custom;

@@ -418,19 +418,26 @@ struct CarlaPluginProtectedData {
RtList<ExternalMidiNote> data;

ExternalNotes()
: dataPool(152, 512),
: dataPool(32, 128),
data(&dataPool) {}

~ExternalNotes()
{
mutex.lock();
data.clear();
mutex.unlock();
}

void append(const ExternalMidiNote& note)
{
mutex.lock();
data.append_sleepy(note);
mutex.unlock();
}

ExternalNotes(ExternalNotes&) = delete;
ExternalNotes(const ExternalNotes&) = delete;

} extNotes;

struct PostRtEvents {
@@ -446,12 +453,13 @@ struct CarlaPluginProtectedData {

~PostRtEvents()
{
mutex.lock();
clear();
mutex.unlock();
}

void appendRT(const PluginPostRtEvent& event)
{
// FIXME!! need lock?
dataPendingRT.append(event);
}

@@ -472,6 +480,9 @@ struct CarlaPluginProtectedData {
mutex.unlock();
}

PostRtEvents(PostRtEvents&) = delete;
PostRtEvents(const PostRtEvents&) = delete;

} postRtEvents;

struct PostProc {
@@ -487,6 +498,10 @@ struct CarlaPluginProtectedData {
balanceLeft(-1.0f),
balanceRight(1.0f),
panning(0.0f) {}

PostProc(PostProc&) = delete;
PostProc(const PostProc&) = delete;

} postProc;

struct OSC {
@@ -495,9 +510,14 @@ struct CarlaPluginProtectedData {

OSC(CarlaEngine* const engine, CarlaPlugin* const plugin, const CarlaPluginThread::Mode mode)
: thread(engine, plugin, mode) {}

OSC() = delete;
OSC(OSC&) = delete;
OSC(const OSC&) = delete;

} osc;

CarlaPluginProtectedData(CarlaEngine* const engine_, CarlaPlugin* const plugin, const CarlaPluginThread::Mode mode)
CarlaPluginProtectedData(CarlaEngine* const engine_, CarlaPlugin* const plugin)
: engine(engine_),
client(nullptr),
gui(nullptr),
@@ -510,7 +530,7 @@ struct CarlaPluginProtectedData {
ctrlChannel(-1),
latency(0),
latencyBuffers(nullptr),
osc(engine_, plugin, mode) {}
osc(engine_, plugin, CarlaPluginThread::PLUGIN_THREAD_NULL) {}

CarlaPluginProtectedData() = delete;
CarlaPluginProtectedData(CarlaPluginProtectedData&) = delete;
@@ -521,12 +541,12 @@ struct CarlaPluginProtectedData {
return plugin->kData->engine;
}

static CarlaEngineAudioPort* getAudioInPort(CarlaPlugin* const plugin, uint32_t index)
static CarlaEngineAudioPort* getAudioInPort(CarlaPlugin* const plugin, const uint32_t index)
{
return plugin->kData->audioIn.ports[index].port;
}

static CarlaEngineAudioPort* getAudioOutPort(CarlaPlugin* const plugin, uint32_t index)
static CarlaEngineAudioPort* getAudioOutPort(CarlaPlugin* const plugin, const uint32_t index)
{
return plugin->kData->audioOut.ports[index].port;
}


+ 94
- 99
source/backend/plugin/DssiPlugin.cpp View File

@@ -28,21 +28,22 @@ class DssiPlugin : public CarlaPlugin
{
public:
DssiPlugin(CarlaEngine* const engine, const unsigned int id)
: CarlaPlugin(engine, id)
: CarlaPlugin(engine, id),
fHandle(nullptr),
fHandle2(nullptr),
fDescriptor(nullptr),
fDssiDescriptor(nullptr),
fAudioInBuffers(nullptr),
fAudioOutBuffers(nullptr),
fParamBuffers(nullptr)
{
carla_debug("DssiPlugin::DssiPlugin(%p, %i)", engine, id);

fHandle = nullptr;
fHandle2 = nullptr;
fDescriptor = nullptr;
fDssiDescriptor = nullptr;

fAudioInBuffers = nullptr;
fAudioOutBuffers = nullptr;
fParamBuffers = nullptr;

carla_zeroMem(fMidiEvents, sizeof(snd_seq_event_t)*MAX_MIDI_EVENTS);

kData->osc.thread.setMode(CarlaPluginThread::PLUGIN_THREAD_DSSI_GUI);

// FIXME
if (engine->getOptions().useDssiVstChunks)
fOptions |= PLUGIN_OPTION_USE_CHUNKS;
}
@@ -111,7 +112,7 @@ public:
{
CARLA_ASSERT(fDescriptor != nullptr);

return (fDescriptor != nullptr) ? fDescriptor->UniqueID : 0;
return (fDescriptor != nullptr) ? static_cast<long>(fDescriptor->UniqueID) : 0;
}

// -------------------------------------------------------------------
@@ -129,7 +130,7 @@ public:
unsigned long dataSize = 0;

if (fDssiDescriptor->get_custom_data != nullptr && fDssiDescriptor->get_custom_data(fHandle, dataPtr, &dataSize))
return dataSize;
return (int32_t)dataSize;

return 0;
}
@@ -232,6 +233,8 @@ public:

if (fDssiDescriptor->configure != nullptr)
{
const ScopedProcessLocker spl(this);

fDssiDescriptor->configure(fHandle, key, value);

if (fHandle2)
@@ -241,9 +244,9 @@ public:
if (sendGui && kData->osc.data.target != nullptr)
osc_send_configure(&kData->osc.data, key, value);

if (strcmp(key, "reloadprograms") == 0 || strcmp(key, "load") == 0 || strncmp(key, "patches", 7) == 0)
if (std::strcmp(key, "reloadprograms") == 0 || std::strcmp(key, "load") == 0 || std::strncmp(key, "patches", 7) == 0)
{
const ScopedDisabler m(this); // FIXME
const ScopedDisabler sd(this);
reloadPrograms(false);
}

@@ -266,16 +269,8 @@ public:
fChunk = QByteArray::fromBase64(QByteArray(stringData));
//fChunk.toBase64();

if (kData->engine->isOffline())
{
//const CarlaEngine::ScopedLocker m(kData->engine);
fDssiDescriptor->set_custom_data(fHandle, fChunk.data(), fChunk.size());
}
else
{
const CarlaPlugin::ScopedDisabler m(this);
fDssiDescriptor->set_custom_data(fHandle, fChunk.data(), fChunk.size());
}
const ScopedProcessLocker spl(this);
fDssiDescriptor->set_custom_data(fHandle, fChunk.data(), (unsigned long)fChunk.size());
}

void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block)
@@ -289,29 +284,17 @@ public:
else if (index > static_cast<int32_t>(kData->midiprog.count))
return;

// FIXME
if (fDssiDescriptor != nullptr && fHandle != nullptr && index >= 0)
{
const uint32_t bank = kData->midiprog.data[index].bank;
const uint32_t program = kData->midiprog.data[index].program;

if (kData->engine->isOffline())
{
//const CarlaEngine::ScopedLocker m(x_engine, block);
fDssiDescriptor->select_program(fHandle, bank, program);
const ScopedProcessLocker spl(this);

if (fHandle2 != nullptr)
fDssiDescriptor->select_program(fHandle2, bank, program);
}
else
{
//const ScopedDisabler m(this, block);
fDssiDescriptor->select_program(fHandle, bank, program);

fDssiDescriptor->select_program(fHandle, bank, program);

if (fHandle2 != nullptr)
fDssiDescriptor->select_program(fHandle2, bank, program);
}
if (fHandle2 != nullptr)
fDssiDescriptor->select_program(fHandle2, bank, program);
}

CarlaPlugin::setMidiProgram(index, sendGui, sendOsc, sendCallback, block);
@@ -355,13 +338,10 @@ public:
// Safely disable plugin for reload
const ScopedDisabler sd(this);

if (kData->client->isActive())
kData->client->deactivate();

deleteBuffers();

const double sampleRate = kData->engine->getSampleRate();
const unsigned long portCount = fDescriptor->PortCount;
const float sampleRate = (float)kData->engine->getSampleRate();
const uint32_t portCount = static_cast<uint32_t>(fDescriptor->PortCount);

uint32_t aIns, aOuts, mIns, params, j;
aIns = aOuts = mIns = params = 0;
@@ -372,25 +352,32 @@ public:
bool needsCtrlIn, needsCtrlOut;
needsCtrlIn = needsCtrlOut = false;

for (unsigned long i=0; i < portCount; i++)
if (portCount > 0)
{
const LADSPA_PortDescriptor portType = fDescriptor->PortDescriptors[i];
CARLA_ASSERT(fDescriptor->PortDescriptors != nullptr);
CARLA_ASSERT(fDescriptor->PortRangeHints != nullptr);
CARLA_ASSERT(fDescriptor->PortNames != nullptr);

if (LADSPA_IS_PORT_AUDIO(portType))
for (uint32_t i=0; i < portCount; i++)
{
if (LADSPA_IS_PORT_INPUT(portType))
aIns += 1;
else if (LADSPA_IS_PORT_OUTPUT(portType))
aOuts += 1;
const LADSPA_PortDescriptor portType = fDescriptor->PortDescriptors[i];

if (LADSPA_IS_PORT_AUDIO(portType))
{
if (LADSPA_IS_PORT_INPUT(portType))
aIns += 1;
else if (LADSPA_IS_PORT_OUTPUT(portType))
aOuts += 1;
}
else if (LADSPA_IS_PORT_CONTROL(portType))
params += 1;
}
else if (LADSPA_IS_PORT_CONTROL(portType))
params += 1;
}

if ((fOptions & PLUGIN_OPTION_FORCE_STEREO) != 0 && (aIns == 1 || aOuts == 1))
{
if (fHandle2 == nullptr)
fHandle2 = fDescriptor->instantiate(fDescriptor, sampleRate);
fHandle2 = fDescriptor->instantiate(fDescriptor, (unsigned long)sampleRate);

if (aIns == 1)
{
@@ -434,12 +421,15 @@ public:
{
kData->param.createNew(params);
fParamBuffers = new float[params];

for (uint32_t i=0; i < params; i++)
fParamBuffers[i] = 0.0f;
}

const int portNameSize = kData->engine->maxPortNameSize();
const uint portNameSize = kData->engine->maxPortNameSize();
CarlaString portName;

for (unsigned long i=0, iAudioIn=0, iAudioOut=0, iCtrl=0; i < portCount; i++)
for (uint32_t i=0, iAudioIn=0, iAudioOut=0, iCtrl=0; i < portCount; i++)
{
const LADSPA_PortDescriptor portType = fDescriptor->PortDescriptors[i];
const LADSPA_PortRangeHint portRangeHints = fDescriptor->PortRangeHints[i];
@@ -763,7 +753,7 @@ public:
if (fDescriptor->deactivate != nullptr)
fDescriptor->deactivate(fHandle);

const uint32_t latency = std::rint(fParamBuffers[i]);
const uint32_t latency = (uint32_t)fParamBuffers[i];

if (kData->latency != latency)
{
@@ -779,8 +769,6 @@ public:
bufferSizeChanged(kData->engine->getBufferSize());
reloadPrograms(true);

kData->client->activate();

carla_debug("DssiPlugin::reload() - end");
}

@@ -810,8 +798,8 @@ public:
CARLA_ASSERT(pdesc != nullptr);
CARLA_ASSERT(pdesc->Name != nullptr);

kData->midiprog.data[i].bank = pdesc->Bank;
kData->midiprog.data[i].program = pdesc->Program;
kData->midiprog.data[i].bank = static_cast<uint32_t>(pdesc->Bank);
kData->midiprog.data[i].program = static_cast<uint32_t>(pdesc->Program);
kData->midiprog.data[i].name = carla_strdup(pdesc->Name);
}

@@ -908,18 +896,18 @@ public:
{
if (kData->event.portIn != nullptr)
{
for (k=0, i=MAX_MIDI_CHANNELS; k < MAX_MIDI_CHANNELS; k++)
for (unsigned char j=0, l=MAX_MIDI_CHANNELS; j < MAX_MIDI_CHANNELS; j++)
{
carla_zeroStruct<snd_seq_event_t>(fMidiEvents[k]);
carla_zeroStruct<snd_seq_event_t>(fMidiEvents[k+i]);
carla_zeroStruct<snd_seq_event_t>(fMidiEvents[j]);
carla_zeroStruct<snd_seq_event_t>(fMidiEvents[j+l]);

fMidiEvents[k].type = SND_SEQ_EVENT_CONTROLLER;
fMidiEvents[k].data.control.channel = k;
fMidiEvents[k].data.control.param = MIDI_CONTROL_ALL_SOUND_OFF;
fMidiEvents[j].type = SND_SEQ_EVENT_CONTROLLER;
fMidiEvents[j].data.control.channel = j;
fMidiEvents[j].data.control.param = MIDI_CONTROL_ALL_SOUND_OFF;

fMidiEvents[k+i].type = SND_SEQ_EVENT_CONTROLLER;
fMidiEvents[k+i].data.control.channel = k;
fMidiEvents[k+i].data.control.param = MIDI_CONTROL_ALL_NOTES_OFF;
fMidiEvents[j+l].type = SND_SEQ_EVENT_CONTROLLER;
fMidiEvents[j+l].data.control.channel = j;
fMidiEvents[j+l].data.control.param = MIDI_CONTROL_ALL_NOTES_OFF;
}

midiEventCount = MAX_MIDI_CHANNELS*2;
@@ -1044,7 +1032,7 @@ public:
// Control backend stuff
if (event.channel == kData->ctrlChannel)
{
double value;
float value;

if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (fHints & PLUGIN_CAN_DRYWET) > 0)
{
@@ -1056,7 +1044,7 @@ public:

if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0)
{
value = ctrlEvent.value*127/100;
value = ctrlEvent.value*127.0f/100.0f;
setVolume(value, false, false);
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value);
continue;
@@ -1064,23 +1052,23 @@ public:

if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0)
{
double left, right;
value = ctrlEvent.value/0.5 - 1.0;
float left, right;
value = ctrlEvent.value/0.5f - 1.0f;

if (value < 0.0)
if (value < 0.0f)
{
left = -1.0;
right = (value*2)+1.0;
left = -1.0f;
right = (value*2.0f)+1.0f;
}
else if (value > 0.0)
else if (value > 0.0f)
{
left = (value*2)-1.0;
right = 1.0;
left = (value*2.0f)-1.0f;
right = 1.0f;
}
else
{
left = -1.0;
right = 1.0;
left = -1.0f;
right = 1.0f;
}

setBalanceLeft(left, false, false);
@@ -1103,7 +1091,7 @@ public:
if ((kData->param.data[k].hints & PARAMETER_IS_AUTOMABLE) == 0)
continue;

double value;
float value;

if (kData->param.data[k].hints & PARAMETER_IS_BOOLEAN)
{
@@ -1111,15 +1099,14 @@ public:
}
else
{
// FIXME - ranges call for this
value = ctrlEvent.value * (kData->param.ranges[k].max - kData->param.ranges[k].min) + kData->param.ranges[k].min;
value = kData->param.ranges[i].unnormalizeValue(ctrlEvent.value);

if (kData->param.data[k].hints & PARAMETER_IS_INTEGER)
value = std::rint(value);
}

setParameterValue(k, value, false, false, false);
postponeRtEvent(kPluginPostRtEventParameterChange, k, 0, value);
postponeRtEvent(kPluginPostRtEventParameterChange, static_cast<int32_t>(k), 0, value);
}

break;
@@ -1345,7 +1332,9 @@ public:

if (kData->event.portOut != nullptr)
{
float value;
uint8_t channel;
uint16_t param;
float value;

for (k=0; k < kData->param.count; k++)
{
@@ -1356,8 +1345,10 @@ public:

if (kData->param.data[k].midiCC > 0)
{
value = kData->param.ranges[k].normalizeValue(fParamBuffers[k]);
kData->event.portOut->writeControlEvent(0, kData->param.data[k].midiChannel, kEngineControlEventTypeParameter, kData->param.data[k].midiCC, value);
channel = kData->param.data[k].midiChannel;
param = static_cast<uint16_t>(kData->param.data[k].midiCC);
value = kData->param.ranges[k].normalizeValue(fParamBuffers[k]);
kData->event.portOut->writeControlEvent(0, channel, kEngineControlEventTypeParameter, param, value);
}
}

@@ -1368,14 +1359,18 @@ public:
kData->activeBefore = kData->active;
}

bool processSingle(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t timeOffset, const uint32_t midiEventCount)
bool processSingle(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t timeOffset, const unsigned long midiEventCount)
{
uint32_t i, k;

// --------------------------------------------------------------------------------------------------------
// Try lock, silence otherwise

if (! kData->mutex.tryLock())
if (kData->engine->isOffline())
{
kData->mutex.lock();
}
else if (! kData->mutex.tryLock())
{
for (i=0; i < kData->audioOut.count; i++)
{
@@ -1461,14 +1456,14 @@ public:
if (i % 2 == 0)
{
// left
fAudioOutBuffers[i][k] = oldBufLeft[k] * (1.0f - balRangeL);
fAudioOutBuffers[i][k] = oldBufLeft[k] * (1.0f - balRangeL);
fAudioOutBuffers[i][k] += fAudioOutBuffers[i+1][k] * (1.0f - balRangeR);
}
else
{
// right
fAudioOutBuffers[i][k] = fAudioOutBuffers[i][k] * balRangeR;
fAudioOutBuffers[i][k] += oldBufLeft[k] * balRangeL;
fAudioOutBuffers[i][k] += oldBufLeft[k] * balRangeL;
}
}
}
@@ -1498,6 +1493,8 @@ public:

void bufferSizeChanged(const uint32_t newBufferSize)
{
carla_debug("DssiPlugin::bufferSizeChanged(%i) - start", newBufferSize);

for (uint32_t i=0; i < kData->audioIn.count; i++)
{
if (fAudioInBuffers[i] != nullptr)
@@ -1548,6 +1545,8 @@ public:
fDescriptor->connect_port(fHandle2, kData->audioOut.ports[1].rindex, fAudioOutBuffers[1]);
}
}

carla_debug("DssiPlugin::bufferSizeChanged(%i) - start", newBufferSize);
}

// -------------------------------------------------------------------
@@ -1739,7 +1738,7 @@ public:
// ---------------------------------------------------------------
// initialize plugin

fHandle = fDescriptor->instantiate(fDescriptor, kData->engine->getSampleRate());
fHandle = fDescriptor->instantiate(fDescriptor, (unsigned long)kData->engine->getSampleRate());

if (fHandle == nullptr)
{
@@ -1752,9 +1751,7 @@ public:

if (guiFilename != nullptr)
{
kData->osc.thread.setMode(CarlaPluginThread::PLUGIN_THREAD_DSSI_GUI);
kData->osc.thread.setOscData(guiFilename, fDescriptor->Label);

fHints |= PLUGIN_HAS_GUI;
}

@@ -1804,8 +1801,6 @@ CarlaPlugin* CarlaPlugin::newDSSI(const Initializer& init, const char* const gui
return nullptr;
}

plugin->registerToOscClient();

return plugin;
#else
init.engine->setLastError("DSSI support not available");


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

@@ -1443,7 +1443,6 @@ CarlaPlugin* CarlaPlugin::newSF2(const Initializer& init, const bool use16Outs)
}

plugin->reload();
plugin->registerToOscClient();

return plugin;
#else


+ 72
- 58
source/backend/plugin/LadspaPlugin.cpp View File

@@ -27,18 +27,16 @@ class LadspaPlugin : public CarlaPlugin
{
public:
LadspaPlugin(CarlaEngine* const engine, const unsigned int id)
: CarlaPlugin(engine, id)
: CarlaPlugin(engine, id),
fHandle(nullptr),
fHandle2(nullptr),
fDescriptor(nullptr),
fRdfDescriptor(nullptr),
fAudioInBuffers(nullptr),
fAudioOutBuffers(nullptr),
fParamBuffers(nullptr)
{
carla_debug("LadspaPlugin::LadspaPlugin(%p, %i)", engine, id);

fHandle = nullptr;
fHandle2 = nullptr;
fDescriptor = nullptr;
fRdfDescriptor = nullptr;

fAudioInBuffers = nullptr;
fAudioOutBuffers = nullptr;
fParamBuffers = nullptr;
}

~LadspaPlugin()
@@ -89,7 +87,7 @@ public:
{
if (fRdfDescriptor != nullptr)
{
const LADSPA_Properties category = fRdfDescriptor->Type;
const LADSPA_PluginType category = fRdfDescriptor->Type;

// Specific Types
if (category & (LADSPA_PLUGIN_DELAY|LADSPA_PLUGIN_REVERB))
@@ -127,7 +125,7 @@ public:
{
CARLA_ASSERT(fDescriptor != nullptr);

return (fDescriptor != nullptr) ? fDescriptor->UniqueID : 0;
return (fDescriptor != nullptr) ? static_cast<long>(fDescriptor->UniqueID) : 0;
}

// -------------------------------------------------------------------
@@ -143,7 +141,7 @@ public:
{
const LADSPA_RDF_Port& port = fRdfDescriptor->Ports[rindex];

return port.ScalePointCount;
return static_cast<uint32_t>(port.ScalePointCount);
}

return 0;
@@ -353,13 +351,10 @@ public:
// Safely disable plugin for reload
const ScopedDisabler sd(this);

if (kData->client->isActive())
kData->client->deactivate();

deleteBuffers();

const double sampleRate = kData->engine->getSampleRate();
const unsigned long portCount = fDescriptor->PortCount;
const float sampleRate = (float)kData->engine->getSampleRate();
const uint32_t portCount = static_cast<uint32_t>(fDescriptor->PortCount);

uint32_t aIns, aOuts, params, j;
aIns = aOuts = params = 0;
@@ -370,25 +365,32 @@ public:
bool needsCtrlIn, needsCtrlOut;
needsCtrlIn = needsCtrlOut = false;

for (unsigned long i=0; i < portCount; i++)
if (portCount > 0)
{
const LADSPA_PortDescriptor portType = fDescriptor->PortDescriptors[i];
CARLA_ASSERT(fDescriptor->PortDescriptors != nullptr);
CARLA_ASSERT(fDescriptor->PortRangeHints != nullptr);
CARLA_ASSERT(fDescriptor->PortNames != nullptr);

if (LADSPA_IS_PORT_AUDIO(portType))
for (uint32_t i=0; i < portCount; i++)
{
if (LADSPA_IS_PORT_INPUT(portType))
aIns += 1;
else if (LADSPA_IS_PORT_OUTPUT(portType))
aOuts += 1;
const LADSPA_PortDescriptor portType = fDescriptor->PortDescriptors[i];

if (LADSPA_IS_PORT_AUDIO(portType))
{
if (LADSPA_IS_PORT_INPUT(portType))
aIns += 1;
else if (LADSPA_IS_PORT_OUTPUT(portType))
aOuts += 1;
}
else if (LADSPA_IS_PORT_CONTROL(portType))
params += 1;
}
else if (LADSPA_IS_PORT_CONTROL(portType))
params += 1;
}

if ((fOptions & PLUGIN_OPTION_FORCE_STEREO) != 0 && (aIns == 1 || aOuts == 1))
{
if (fHandle2 == nullptr)
fHandle2 = fDescriptor->instantiate(fDescriptor, sampleRate);
fHandle2 = fDescriptor->instantiate(fDescriptor, (unsigned long)sampleRate);

if (aIns == 1)
{
@@ -426,17 +428,22 @@ public:
{
kData->param.createNew(params);
fParamBuffers = new float[params];

for (uint32_t i=0; i < params; i++)
fParamBuffers[i] = 0.0f;
}

const int portNameSize = kData->engine->maxPortNameSize();
const uint portNameSize = kData->engine->maxPortNameSize();
CarlaString portName;

for (unsigned long i=0, iAudioIn=0, iAudioOut=0, iCtrl=0; i < portCount; i++)
for (uint32_t i=0, iAudioIn=0, iAudioOut=0, iCtrl=0; i < portCount; i++)
{
const LADSPA_PortDescriptor portType = fDescriptor->PortDescriptors[i];
const LADSPA_PortRangeHint portRangeHints = fDescriptor->PortRangeHints[i];
const bool hasPortRDF = (fRdfDescriptor != nullptr && i < fRdfDescriptor->PortCount);

CARLA_ASSERT(fDescriptor->PortNames[i] != nullptr);

if (LADSPA_IS_PORT_AUDIO(portType))
{
portName.clear();
@@ -724,7 +731,7 @@ public:
if (fDescriptor->deactivate != nullptr)
fDescriptor->deactivate(fHandle);

const uint32_t latency = std::rint(fParamBuffers[i]);
const uint32_t latency = (uint32_t)fParamBuffers[i];

if (kData->latency != latency)
{
@@ -739,8 +746,6 @@ public:

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

kData->client->activate();

carla_debug("LadspaPlugin::reload() - end");
}

@@ -858,7 +863,7 @@ public:
// Control backend stuff
if (event.channel == kData->ctrlChannel)
{
double value;
float value;

if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (fHints & PLUGIN_CAN_DRYWET) > 0)
{
@@ -870,7 +875,7 @@ public:

if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0)
{
value = ctrlEvent.value*127/100;
value = ctrlEvent.value*127.0f/100.0f;
setVolume(value, false, false);
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value);
continue;
@@ -878,23 +883,23 @@ public:

if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0)
{
double left, right;
value = ctrlEvent.value/0.5 - 1.0;
float left, right;
value = ctrlEvent.value/0.5f - 1.0f;

if (value < 0.0)
if (value < 0.0f)
{
left = -1.0;
right = (value*2)+1.0;
left = -1.0f;
right = (value*2.0f)+1.0f;
}
else if (value > 0.0)
else if (value > 0.0f)
{
left = (value*2)-1.0;
right = 1.0;
left = (value*2.0f)-1.0f;
right = 1.0f;
}
else
{
left = -1.0;
right = 1.0;
left = -1.0f;
right = 1.0f;
}

setBalanceLeft(left, false, false);
@@ -917,7 +922,7 @@ public:
if ((kData->param.data[k].hints & PARAMETER_IS_AUTOMABLE) == 0)
continue;

double value;
float value;

if (kData->param.data[k].hints & PARAMETER_IS_BOOLEAN)
{
@@ -925,15 +930,14 @@ public:
}
else
{
// FIXME - ranges call for this
value = ctrlEvent.value * (kData->param.ranges[k].max - kData->param.ranges[k].min) + kData->param.ranges[k].min;
value = kData->param.ranges[i].unnormalizeValue(ctrlEvent.value);

if (kData->param.data[k].hints & PARAMETER_IS_INTEGER)
value = std::rint(value);
}

setParameterValue(k, value, false, false, false);
postponeRtEvent(kPluginPostRtEventParameterChange, k, 0, value);
postponeRtEvent(kPluginPostRtEventParameterChange, static_cast<int32_t>(k), 0, value);
}

break;
@@ -1020,7 +1024,9 @@ public:

if (kData->event.portOut != nullptr)
{
float value;
uint8_t channel;
uint16_t param;
float value;

for (k=0; k < kData->param.count; k++)
{
@@ -1031,8 +1037,10 @@ public:

if (kData->param.data[k].midiCC > 0)
{
value = kData->param.ranges[k].normalizeValue(fParamBuffers[k]);
kData->event.portOut->writeControlEvent(0, kData->param.data[k].midiChannel, kEngineControlEventTypeParameter, kData->param.data[k].midiCC, value);
channel = kData->param.data[k].midiChannel;
param = static_cast<uint16_t>(kData->param.data[k].midiCC);
value = kData->param.ranges[k].normalizeValue(fParamBuffers[k]);
kData->event.portOut->writeControlEvent(0, channel, kEngineControlEventTypeParameter, param, value);
}
}

@@ -1050,7 +1058,11 @@ public:
// --------------------------------------------------------------------------------------------------------
// Try lock, silence otherwise

if (! kData->mutex.tryLock())
if (kData->engine->isOffline())
{
kData->mutex.lock();
}
else if (! kData->mutex.tryLock())
{
for (i=0; i < kData->audioOut.count; i++)
{
@@ -1118,14 +1130,14 @@ public:
if (i % 2 == 0)
{
// left
fAudioOutBuffers[i][k] = oldBufLeft[k] * (1.0f - balRangeL);
fAudioOutBuffers[i][k] = oldBufLeft[k] * (1.0f - balRangeL);
fAudioOutBuffers[i][k] += fAudioOutBuffers[i+1][k] * (1.0f - balRangeR);
}
else
{
// right
fAudioOutBuffers[i][k] = fAudioOutBuffers[i][k] * balRangeR;
fAudioOutBuffers[i][k] += oldBufLeft[k] * balRangeL;
fAudioOutBuffers[i][k] += oldBufLeft[k] * balRangeL;
}
}
}
@@ -1155,6 +1167,8 @@ public:

void bufferSizeChanged(const uint32_t newBufferSize)
{
carla_debug("LadspaPlugin::bufferSizeChanged(%i) - start", newBufferSize);

for (uint32_t i=0; i < kData->audioIn.count; i++)
{
if (fAudioInBuffers[i] != nullptr)
@@ -1205,6 +1219,8 @@ public:
fDescriptor->connect_port(fHandle2, kData->audioOut.ports[1].rindex, fAudioOutBuffers[1]);
}
}

carla_debug("LadspaPlugin::bufferSizeChanged(%i) - end", newBufferSize);
}

// -------------------------------------------------------------------
@@ -1331,7 +1347,7 @@ public:
// ---------------------------------------------------------------
// initialize plugin

fHandle = fDescriptor->instantiate(fDescriptor, kData->engine->getSampleRate());
fHandle = fDescriptor->instantiate(fDescriptor, (unsigned long)kData->engine->getSampleRate());

if (fHandle == nullptr)
{
@@ -1383,8 +1399,6 @@ CarlaPlugin* CarlaPlugin::newLADSPA(const Initializer& init, const LADSPA_RDF_De
return nullptr;
}

plugin->registerToOscClient();

return plugin;
#else
init.engine->setLastError("LADSPA support not available");


+ 10
- 9
source/backend/plugin/LinuxSamplerPlugin.cpp View File

@@ -164,21 +164,23 @@ class LinuxSamplerPlugin : public CarlaPlugin
public:
LinuxSamplerPlugin(CarlaEngine* const engine, const unsigned short id, const bool isGIG)
: CarlaPlugin(engine, id),
kIsGIG(isGIG)
kIsGIG(isGIG),
fSampler(nullptr),
fSamplerChannel(nullptr),
fEngine(nullptr),
fEngineChannel(nullptr),
fAudioOutputDevice(nullptr),
fMidiInputDevice(nullptr),
fMidiInputPort(nullptr),
fInstrument(nullptr)
{
carla_debug("LinuxSamplerPlugin::LinuxSamplerPlugin(%p, %i, %s)", engine, id, bool2str(isGIG));

fSampler = new LinuxSampler::Sampler;
fSamplerChannel = nullptr;

fEngine = nullptr;
fEngineChannel = nullptr;
fSampler = new LinuxSampler::Sampler;

fAudioOutputDevice = new LinuxSampler::AudioOutputDevicePlugin(engine, this);
fMidiInputDevice = new LinuxSampler::MidiInputDevicePlugin(fSampler);
fMidiInputPort = fMidiInputDevice->CreateMidiPort();

fInstrument = nullptr;
}

~LinuxSamplerPlugin()
@@ -986,7 +988,6 @@ CarlaPlugin* LinuxSamplerPlugin::newLinuxSampler(const Initializer& init, bool i
}

plugin->reload();
plugin->registerToOscClient();

return plugin;
}


+ 47
- 47
source/backend/plugin/Lv2Plugin.cpp View File

@@ -208,6 +208,7 @@ public:
{
carla_debug("Lv2Plugin::Lv2Plugin(%p, %i)", engine, id);

kData->osc.thread.setMode(CarlaPluginThread::PLUGIN_THREAD_LV2_GUI);
#if 0
m_type = PLUGIN_LV2;
m_count += 1;
@@ -1013,7 +1014,7 @@ public:
{
LV2_EXTERNAL_UI_HIDE((LV2_External_UI_Widget*)ui.widget);

if (rdf_descriptor->Author && strcmp(rdf_descriptor->Author, "linuxDSP") == 0)
if (rdf_descriptor->Author && std::strcmp(rdf_descriptor->Author, "linuxDSP") == 0)
{
carla_stderr("linuxDSP LV2 UI hack (force close instead of hide)");

@@ -1514,7 +1515,7 @@ public:
min = max;

// stupid hack for ir.lv2 (broken plugin)
if (strcmp(rdf_descriptor->URI, "http://factorial.hu/plugins/lv2/ir") == 0 && strncmp(rdf_descriptor->Ports[i].Name, "FileHash", 8) == 0)
if (std::strcmp(rdf_descriptor->URI, "http://factorial.hu/plugins/lv2/ir") == 0 && std::strncmp(rdf_descriptor->Ports[i].Name, "FileHash", 8) == 0)
{
min = 0.0;
max = 16777215.0; // 0xffffff
@@ -3065,7 +3066,7 @@ public:

for (size_t i=0; i < customURIDs.size(); i++)
{
if (customURIDs[i] && strcmp(customURIDs[i], uri) == 0)
if (customURIDs[i] && std::strcmp(customURIDs[i], uri) == 0)
return i;
}

@@ -3175,12 +3176,12 @@ public:
// Check if we already have this key
for (size_t i=0; i < custom.size(); i++)
{
if (strcmp(custom[i].key, uriKey) == 0)
if (std::strcmp(custom[i].key, uriKey) == 0)
{
if (custom[i].value)
free((void*)custom[i].value);

if (strcmp(stype, LV2_ATOM__String) == 0 || strcmp(stype, LV2_ATOM__Path) == 0)
if (std::strcmp(stype, LV2_ATOM__String) == 0 || std::strcmp(stype, LV2_ATOM__Path) == 0)
custom[i].value = strdup((const char*)value);
else
custom[i].value = strdup(QByteArray((const char*)value, size).toBase64().constData());
@@ -3194,7 +3195,7 @@ public:
newData.type = strdup(stype);
newData.key = strdup(uriKey);

if (strcmp(stype, LV2_ATOM__String) == 0 || strcmp(stype, LV2_ATOM__Path) == 0)
if (std::strcmp(stype, LV2_ATOM__String) == 0 || std::strcmp(stype, LV2_ATOM__Path) == 0)
newData.value = strdup((const char*)value);
else
newData.value = strdup(QByteArray((const char*)value, size).toBase64().constData());
@@ -3221,7 +3222,7 @@ public:

for (size_t i=0; i < custom.size(); i++)
{
if (strcmp(custom[i].key, uriKey) == 0)
if (std::strcmp(custom[i].key, uriKey) == 0)
{
stype = custom[i].type;
stringData = custom[i].value;
@@ -3239,14 +3240,14 @@ public:
*type = key;
*flags = LV2_STATE_IS_POD;

if (strcmp(stype, LV2_ATOM__String) == 0)
if (std::strcmp(stype, LV2_ATOM__String) == 0)
{
*size = strlen(stringData);
*size = std::strlen(stringData);
return stringData;
}
else if (strcmp(stype, LV2_ATOM__Path) == 0)
else if (std::strcmp(stype, LV2_ATOM__Path) == 0)
{
*size = strlen(stringData);
*size = std::strlen(stringData);
return stringData;
}
else
@@ -3308,7 +3309,7 @@ public:

for (uint32_t i=0; i < rdf_descriptor->PortCount; i++)
{
if (strcmp(rdf_descriptor->Ports[i].Symbol, symbol) == 0)
if (std::strcmp(rdf_descriptor->Ports[i].Symbol, symbol) == 0)
return i;
}

@@ -3408,14 +3409,14 @@ public:
CARLA_ASSERT(rdf_ui && rdf_ui->URI);

// Calf Analyzer is useless without instance-data
if (strcmp(rdf_ui->URI, "http://calf.sourceforge.net/plugins/Analyzer") == 0)
if (std::strcmp(rdf_ui->URI, "http://calf.sourceforge.net/plugins/Analyzer") == 0)
return false;

for (uint32_t i=0; i < rdf_ui->FeatureCount; i++)
{
CARLA_ASSERT(rdf_ui->Features[i].URI);

if (strcmp(rdf_ui->Features[i].URI, LV2_INSTANCE_ACCESS_URI) == 0 || strcmp(rdf_ui->Features[i].URI, LV2_DATA_ACCESS_URI) == 0)
if (std::strcmp(rdf_ui->Features[i].URI, LV2_INSTANCE_ACCESS_URI) == 0 || std::strcmp(rdf_ui->Features[i].URI, LV2_DATA_ACCESS_URI) == 0)
return false;
}

@@ -3431,7 +3432,7 @@ public:

for (uint32_t i=0; i < ui.rdf_descriptor->FeatureCount; i++)
{
if (strcmp(ui.rdf_descriptor->Features[i].URI, LV2_UI__fixedSize) == 0 || strcmp(ui.rdf_descriptor->Features[i].URI, LV2_UI__noUserResize) == 0)
if (std::strcmp(ui.rdf_descriptor->Features[i].URI, LV2_UI__fixedSize) == 0 || std::strcmp(ui.rdf_descriptor->Features[i].URI, LV2_UI__noUserResize) == 0)
return false;
}

@@ -3482,14 +3483,14 @@ public:

lv2_atom_forge_property_head(&forge, getCustomURID(cdata->key), CARLA_URI_MAP_ID_NULL);

if (strcmp(cdata->type, LV2_ATOM__String) == 0)
lv2_atom_forge_string(&forge, cdata->value, strlen(cdata->value));
else if (strcmp(cdata->type, LV2_ATOM__Path) == 0)
if (std::strcmp(cdata->type, LV2_ATOM__String) == 0)
lv2_atom_forge_string(&forge, cdata->value, std::strlen(cdata->value));
else if (std::strcmp(cdata->type, LV2_ATOM__Path) == 0)
lv2_atom_forge_path(&forge, cdata->value, strlen(cdata->value));
else if (strcmp(cdata->type, LV2_ATOM__Chunk) == 0)
lv2_atom_forge_literal(&forge, cdata->value, strlen(cdata->value), CARLA_URI_MAP_ID_ATOM_CHUNK, CARLA_URI_MAP_ID_NULL);
else if (std::strcmp(cdata->type, LV2_ATOM__Chunk) == 0)
lv2_atom_forge_literal(&forge, cdata->value, std::strlen(cdata->value), CARLA_URI_MAP_ID_ATOM_CHUNK, CARLA_URI_MAP_ID_NULL);
else
lv2_atom_forge_literal(&forge, cdata->value, strlen(cdata->value), getCustomURID(cdata->key), CARLA_URI_MAP_ID_NULL);
lv2_atom_forge_literal(&forge, cdata->value, std::strlen(cdata->value), getCustomURID(cdata->key), CARLA_URI_MAP_ID_NULL);

lv2_atom_forge_pop(&forge, &bodyFrame);
lv2_atom_forge_pop(&forge, &refFrame);
@@ -3610,7 +3611,7 @@ public:
break;
}

return strlen(buf);
return std::strlen(buf);
}

// ----------------- Programs Feature ------------------------------------------------
@@ -3713,45 +3714,45 @@ public:
return CARLA_URI_MAP_ID_NULL;

// Atom types
if (strcmp(uri, LV2_ATOM__Chunk) == 0)
if (std::strcmp(uri, LV2_ATOM__Chunk) == 0)
return CARLA_URI_MAP_ID_ATOM_CHUNK;
if (strcmp(uri, LV2_ATOM__Double) == 0)
if (std::strcmp(uri, LV2_ATOM__Double) == 0)
return CARLA_URI_MAP_ID_ATOM_DOUBLE;
if (strcmp(uri, LV2_ATOM__Int) == 0)
if (std::strcmp(uri, LV2_ATOM__Int) == 0)
return CARLA_URI_MAP_ID_ATOM_INT;
if (strcmp(uri, LV2_ATOM__Path) == 0)
if (std::strcmp(uri, LV2_ATOM__Path) == 0)
return CARLA_URI_MAP_ID_ATOM_PATH;
if (strcmp(uri, LV2_ATOM__Sequence) == 0)
if (std::strcmp(uri, LV2_ATOM__Sequence) == 0)
return CARLA_URI_MAP_ID_ATOM_SEQUENCE;
if (strcmp(uri, LV2_ATOM__String) == 0)
if (std::strcmp(uri, LV2_ATOM__String) == 0)
return CARLA_URI_MAP_ID_ATOM_STRING;
if (strcmp(uri, LV2_ATOM__atomTransfer) == 0)
if (std::strcmp(uri, LV2_ATOM__atomTransfer) == 0)
return CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM;
if (strcmp(uri, LV2_ATOM__eventTransfer) == 0)
if (std::strcmp(uri, LV2_ATOM__eventTransfer) == 0)
return CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT;

// BufSize types
if (strcmp(uri, LV2_BUF_SIZE__maxBlockLength) == 0)
if (std::strcmp(uri, LV2_BUF_SIZE__maxBlockLength) == 0)
return CARLA_URI_MAP_ID_BUF_MAX_LENGTH;
if (strcmp(uri, LV2_BUF_SIZE__minBlockLength) == 0)
if (std::strcmp(uri, LV2_BUF_SIZE__minBlockLength) == 0)
return CARLA_URI_MAP_ID_BUF_MIN_LENGTH;
if (strcmp(uri, LV2_BUF_SIZE__sequenceSize) == 0)
if (std::strcmp(uri, LV2_BUF_SIZE__sequenceSize) == 0)
return CARLA_URI_MAP_ID_BUF_SEQUENCE_SIZE;

// Log types
if (strcmp(uri, LV2_LOG__Error) == 0)
if (std::strcmp(uri, LV2_LOG__Error) == 0)
return CARLA_URI_MAP_ID_LOG_ERROR;
if (strcmp(uri, LV2_LOG__Note) == 0)
if (std::strcmp(uri, LV2_LOG__Note) == 0)
return CARLA_URI_MAP_ID_LOG_NOTE;
if (strcmp(uri, LV2_LOG__Trace) == 0)
if (std::strcmp(uri, LV2_LOG__Trace) == 0)
return CARLA_URI_MAP_ID_LOG_TRACE;
if (strcmp(uri, LV2_LOG__Warning) == 0)
if (std::strcmp(uri, LV2_LOG__Warning) == 0)
return CARLA_URI_MAP_ID_LOG_WARNING;

// Others
if (strcmp(uri, LV2_MIDI__MidiEvent) == 0)
if (std::strcmp(uri, LV2_MIDI__MidiEvent) == 0)
return CARLA_URI_MAP_ID_MIDI_EVENT;
if (strcmp(uri, LV2_PARAMETERS__sampleRate) == 0)
if (std::strcmp(uri, LV2_PARAMETERS__sampleRate) == 0)
return CARLA_URI_MAP_ID_PARAM_SAMPLE_RATE;

if (! handle)
@@ -4070,7 +4071,7 @@ public:
uint32_t i = 0;
while ((descriptor = libDesc->get_plugin(libDesc->handle, i++)))
{
if (strcmp(descriptor->URI, URI) == 0)
if (std::strcmp(descriptor->URI, URI) == 0)
break;
}

@@ -4101,7 +4102,7 @@ public:
uint32_t i = 0;
while ((descriptor = descFn(i++)))
{
if (strcmp(descriptor->URI, URI) == 0)
if (std::strcmp(descriptor->URI, URI) == 0)
break;
}
}
@@ -4147,11 +4148,11 @@ public:
// Check extensions
for (uint32_t i=0; i < rdf_descriptor->ExtensionCount; i++)
{
if (strcmp(rdf_descriptor->Extensions[i], LV2_PROGRAMS__Interface) == 0)
if (std::strcmp(rdf_descriptor->Extensions[i], LV2_PROGRAMS__Interface) == 0)
m_hints |= PLUGIN_HAS_EXTENSION_PROGRAMS;
else if (strcmp(rdf_descriptor->Extensions[i], LV2_STATE__interface) == 0)
else if (std::strcmp(rdf_descriptor->Extensions[i], LV2_STATE__interface) == 0)
m_hints |= PLUGIN_HAS_EXTENSION_STATE;
else if (strcmp(rdf_descriptor->Extensions[i], LV2_WORKER__interface) == 0)
else if (std::strcmp(rdf_descriptor->Extensions[i], LV2_WORKER__interface) == 0)
m_hints |= PLUGIN_HAS_EXTENSION_WORKER;
else
carla_debug("Plugin has non-supported extension: '%s'", rdf_descriptor->Extensions[i]);
@@ -4270,7 +4271,7 @@ public:
case LV2_UI_EXTERNAL:
case LV2_UI_OLD_EXTERNAL:
// Calf Analyzer is useless using external-ui
if (strcmp(rdf_descriptor->URI, "http://calf.sourceforge.net/plugins/Analyzer") != 0)
if (std::strcmp(rdf_descriptor->URI, "http://calf.sourceforge.net/plugins/Analyzer") != 0)
iExt = i;
break;

@@ -4381,7 +4382,7 @@ public:
uint32_t i = 0;
while ((ui.descriptor = ui_descFn(i++)))
{
if (strcmp(ui.descriptor->URI, ui.rdf_descriptor->URI) == 0)
if (std::strcmp(ui.descriptor->URI, ui.rdf_descriptor->URI) == 0)
break;
}

@@ -4685,7 +4686,6 @@ CarlaPlugin* CarlaPlugin::newLV2(const Initializer& init)
}
}

plugin->registerToOscClient();
//plugin->updateUi();

return plugin;


+ 8
- 12
source/backend/plugin/NativePlugin.cpp View File

@@ -99,14 +99,17 @@ class NativePlugin : public CarlaPlugin
{
public:
NativePlugin(CarlaEngine* const engine, const unsigned int id)
: CarlaPlugin(engine, id)
: CarlaPlugin(engine, id),
fHandle(nullptr),
fHandle2(nullptr),
fDescriptor(nullptr),
fIsProcessing(false),
fAudioInBuffers(nullptr),
fAudioOutBuffers(nullptr),
fMidiEventCount(0)
{
carla_debug("NativePlugin::NativePlugin(%p, %i)", engine, id);

fHandle = nullptr;
fHandle2 = nullptr;
fDescriptor = nullptr;

fHost.handle = this;
fHost.get_buffer_size = carla_host_get_buffer_size;
fHost.get_sample_rate = carla_host_get_sample_rate;
@@ -116,11 +119,6 @@ public:
fHost.ui_custom_data_changed = carla_host_ui_custom_data_changed;
fHost.ui_closed = carla_host_ui_closed;

fIsProcessing = false;

fAudioInBuffers = nullptr;
fAudioOutBuffers = nullptr;
fMidiEventCount = 0;
carla_zeroMem(fMidiEvents, sizeof(::MidiEvent)*MAX_MIDI_EVENTS*2);
}

@@ -1873,8 +1871,6 @@ CarlaPlugin* CarlaPlugin::newNative(const Initializer& init)
return nullptr;
}

plugin->registerToOscClient();

return plugin;
#else
init.engine->setLastError("Internal plugins not available");


+ 36
- 38
source/backend/plugin/VstPlugin.cpp View File

@@ -46,8 +46,6 @@ public:
carla_debug("VstPlugin::VstPlugin(%p, %i)", engine, id);

#if 0
m_type = PLUGIN_VST;

effect = nullptr;
events.numEvents = 0;
events.reserved = 0;
@@ -71,6 +69,8 @@ public:
srand(id);
unique1 = unique2 = rand();
#endif

kData->osc.thread.setMode(CarlaPluginThread::PLUGIN_THREAD_VST_GUI);
}

~VstPlugin()
@@ -779,7 +779,7 @@ public:
char strBuf[255] = { 0 };
getLabel(strBuf);

if (strcmp(strBuf, "IL Harmless") == 0)
if (std::strcmp(strBuf, "IL Harmless") == 0)
{
// TODO - disable threaded processing
}
@@ -1716,7 +1716,7 @@ public:
{
prog.names[index] = strdup(strBuf);
}
else if (strBuf[0] != 0 && strcmp(strBuf, prog.names[index]) != 0)
else if (strBuf[0] != 0 && std::strcmp(strBuf, prog.names[index]) != 0)
{
free((void*)prog.names[index]);
prog.names[index] = strdup(strBuf);
@@ -1740,43 +1740,43 @@ public:
{
carla_debug("VstPlugin::hostCanDo(\"%s\")", feature);

if (strcmp(feature, "supplyIdle") == 0)
if (std::strcmp(feature, "supplyIdle") == 0)
return 1;
if (strcmp(feature, "sendVstEvents") == 0)
if (std::strcmp(feature, "sendVstEvents") == 0)
return 1;
if (strcmp(feature, "sendVstMidiEvent") == 0)
if (std::strcmp(feature, "sendVstMidiEvent") == 0)
return 1;
if (strcmp(feature, "sendVstMidiEventFlagIsRealtime") == 0)
if (std::strcmp(feature, "sendVstMidiEventFlagIsRealtime") == 0)
return -1;
if (strcmp(feature, "sendVstTimeInfo") == 0)
if (std::strcmp(feature, "sendVstTimeInfo") == 0)
return 1;
if (strcmp(feature, "receiveVstEvents") == 0)
if (std::strcmp(feature, "receiveVstEvents") == 0)
return 1;
if (strcmp(feature, "receiveVstMidiEvent") == 0)
if (std::strcmp(feature, "receiveVstMidiEvent") == 0)
return 1;
if (strcmp(feature, "receiveVstTimeInfo") == 0)
if (std::strcmp(feature, "receiveVstTimeInfo") == 0)
return -1;
if (strcmp(feature, "reportConnectionChanges") == 0)
if (std::strcmp(feature, "reportConnectionChanges") == 0)
return -1;
if (strcmp(feature, "acceptIOChanges") == 0)
if (std::strcmp(feature, "acceptIOChanges") == 0)
{
//if (CarlaEngine::processMode == PROCESS_MODE_CONTINUOUS_RACK)
// return -1;
return 1;
}
if (strcmp(feature, "sizeWindow") == 0)
if (std::strcmp(feature, "sizeWindow") == 0)
return 1;
if (strcmp(feature, "offline") == 0)
if (std::strcmp(feature, "offline") == 0)
return -1;
if (strcmp(feature, "openFileSelector") == 0)
if (std::strcmp(feature, "openFileSelector") == 0)
return -1;
if (strcmp(feature, "closeFileSelector") == 0)
if (std::strcmp(feature, "closeFileSelector") == 0)
return -1;
if (strcmp(feature, "startStopProcess") == 0)
if (std::strcmp(feature, "startStopProcess") == 0)
return 1;
if (strcmp(feature, "supportShell") == 0)
if (std::strcmp(feature, "supportShell") == 0)
return -1;
if (strcmp(feature, "shellCategory") == 0)
if (std::strcmp(feature, "shellCategory") == 0)
return -1;

// unimplemented
@@ -1797,29 +1797,29 @@ public:
{
const char* const func = (char*)ptr;

if (strcmp(func, "GetPlayPosition") == 0)
if (std::strcmp(func, "GetPlayPosition") == 0)
return 0;
if (strcmp(func, "GetPlayPosition2") == 0)
if (std::strcmp(func, "GetPlayPosition2") == 0)
return 0;
if (strcmp(func, "GetCursorPosition") == 0)
if (std::strcmp(func, "GetCursorPosition") == 0)
return 0;
if (strcmp(func, "GetPlayState") == 0)
if (std::strcmp(func, "GetPlayState") == 0)
return 0;
if (strcmp(func, "SetEditCurPos") == 0)
if (std::strcmp(func, "SetEditCurPos") == 0)
return 0;
if (strcmp(func, "GetSetRepeat") == 0)
if (std::strcmp(func, "GetSetRepeat") == 0)
return 0;
if (strcmp(func, "GetProjectPath") == 0)
if (std::strcmp(func, "GetProjectPath") == 0)
return 0;
if (strcmp(func, "OnPlayButton") == 0)
if (std::strcmp(func, "OnPlayButton") == 0)
return 0;
if (strcmp(func, "OnStopButton") == 0)
if (std::strcmp(func, "OnStopButton") == 0)
return 0;
if (strcmp(func, "OnPauseButton") == 0)
if (std::strcmp(func, "OnPauseButton") == 0)
return 0;
if (strcmp(func, "IsInRealTimeAudio") == 0)
if (std::strcmp(func, "IsInRealTimeAudio") == 0)
return 0;
if (strcmp(func, "Audio_IsRunning") == 0)
if (std::strcmp(func, "Audio_IsRunning") == 0)
return 0;
}
#endif
@@ -2096,7 +2096,7 @@ public:
CARLA_ASSERT(ptr);
if (ptr)
{
strcpy((char*)ptr, "Cadence");
std::strcpy((char*)ptr, "Cadence");
ret = 1;
}
else
@@ -2107,7 +2107,7 @@ public:
CARLA_ASSERT(ptr);
if (ptr)
{
strcpy((char*)ptr, "Carla");
std::strcpy((char*)ptr, "Carla");
ret = 1;
}
else
@@ -2151,7 +2151,7 @@ public:
case audioMasterGetDirectory:
// TODO
//if (ptr)
// strcpy((char*)ptr, "stuff");
// std::strcpy((char*)ptr, "stuff");
//else
// carla_stderr("VstPlugin::hostCallback::audioMasterGetDirectory called with invalid pointer");
break;
@@ -2413,8 +2413,6 @@ CarlaPlugin* CarlaPlugin::newVST(const Initializer& init)
}
}

plugin->registerToOscClient();

return plugin;
#else
init.engine->setLastError("VST support not available");


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

@@ -1659,7 +1659,7 @@ protected:

const char* const method = &argv[0]->s;

if (strcmp(method, "/nsm/server/announce") == 0 && standalone.callback)
if (std::strcmp(method, "/nsm/server/announce") == 0 && standalone.callback)
standalone.callback(nullptr, CarlaBackend::CALLBACK_NSM_ANNOUNCE, 0, 0, 0, 0.0, nullptr); // FIXME?

return 0;


+ 1
- 1
source/bridges/CarlaBridgeOsc.hpp View File

@@ -41,7 +41,7 @@
return 1; \
} \
/* check argument types */ \
if (strcmp(types, typesToCompare) != 0) \
if (std::strcmp(types, typesToCompare) != 0) \
{ \
carla_stderr("CarlaBridgeOsc::%s() - argument types mismatch: '%s' != '%s'", __FUNCTION__, types, typesToCompare); \
return 1; \


+ 32
- 32
source/bridges/CarlaBridgeUI-LV2.cpp View File

@@ -349,7 +349,7 @@ public:

for (uint32_t i=0; i < rdf_descriptor->UICount; i++)
{
if (strcmp(rdf_descriptor->UIs[i].URI, uiURI) == 0)
if (std::strcmp(rdf_descriptor->UIs[i].URI, uiURI) == 0)
{
rdf_ui_descriptor = &rdf_descriptor->UIs[i];
break;
@@ -379,7 +379,7 @@ public:
uint32_t i = 0;
while ((descriptor = ui_descFn(i++)))
{
if (strcmp(descriptor->URI, uiURI) == 0)
if (std::strcmp(descriptor->URI, uiURI) == 0)
break;
}

@@ -400,7 +400,7 @@ public:
#ifndef BRIDGE_LV2_X11
for (uint32_t i=0; i < rdf_ui_descriptor->FeatureCount; i++)
{
if (strcmp(rdf_ui_descriptor->Features[i].URI, LV2_UI__fixedSize) == 0 || strcmp(rdf_ui_descriptor->Features[i].URI, LV2_UI__noUserResize) == 0)
if (std::strcmp(rdf_ui_descriptor->Features[i].URI, LV2_UI__fixedSize) == 0 || std::strcmp(rdf_ui_descriptor->Features[i].URI, LV2_UI__noUserResize) == 0)
{
m_resizable = false;
break;
@@ -413,7 +413,7 @@ public:

for (uint32_t i=0; descriptor->extension_data && i < rdf_ui_descriptor->ExtensionCount; i++)
{
if (strcmp(rdf_ui_descriptor->Extensions[i], LV2_PROGRAMS__UIInterface) == 0)
if (std::strcmp(rdf_ui_descriptor->Extensions[i], LV2_PROGRAMS__UIInterface) == 0)
{
programs = (LV2_Programs_UI_Interface*)descriptor->extension_data(LV2_PROGRAMS__UIInterface);

@@ -534,7 +534,7 @@ public:

for (size_t i=0; i < customURIDs.size(); i++)
{
if (customURIDs[i] && strcmp(customURIDs[i], uri) == 0)
if (customURIDs[i] && std::strcmp(customURIDs[i], uri) == 0)
return i;
}

@@ -598,14 +598,14 @@ public:

//lv2_atom_forge_property_head(&forge, getCustomURID(key), CARLA_URI_MAP_ID_NULL);

if (strcmp(type, "string") == 0)
lv2_atom_forge_string(&forge, value, strlen(value));
else if (strcmp(type, "path") == 0)
lv2_atom_forge_path(&forge, value, strlen(value));
else if (strcmp(type, "chunk") == 0)
lv2_atom_forge_literal(&forge, value, strlen(value), CARLA_URI_MAP_ID_ATOM_CHUNK, CARLA_URI_MAP_ID_NULL);
if (std::strcmp(type, "string") == 0)
lv2_atom_forge_string(&forge, value, std::strlen(value));
else if (std::strcmp(type, "path") == 0)
lv2_atom_forge_path(&forge, value, std::strlen(value));
else if (std::strcmp(type, "chunk") == 0)
lv2_atom_forge_literal(&forge, value, std::strlen(value), CARLA_URI_MAP_ID_ATOM_CHUNK, CARLA_URI_MAP_ID_NULL);
//else
// lv2_atom_forge_literal(&forge, value, strlen(value), getCustomURID(key), CARLA_URI_MAP_ID_NULL);
// lv2_atom_forge_literal(&forge, value, std::strlen(value), getCustomURID(key), CARLA_URI_MAP_ID_NULL);

lv2_atom_forge_pop(&forge, &bodyFrame);
lv2_atom_forge_pop(&forge, &refFrame);
@@ -636,7 +636,7 @@ public:

for (uint32_t i=0; i < rdf_descriptor->PortCount; i++)
{
if (strcmp(rdf_descriptor->Ports[i].Symbol, symbol) == 0)
if (std::strcmp(rdf_descriptor->Ports[i].Symbol, symbol) == 0)
return i;
}

@@ -767,7 +767,7 @@ public:
break;
}

return strlen(buf);
return std::strlen(buf);
}

// ----------------- Programs Feature ------------------------------------------------
@@ -846,45 +846,45 @@ public:
return CARLA_URI_MAP_ID_NULL;

// Atom types
if (strcmp(uri, LV2_ATOM__Chunk) == 0)
if (std::strcmp(uri, LV2_ATOM__Chunk) == 0)
return CARLA_URI_MAP_ID_ATOM_CHUNK;
if (strcmp(uri, LV2_ATOM__Double) == 0)
if (std::strcmp(uri, LV2_ATOM__Double) == 0)
return CARLA_URI_MAP_ID_ATOM_DOUBLE;
if (strcmp(uri, LV2_ATOM__Int) == 0)
if (std::strcmp(uri, LV2_ATOM__Int) == 0)
return CARLA_URI_MAP_ID_ATOM_INT;
if (strcmp(uri, LV2_ATOM__Path) == 0)
if (std::strcmp(uri, LV2_ATOM__Path) == 0)
return CARLA_URI_MAP_ID_ATOM_PATH;
if (strcmp(uri, LV2_ATOM__Sequence) == 0)
if (std::strcmp(uri, LV2_ATOM__Sequence) == 0)
return CARLA_URI_MAP_ID_ATOM_SEQUENCE;
if (strcmp(uri, LV2_ATOM__String) == 0)
if (std::strcmp(uri, LV2_ATOM__String) == 0)
return CARLA_URI_MAP_ID_ATOM_STRING;
if (strcmp(uri, LV2_ATOM__atomTransfer) == 0)
if (std::strcmp(uri, LV2_ATOM__atomTransfer) == 0)
return CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM;
if (strcmp(uri, LV2_ATOM__eventTransfer) == 0)
if (std::strcmp(uri, LV2_ATOM__eventTransfer) == 0)
return CARLA_URI_MAP_ID_ATOM_TRANSFER_EVENT;

// BufSize types
if (strcmp(uri, LV2_BUF_SIZE__maxBlockLength) == 0)
if (std::strcmp(uri, LV2_BUF_SIZE__maxBlockLength) == 0)
return CARLA_URI_MAP_ID_BUF_MAX_LENGTH;
if (strcmp(uri, LV2_BUF_SIZE__minBlockLength) == 0)
if (std::strcmp(uri, LV2_BUF_SIZE__minBlockLength) == 0)
return CARLA_URI_MAP_ID_BUF_MIN_LENGTH;
if (strcmp(uri, LV2_BUF_SIZE__sequenceSize) == 0)
if (std::strcmp(uri, LV2_BUF_SIZE__sequenceSize) == 0)
return CARLA_URI_MAP_ID_BUF_SEQUENCE_SIZE;

// Log types
if (strcmp(uri, LV2_LOG__Error) == 0)
if (std::strcmp(uri, LV2_LOG__Error) == 0)
return CARLA_URI_MAP_ID_LOG_ERROR;
if (strcmp(uri, LV2_LOG__Note) == 0)
if (std::strcmp(uri, LV2_LOG__Note) == 0)
return CARLA_URI_MAP_ID_LOG_NOTE;
if (strcmp(uri, LV2_LOG__Trace) == 0)
if (std::strcmp(uri, LV2_LOG__Trace) == 0)
return CARLA_URI_MAP_ID_LOG_TRACE;
if (strcmp(uri, LV2_LOG__Warning) == 0)
if (std::strcmp(uri, LV2_LOG__Warning) == 0)
return CARLA_URI_MAP_ID_LOG_WARNING;

// Others
if (strcmp(uri, LV2_MIDI__MidiEvent) == 0)
if (std::strcmp(uri, LV2_MIDI__MidiEvent) == 0)
return CARLA_URI_MAP_ID_MIDI_EVENT;
if (strcmp(uri, LV2_PARAMETERS__sampleRate) == 0)
if (std::strcmp(uri, LV2_PARAMETERS__sampleRate) == 0)
return CARLA_URI_MAP_ID_PARAM_SAMPLE_RATE;

if (! handle)
@@ -1077,7 +1077,7 @@ int main(int argc, char* argv[])
const char* uiURI = argv[3];
const char* uiTitle = argv[4];

const bool useOsc = strcmp(oscUrl, "null");
const bool useOsc = std::strcmp(oscUrl, "null");

// try to get sampleRate value
const char* const sampleRateStr = getenv("CARLA_SAMPLE_RATE");


+ 20
- 20
source/bridges/CarlaBridgeUI-VST.cpp View File

@@ -303,39 +303,39 @@ public:
{
qDebug("CarlaVstClient::hostCanDo(\"%s\")", feature);

if (strcmp(feature, "supplyIdle") == 0)
if (std::strcmp(feature, "supplyIdle") == 0)
return 1;
if (strcmp(feature, "sendVstEvents") == 0)
if (std::strcmp(feature, "sendVstEvents") == 0)
return 1;
if (strcmp(feature, "sendVstMidiEvent") == 0)
if (std::strcmp(feature, "sendVstMidiEvent") == 0)
return 1;
if (strcmp(feature, "sendVstMidiEventFlagIsRealtime") == 0)
if (std::strcmp(feature, "sendVstMidiEventFlagIsRealtime") == 0)
return -1;
if (strcmp(feature, "sendVstTimeInfo") == 0)
if (std::strcmp(feature, "sendVstTimeInfo") == 0)
return 1;
if (strcmp(feature, "receiveVstEvents") == 0)
if (std::strcmp(feature, "receiveVstEvents") == 0)
return 1;
if (strcmp(feature, "receiveVstMidiEvent") == 0)
if (std::strcmp(feature, "receiveVstMidiEvent") == 0)
return 1;
if (strcmp(feature, "receiveVstTimeInfo") == 0)
if (std::strcmp(feature, "receiveVstTimeInfo") == 0)
return -1;
if (strcmp(feature, "reportConnectionChanges") == 0)
if (std::strcmp(feature, "reportConnectionChanges") == 0)
return -1;
if (strcmp(feature, "acceptIOChanges") == 0)
if (std::strcmp(feature, "acceptIOChanges") == 0)
return 1;
if (strcmp(feature, "sizeWindow") == 0)
if (std::strcmp(feature, "sizeWindow") == 0)
return 1;
if (strcmp(feature, "offline") == 0)
if (std::strcmp(feature, "offline") == 0)
return -1;
if (strcmp(feature, "openFileSelector") == 0)
if (std::strcmp(feature, "openFileSelector") == 0)
return -1;
if (strcmp(feature, "closeFileSelector") == 0)
if (std::strcmp(feature, "closeFileSelector") == 0)
return -1;
if (strcmp(feature, "startStopProcess") == 0)
if (std::strcmp(feature, "startStopProcess") == 0)
return 1;
if (strcmp(feature, "supportShell") == 0)
if (std::strcmp(feature, "supportShell") == 0)
return -1;
if (strcmp(feature, "shellCategory") == 0)
if (std::strcmp(feature, "shellCategory") == 0)
return -1;

// unimplemented
@@ -465,12 +465,12 @@ public:

case audioMasterGetVendorString:
if (ptr)
strcpy((char*)ptr, "Cadence");
std::strcpy((char*)ptr, "Cadence");
break;

case audioMasterGetProductString:
if (ptr)
strcpy((char*)ptr, "Carla-Bridge");
std::strcpy((char*)ptr, "Carla-Bridge");
break;

case audioMasterGetVendorVersion:
@@ -548,7 +548,7 @@ int main(int argc, char* argv[])
const char* binary = argv[2];
const char* uiTitle = argv[3];

const bool useOsc = strcmp(oscUrl, "null");
const bool useOsc = std::strcmp(oscUrl, "null");

// try to get sampleRate value
const char* const sampleRateStr = getenv("CARLA_SAMPLE_RATE");


+ 1
- 1
source/carla_backend.py View File

@@ -46,7 +46,7 @@ class ParameterData(Structure):
("type", c_enum),
("index", c_int32),
("rindex", c_int32),
("hints", c_int32),
("hints", c_uint32),
("midiChannel", c_uint8),
("midiCC", c_int16)
]


+ 32
- 32
source/discovery/carla-discovery.cpp View File

@@ -93,39 +93,39 @@ intptr_t vstHostCanDo(const char* const feature)
qDebug("vstHostCanDo(\"%s\")", feature);
#endif

if (strcmp(feature, "supplyIdle") == 0)
if (std::strcmp(feature, "supplyIdle") == 0)
return 1;
if (strcmp(feature, "sendVstEvents") == 0)
if (std::strcmp(feature, "sendVstEvents") == 0)
return 1;
if (strcmp(feature, "sendVstMidiEvent") == 0)
if (std::strcmp(feature, "sendVstMidiEvent") == 0)
return 1;
if (strcmp(feature, "sendVstMidiEventFlagIsRealtime") == 0)
if (std::strcmp(feature, "sendVstMidiEventFlagIsRealtime") == 0)
return 1;
if (strcmp(feature, "sendVstTimeInfo") == 0)
if (std::strcmp(feature, "sendVstTimeInfo") == 0)
return 1;
if (strcmp(feature, "receiveVstEvents") == 0)
if (std::strcmp(feature, "receiveVstEvents") == 0)
return 1;
if (strcmp(feature, "receiveVstMidiEvent") == 0)
if (std::strcmp(feature, "receiveVstMidiEvent") == 0)
return 1;
if (strcmp(feature, "receiveVstTimeInfo") == 0)
if (std::strcmp(feature, "receiveVstTimeInfo") == 0)
return -1;
if (strcmp(feature, "reportConnectionChanges") == 0)
if (std::strcmp(feature, "reportConnectionChanges") == 0)
return -1;
if (strcmp(feature, "acceptIOChanges") == 0)
if (std::strcmp(feature, "acceptIOChanges") == 0)
return 1;
if (strcmp(feature, "sizeWindow") == 0)
if (std::strcmp(feature, "sizeWindow") == 0)
return 1;
if (strcmp(feature, "offline") == 0)
if (std::strcmp(feature, "offline") == 0)
return -1;
if (strcmp(feature, "openFileSelector") == 0)
if (std::strcmp(feature, "openFileSelector") == 0)
return -1;
if (strcmp(feature, "closeFileSelector") == 0)
if (std::strcmp(feature, "closeFileSelector") == 0)
return -1;
if (strcmp(feature, "startStopProcess") == 0)
if (std::strcmp(feature, "startStopProcess") == 0)
return 1;
if (strcmp(feature, "supportShell") == 0)
if (std::strcmp(feature, "supportShell") == 0)
return 1;
if (strcmp(feature, "shellCategory") == 0)
if (std::strcmp(feature, "shellCategory") == 0)
return 1;

// unimplemented
@@ -223,7 +223,7 @@ intptr_t VSTCALLBACK vstHostCallback(AEffect* const effect, const int32_t opcode
case audioMasterGetVendorString:
if (ptr)
{
strcpy((char*)ptr, "falkTX");
std::strcpy((char*)ptr, "falkTX");
ret = 1;
}
break;
@@ -231,7 +231,7 @@ intptr_t VSTCALLBACK vstHostCallback(AEffect* const effect, const int32_t opcode
case audioMasterGetProductString:
if (ptr)
{
strcpy((char*)ptr, "Carla-Discovery");
std::strcpy((char*)ptr, "Carla-Discovery");
ret = 1;
}
break;
@@ -419,7 +419,7 @@ void do_ladspa_check(void* const libHandle, const bool init)
{
if (LADSPA_IS_PORT_INPUT(portDescriptor))
parametersIns += 1;
else if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && strcmp(descriptor->PortNames[j], "latency") && strcmp(descriptor->PortNames[j], "_latency"))
else if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && std::strcmp(descriptor->PortNames[j], "latency") && std::strcmp(descriptor->PortNames[j], "_latency"))
parametersOuts += 1;

parametersTotal += 1;
@@ -489,7 +489,7 @@ void do_ladspa_check(void* const libHandle, const bool init)
def *= sampleRate;
}

if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && (strcmp(portName, "latency") == 0 || strcmp(portName, "_latency") == 0))
if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && (std::strcmp(portName, "latency") == 0 || std::strcmp(portName, "_latency") == 0))
{
// latency parameter
def = 0.0f;
@@ -618,7 +618,7 @@ void do_dssi_check(void* const libHandle, const bool init)
{
if (LADSPA_IS_PORT_INPUT(portDescriptor))
parametersIns += 1;
else if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && strcmp(ldescriptor->PortNames[j], "latency") && strcmp(ldescriptor->PortNames[j], "_latency"))
else if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && std::strcmp(ldescriptor->PortNames[j], "latency") && std::strcmp(ldescriptor->PortNames[j], "_latency"))
parametersOuts += 1;

parametersTotal += 1;
@@ -700,7 +700,7 @@ void do_dssi_check(void* const libHandle, const bool init)
def *= sampleRate;
}

if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && (strcmp(portName, "latency") == 0 || strcmp(portName, "_latency") == 0))
if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && (std::strcmp(portName, "latency") == 0 || std::strcmp(portName, "_latency") == 0))
{
// latency parameter
def = 0.0f;
@@ -919,7 +919,7 @@ void do_lv2_check(const char* const bundle, const bool init)
{
const LV2_RDF_Feature* const rdfFeature = &rdfDescriptor->Features[j];

if (strcmp(rdfFeature->URI, LV2_CORE__hardRTCapable) == 0)
if (std::strcmp(rdfFeature->URI, LV2_CORE__hardRTCapable) == 0)
hints |= PLUGIN_IS_RTSAFE;
}

@@ -1384,7 +1384,7 @@ void do_linuxsampler_check(const char* const filename, const char* const stype,

int main(int argc, char* argv[])
{
if (argc == 2 && strcmp(argv[1], "-formats") == 0)
if (argc == 2 && std::strcmp(argv[1], "-formats") == 0)
{
printf("Available plugin formats:\n");
printf("LADSPA: ");
@@ -1448,37 +1448,37 @@ int main(int argc, char* argv[])
PluginType type;
void* handle = nullptr;

if (strcmp(stype, "LADSPA") == 0)
if (std::strcmp(stype, "LADSPA") == 0)
{
openLib = true;
type = PLUGIN_LADSPA;
}
else if (strcmp(stype, "DSSI") == 0)
else if (std::strcmp(stype, "DSSI") == 0)
{
openLib = true;
type = PLUGIN_DSSI;
}
else if (strcmp(stype, "LV2") == 0)
else if (std::strcmp(stype, "LV2") == 0)
{
openLib = false;
type = PLUGIN_LV2;
}
else if (strcmp(stype, "VST") == 0)
else if (std::strcmp(stype, "VST") == 0)
{
openLib = true;
type = PLUGIN_VST;
}
else if (strcmp(stype, "GIG") == 0)
else if (std::strcmp(stype, "GIG") == 0)
{
openLib = false;
type = PLUGIN_GIG;
}
else if (strcmp(stype, "SF2") == 0)
else if (std::strcmp(stype, "SF2") == 0)
{
openLib = false;
type = PLUGIN_SF2;
}
else if (strcmp(stype, "SFZ") == 0)
else if (std::strcmp(stype, "SFZ") == 0)
{
openLib = false;
type = PLUGIN_SFZ;


+ 1
- 1
source/tests/ANSI.cpp View File

@@ -17,7 +17,7 @@

// still need qt classes check
//#include "CarlaPlugin.hpp"
#include "plugin/CarlaPlugin.cpp"
#include "plugin/DssiPlugin.cpp"

#if 0
#include "CarlaDefines.hpp"


+ 2
- 2
source/tests/Makefile View File

@@ -9,8 +9,8 @@ include ../Makefile.mk
# --------------------------------------------------------------

BUILD_CXX_FLAGS += -I../backend -I../includes -I../libs -I../utils -Wall -Wextra
BUILD_CXX_FLAGS += -DWANT_JACK -DWANT_RTAUDIO
# BUILD_CXX_FLAGS += -isystem /usr/include/qt4
BUILD_CXX_FLAGS += -DWANT_JACK -DWANT_LADSPA -DWANT_DSSI
BUILD_CXX_FLAGS += -isystem /usr/include/qt4
# BUILD_CXX_FLAGS += -isystem ../backend/engine/rtaudio-4.0.11
# BUILD_CXX_FLAGS += -I/opt/mingw32/include



+ 71
- 71
source/utils/CarlaLv2Utils.hpp View File

@@ -681,35 +681,35 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri)
{
if (const char* const designation = designationNodes.get_first().as_string())
{
if (strcmp(designation, LV2_CORE__freeWheeling) == 0)
if (std::strcmp(designation, LV2_CORE__freeWheeling) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_FREEWHEELING;
else if (strcmp(designation, LV2_CORE__latency) == 0)
else if (std::strcmp(designation, LV2_CORE__latency) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_LATENCY;
else if (strcmp(designation, LV2_PARAMETERS__sampleRate) == 0)
else if (std::strcmp(designation, LV2_PARAMETERS__sampleRate) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_SAMPLE_RATE;
else if (strcmp(designation, LV2_TIME__bar) == 0)
else if (std::strcmp(designation, LV2_TIME__bar) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_BAR;
else if (strcmp(designation, LV2_TIME__barBeat) == 0)
else if (std::strcmp(designation, LV2_TIME__barBeat) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_BAR_BEAT;
else if (strcmp(designation, LV2_TIME__beat) == 0)
else if (std::strcmp(designation, LV2_TIME__beat) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_BEAT;
else if (strcmp(designation, LV2_TIME__beatUnit) == 0)
else if (std::strcmp(designation, LV2_TIME__beatUnit) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_BEAT_UNIT;
else if (strcmp(designation, LV2_TIME__beatsPerBar) == 0)
else if (std::strcmp(designation, LV2_TIME__beatsPerBar) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR;
else if (strcmp(designation, LV2_TIME__beatsPerMinute) == 0)
else if (std::strcmp(designation, LV2_TIME__beatsPerMinute) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE;
else if (strcmp(designation, LV2_TIME__frame) == 0)
else if (std::strcmp(designation, LV2_TIME__frame) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_FRAME;
else if (strcmp(designation, LV2_TIME__framesPerSecond) == 0)
else if (std::strcmp(designation, LV2_TIME__framesPerSecond) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND;
else if (strcmp(designation, LV2_TIME__position) == 0)
else if (std::strcmp(designation, LV2_TIME__position) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_POSITION;
else if (strcmp(designation, LV2_TIME__speed) == 0)
else if (std::strcmp(designation, LV2_TIME__speed) == 0)
rdfPort->Designation = LV2_PORT_DESIGNATION_TIME_SPEED;
else if (strncmp(designation, LV2_PARAMETERS_PREFIX, strlen(LV2_PARAMETERS_PREFIX)) == 0)
else if (std::strncmp(designation, LV2_PARAMETERS_PREFIX, std::strlen(LV2_PARAMETERS_PREFIX)) == 0)
pass();
else if (strncmp(designation, LV2_PORT_GROUPS_PREFIX, strlen(LV2_PORT_GROUPS_PREFIX)) == 0)
else if (std::strncmp(designation, LV2_PORT_GROUPS_PREFIX, std::strlen(LV2_PORT_GROUPS_PREFIX)) == 0)
pass();
else
qWarning("lv2_rdf_new(\"%s\") - got unknown port designation '%s'", uri, designation);
@@ -735,9 +735,9 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri)
{
if (const char* const midiMapType = midiMapTypeNodes.get_first().as_string())
{
if (strcmp(midiMapType, LV2_MIDI_Map__CC) == 0)
if (std::strcmp(midiMapType, LV2_MIDI_Map__CC) == 0)
rdfPort->MidiMap.Type = LV2_PORT_MIDI_MAP_CC;
else if (strcmp(midiMapType, LV2_MIDI_Map__NRPN) == 0)
else if (std::strcmp(midiMapType, LV2_MIDI_Map__NRPN) == 0)
rdfPort->MidiMap.Type = LV2_PORT_MIDI_MAP_NRPN;
else
qWarning("lv2_rdf_new(\"%s\") - got unknown port Midi-Map type '%s'", uri, midiMapType);
@@ -790,53 +790,53 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri)
{
rdfPort->Unit.Hints |= LV2_PORT_UNIT_UNIT;

if (strcmp(unitUnit, LV2_UNITS__bar) == 0)
if (std::strcmp(unitUnit, LV2_UNITS__bar) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_BAR;
else if (strcmp(unitUnit, LV2_UNITS__beat) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__beat) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_BEAT;
else if (strcmp(unitUnit, LV2_UNITS__bpm) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__bpm) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_BPM;
else if (strcmp(unitUnit, LV2_UNITS__cent) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__cent) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_CENT;
else if (strcmp(unitUnit, LV2_UNITS__cm) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__cm) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_CM;
else if (strcmp(unitUnit, LV2_UNITS__coef) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__coef) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_COEF;
else if (strcmp(unitUnit, LV2_UNITS__db) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__db) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_DB;
else if (strcmp(unitUnit, LV2_UNITS__degree) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__degree) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_DEGREE;
else if (strcmp(unitUnit, LV2_UNITS__frame) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__frame) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_FRAME;
else if (strcmp(unitUnit, LV2_UNITS__hz) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__hz) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_HZ;
else if (strcmp(unitUnit, LV2_UNITS__inch) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__inch) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_INCH;
else if (strcmp(unitUnit, LV2_UNITS__khz) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__khz) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_KHZ;
else if (strcmp(unitUnit, LV2_UNITS__km) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__km) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_KM;
else if (strcmp(unitUnit, LV2_UNITS__m) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__m) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_M;
else if (strcmp(unitUnit, LV2_UNITS__mhz) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__mhz) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_MHZ;
else if (strcmp(unitUnit, LV2_UNITS__midiNote) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__midiNote) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_MIDINOTE;
else if (strcmp(unitUnit, LV2_UNITS__mile) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__mile) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_MILE;
else if (strcmp(unitUnit, LV2_UNITS__min) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__min) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_MIN;
else if (strcmp(unitUnit, LV2_UNITS__mm) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__mm) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_MM;
else if (strcmp(unitUnit, LV2_UNITS__ms) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__ms) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_MS;
else if (strcmp(unitUnit, LV2_UNITS__oct) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__oct) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_OCT;
else if (strcmp(unitUnit, LV2_UNITS__pc) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__pc) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_PC;
else if (strcmp(unitUnit, LV2_UNITS__s) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__s) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_S;
else if (strcmp(unitUnit, LV2_UNITS__semitone12TET) == 0)
else if (std::strcmp(unitUnit, LV2_UNITS__semitone12TET) == 0)
rdfPort->Unit.Unit = LV2_PORT_UNIT_SEMITONE;
else
qWarning("lv2_rdf_new(\"%s\") - got unknown unit type '%s'", uri, unitUnit);
@@ -1153,41 +1153,41 @@ bool is_lv2_port_supported(const LV2_Property types)
static inline
bool is_lv2_feature_supported(const LV2_URI uri)
{
if (strcmp(uri, LV2_CORE__hardRTCapable) == 0)
if (std::strcmp(uri, LV2_CORE__hardRTCapable) == 0)
return true;
if (strcmp(uri, LV2_CORE__inPlaceBroken) == 0)
if (std::strcmp(uri, LV2_CORE__inPlaceBroken) == 0)
return true;
if (strcmp(uri, LV2_CORE__isLive) == 0)
if (std::strcmp(uri, LV2_CORE__isLive) == 0)
return true;
if (strcmp(uri, LV2_BUF_SIZE__boundedBlockLength) == 0)
if (std::strcmp(uri, LV2_BUF_SIZE__boundedBlockLength) == 0)
return true;
if (strcmp(uri, LV2_BUF_SIZE__fixedBlockLength) == 0)
if (std::strcmp(uri, LV2_BUF_SIZE__fixedBlockLength) == 0)
return true;
if (strcmp(uri, LV2_BUF_SIZE__powerOf2BlockLength) == 0)
if (std::strcmp(uri, LV2_BUF_SIZE__powerOf2BlockLength) == 0)
return true;
if (strcmp(uri, LV2_EVENT_URI) == 0)
if (std::strcmp(uri, LV2_EVENT_URI) == 0)
return true;
if (strcmp(uri, LV2_LOG__log) == 0)
if (std::strcmp(uri, LV2_LOG__log) == 0)
return true;
if (strcmp(uri, LV2_OPTIONS__options) == 0)
if (std::strcmp(uri, LV2_OPTIONS__options) == 0)
return true;
if (strcmp(uri, LV2_PROGRAMS__Host) == 0)
if (std::strcmp(uri, LV2_PROGRAMS__Host) == 0)
return true;
if (strcmp(uri, LV2_RTSAFE_MEMORY_POOL__Pool) == 0)
if (std::strcmp(uri, LV2_RTSAFE_MEMORY_POOL__Pool) == 0)
return true;
if (strcmp(uri, LV2_STATE__makePath) == 0)
if (std::strcmp(uri, LV2_STATE__makePath) == 0)
return true;
if (strcmp(uri, LV2_STATE__mapPath) == 0)
if (std::strcmp(uri, LV2_STATE__mapPath) == 0)
return true;
if (strcmp(uri, LV2_PORT_PROPS__supportsStrictBounds) == 0)
if (std::strcmp(uri, LV2_PORT_PROPS__supportsStrictBounds) == 0)
return true;
if (strcmp(uri, LV2_URI_MAP_URI) == 0)
if (std::strcmp(uri, LV2_URI_MAP_URI) == 0)
return true;
if (strcmp(uri, LV2_URID__map) == 0)
if (std::strcmp(uri, LV2_URID__map) == 0)
return true;
if (strcmp(uri, LV2_URID__unmap) == 0)
if (std::strcmp(uri, LV2_URID__unmap) == 0)
return true;
if (strcmp(uri, LV2_WORKER__schedule) == 0)
if (std::strcmp(uri, LV2_WORKER__schedule) == 0)
return true;
return false;
}
@@ -1200,29 +1200,29 @@ bool is_lv2_ui_feature_supported(const LV2_URI uri)
{
if (is_lv2_feature_supported(uri))
return true;
if (strcmp(uri, LV2_DATA_ACCESS_URI) == 0)
if (std::strcmp(uri, LV2_DATA_ACCESS_URI) == 0)
return true;
if (strcmp(uri, LV2_INSTANCE_ACCESS_URI) == 0)
if (std::strcmp(uri, LV2_INSTANCE_ACCESS_URI) == 0)
return true;
if (strcmp(uri, LV2_UI__fixedSize) == 0)
if (std::strcmp(uri, LV2_UI__fixedSize) == 0)
return true;
if (strcmp(uri, LV2_UI__makeResident) == 0)
if (std::strcmp(uri, LV2_UI__makeResident) == 0)
return true;
if (strcmp(uri, LV2_UI__noUserResize) == 0)
if (std::strcmp(uri, LV2_UI__noUserResize) == 0)
return true;
if (strcmp(uri, LV2_UI__parent) == 0)
if (std::strcmp(uri, LV2_UI__parent) == 0)
return true;
if (strcmp(uri, LV2_UI__portMap) == 0)
if (std::strcmp(uri, LV2_UI__portMap) == 0)
return true;
if (strcmp(uri, LV2_UI__portSubscribe) == 0)
if (std::strcmp(uri, LV2_UI__portSubscribe) == 0)
return false; // TODO
if (strcmp(uri, LV2_UI__resize) == 0)
if (std::strcmp(uri, LV2_UI__resize) == 0)
return true;
if (strcmp(uri, LV2_UI__touch) == 0)
if (std::strcmp(uri, LV2_UI__touch) == 0)
return false; // TODO
if (strcmp(uri, LV2_EXTERNAL_UI__Widget) == 0)
if (std::strcmp(uri, LV2_EXTERNAL_UI__Widget) == 0)
return true;
if (strcmp(uri, LV2_EXTERNAL_UI_DEPRECATED_URI) == 0)
if (std::strcmp(uri, LV2_EXTERNAL_UI_DEPRECATED_URI) == 0)
return true;
return false;
}


+ 51
- 51
source/utils/CarlaOscUtils.hpp View File

@@ -74,9 +74,9 @@ void osc_send_configure(const CarlaOscData* const oscData, const char* const key

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && key != nullptr && value != nullptr)
{
char targetPath[strlen(oscData->path)+11];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/configure");
char targetPath[std::strlen(oscData->path)+11];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/configure");
lo_send(oscData->target, targetPath, "ss", key, value);
}
}
@@ -90,9 +90,9 @@ void osc_send_control(const CarlaOscData* const oscData, const int32_t index, co

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && index != -1)
{
char targetPath[strlen(oscData->path)+9];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/control");
char targetPath[std::strlen(oscData->path)+9];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/control");
lo_send(oscData->target, targetPath, "if", index, value);
}
}
@@ -106,9 +106,9 @@ void osc_send_program(const CarlaOscData* const oscData, const int32_t index)

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && index >= 0)
{
char targetPath[strlen(oscData->path)+9];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/program");
char targetPath[std::strlen(oscData->path)+9];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/program");
lo_send(oscData->target, targetPath, "i", index);
}
}
@@ -123,9 +123,9 @@ void osc_send_program(const CarlaOscData* const oscData, const int32_t bank, con

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && bank >= 0 && program >= 0)
{
char targetPath[strlen(oscData->path)+9];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/program");
char targetPath[std::strlen(oscData->path)+9];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/program");
lo_send(oscData->target, targetPath, "ii", bank, program);
}
}
@@ -139,9 +139,9 @@ void osc_send_midi_program(const CarlaOscData* const oscData, const int32_t inde

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && index >= 0)
{
char targetPath[strlen(oscData->path)+14];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/midi-program");
char targetPath[std::strlen(oscData->path)+14];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/midi-program");
lo_send(oscData->target, targetPath, "i", index);
}
}
@@ -156,9 +156,9 @@ void osc_send_midi_program(const CarlaOscData* const oscData, const int32_t bank

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && bank >= 0 && program >= 0)
{
char targetPath[strlen(oscData->path)+14];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/midi-program");
char targetPath[std::strlen(oscData->path)+14];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/midi-program");
lo_send(oscData->target, targetPath, "ii", bank, program);
}
}
@@ -173,9 +173,9 @@ void osc_send_midi(const CarlaOscData* const oscData, const uint8_t buf[4])

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && buf[0] == 0 && buf[1] != 0)
{
char targetPath[strlen(oscData->path)+6];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/midi");
char targetPath[std::strlen(oscData->path)+6];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/midi");
lo_send(oscData->target, targetPath, "m", buf);
}
}
@@ -189,9 +189,9 @@ void osc_send_sample_rate(const CarlaOscData* const oscData, const float sampleR

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && sampleRate > 0.0f)
{
char targetPath[strlen(oscData->path)+13];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/sample-rate");
char targetPath[std::strlen(oscData->path)+13];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/sample-rate");
lo_send(oscData->target, targetPath, "f", sampleRate);
}
}
@@ -206,9 +206,9 @@ void osc_send_update(const CarlaOscData* const oscData, const char* const url)

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && url != nullptr)
{
char targetPath[strlen(oscData->path)+8];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/update");
char targetPath[std::strlen(oscData->path)+8];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/update");
lo_send(oscData->target, targetPath, "s", url);
}
}
@@ -221,9 +221,9 @@ void osc_send_exiting(const CarlaOscData* const oscData)

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr)
{
char targetPath[strlen(oscData->path)+9];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/exiting");
char targetPath[std::strlen(oscData->path)+9];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/exiting");
lo_send(oscData->target, targetPath, "");
}
}
@@ -237,9 +237,9 @@ void osc_send_show(const CarlaOscData* const oscData)

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr)
{
char targetPath[strlen(oscData->path)+6];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/show");
char targetPath[std::strlen(oscData->path)+6];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/show");
lo_send(oscData->target, targetPath, "");
}
}
@@ -252,9 +252,9 @@ void osc_send_hide(const CarlaOscData* const oscData)

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr)
{
char targetPath[strlen(oscData->path)+6];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/hide");
char targetPath[std::strlen(oscData->path)+6];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/hide");
lo_send(oscData->target, targetPath, "");
}
}
@@ -267,9 +267,9 @@ void osc_send_quit(const CarlaOscData* const oscData)

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr)
{
char targetPath[strlen(oscData->path)+6];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/quit");
char targetPath[std::strlen(oscData->path)+6];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/quit");
lo_send(oscData->target, targetPath, "");
}
}
@@ -286,9 +286,9 @@ void osc_send_bridge_update(const CarlaOscData* const oscData, const char* const

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && url != nullptr)
{
char targetPath[strlen(oscData->path)+15];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/bridge_update");
char targetPath[std::strlen(oscData->path)+15];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/bridge_update");
lo_send(oscData->target, targetPath, "s", url);
}
}
@@ -302,9 +302,9 @@ void osc_send_bridge_error(const CarlaOscData* const oscData, const char* const

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && error != nullptr)
{
char targetPath[strlen(oscData->path)+14];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/bridge_error");
char targetPath[std::strlen(oscData->path)+14];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/bridge_error");
lo_send(oscData->target, targetPath, "s", error);
}
}
@@ -322,9 +322,9 @@ void osc_send_lv2_transfer_atom(const CarlaOscData* const oscData, const int32_t

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && portIndex >= 0 && typeStr != nullptr && atomBuf != nullptr)
{
char targetPath[strlen(oscData->path)+19];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/lv2_atom_transfer");
char targetPath[std::strlen(oscData->path)+19];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/lv2_atom_transfer");
lo_send(oscData->target, targetPath, "iss", portIndex, typeStr, atomBuf);
}
}
@@ -340,9 +340,9 @@ void osc_send_lv2_transfer_event(const CarlaOscData* const oscData, const int32_

if (oscData != nullptr && oscData->path != nullptr && oscData->target != nullptr && portIndex >= 0 && typeStr != nullptr && atomBuf != nullptr)
{
char targetPath[strlen(oscData->path)+20];
strcpy(targetPath, oscData->path);
strcat(targetPath, "/lv2_event_transfer");
char targetPath[std::strlen(oscData->path)+20];
std::strcpy(targetPath, oscData->path);
std::strcat(targetPath, "/lv2_event_transfer");
lo_send(oscData->target, targetPath, "iss", portIndex, typeStr, atomBuf);
}
}


Loading…
Cancel
Save