Browse Source

General cleanup

tags/1.9.4
falkTX 11 years ago
parent
commit
7b97dc6d6c
33 changed files with 349 additions and 383 deletions
  1. +1
    -1
      source/Makefile.mk
  2. +1
    -6
      source/backend/CarlaBackend.h
  3. +2
    -2
      source/backend/CarlaEngine.hpp
  4. +2
    -2
      source/backend/CarlaPlugin.hpp
  5. +2
    -2
      source/backend/engine/CarlaEngine.cpp
  6. +0
    -21
      source/backend/engine/CarlaEngineBridge.cpp
  7. +1
    -1
      source/backend/engine/CarlaEngineJack.cpp
  8. +5
    -5
      source/backend/engine/CarlaEngineJuce.cpp
  9. +13
    -13
      source/backend/engine/CarlaEngineNative.cpp
  10. +1
    -1
      source/backend/engine/CarlaEngineRtAudio.cpp
  11. +0
    -5
      source/backend/engine/CarlaEngineThread.cpp
  12. +0
    -1
      source/backend/engine/CarlaEngineThread.hpp
  13. +6
    -5
      source/backend/plugin/BridgePlugin.cpp
  14. +10
    -18
      source/backend/plugin/CarlaPlugin.cpp
  15. +134
    -131
      source/backend/plugin/CarlaPluginInternal.cpp
  16. +39
    -48
      source/backend/plugin/CarlaPluginInternal.hpp
  17. +5
    -3
      source/backend/plugin/CarlaPluginThread.cpp
  18. +1
    -1
      source/backend/plugin/CarlaPluginThread.hpp
  19. +1
    -1
      source/backend/plugin/CsoundPlugin.cpp
  20. +15
    -15
      source/backend/plugin/DssiPlugin.cpp
  21. +2
    -2
      source/backend/plugin/FluidSynthPlugin.cpp
  22. +3
    -3
      source/backend/plugin/JucePlugin.cpp
  23. +20
    -11
      source/backend/plugin/LadspaPlugin.cpp
  24. +3
    -3
      source/backend/plugin/LinuxSamplerPlugin.cpp
  25. +37
    -34
      source/backend/plugin/Lv2Plugin.cpp
  26. +16
    -16
      source/backend/plugin/NativePlugin.cpp
  27. +4
    -4
      source/backend/plugin/ReWirePlugin.cpp
  28. +8
    -8
      source/backend/plugin/VstPlugin.cpp
  29. +11
    -9
      source/bridges/jackplugin/CarlaJackPlugin.cpp
  30. +0
    -3
      source/carla_backend.py
  31. +0
    -2
      source/utils/CarlaBackendUtils.hpp
  32. +2
    -2
      source/utils/LinkedList.hpp
  33. +4
    -4
      source/utils/RtLinkedList.hpp

+ 1
- 1
source/Makefile.mk View File

@@ -112,7 +112,7 @@ CFLAGS += -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes
CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual
ifeq ($(LINUX),true) ifeq ($(LINUX),true)
CFLAGS += -isystem /opt/kxstudio/include CFLAGS += -isystem /opt/kxstudio/include
CXXFLAGS += -isystem /opt/kxstudio/include -isystem /opt/kxstudio/include/qt5
CXXFLAGS += -isystem /opt/kxstudio/include -isystem /usr/include/qt5
endif endif
ifeq ($(MACOS),true) ifeq ($(MACOS),true)
CFLAGS += -isystem /opt/kxstudio/include CFLAGS += -isystem /opt/kxstudio/include


+ 1
- 6
source/backend/CarlaBackend.h View File

@@ -591,12 +591,7 @@ typedef enum {
/*! /*!
* Ouput parameter. * Ouput parameter.
*/ */
PARAMETER_OUTPUT = 2,

/*!
* Special (hidden) parameter.
*/
PARAMETER_SPECIAL = 3
PARAMETER_OUTPUT = 2


} ParameterType; } ParameterType;




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

@@ -550,12 +550,12 @@ public:
* All constructor parameters are constant and will never change in the lifetime of the client.\n * All constructor parameters are constant and will never change in the lifetime of the client.\n
* Client starts in deactivated state. * Client starts in deactivated state.
*/ */
CarlaEngineClient(const CarlaEngine& engine);
CarlaEngineClient(const CarlaEngine& engine) noexcept;


/*! /*!
* The destructor. * The destructor.
*/ */
virtual ~CarlaEngineClient();
virtual ~CarlaEngineClient() noexcept;


/*! /*!
* Activate this client.\n * Activate this client.\n


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

@@ -694,12 +694,12 @@ public:
/*! /*!
* Initialize all RT buffers of the plugin. * Initialize all RT buffers of the plugin.
*/ */
virtual void initBuffers();
virtual void initBuffers() const noexcept;


/*! /*!
* Delete and clear all RT buffers. * Delete and clear all RT buffers.
*/ */
virtual void clearBuffers();
virtual void clearBuffers() noexcept;


// ------------------------------------------------------------------- // -------------------------------------------------------------------
// OSC stuff // OSC stuff


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

@@ -517,7 +517,7 @@ bool CarlaEngineEventPort::writeMidiEvent(const uint32_t time, const uint8_t cha
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Carla Engine client (Abstract) // Carla Engine client (Abstract)


CarlaEngineClient::CarlaEngineClient(const CarlaEngine& engine)
CarlaEngineClient::CarlaEngineClient(const CarlaEngine& engine) noexcept
: fEngine(engine), : fEngine(engine),
fActive(false), fActive(false),
fLatency(0) fLatency(0)
@@ -525,7 +525,7 @@ CarlaEngineClient::CarlaEngineClient(const CarlaEngine& engine)
carla_debug("CarlaEngineClient::CarlaEngineClient()"); carla_debug("CarlaEngineClient::CarlaEngineClient()");
} }


CarlaEngineClient::~CarlaEngineClient()
CarlaEngineClient::~CarlaEngineClient() noexcept
{ {
CARLA_SAFE_ASSERT(! fActive); CARLA_SAFE_ASSERT(! fActive);
carla_debug("CarlaEngineClient::~CarlaEngineClient()"); carla_debug("CarlaEngineClient::~CarlaEngineClient()");


+ 0
- 21
source/backend/engine/CarlaEngineBridge.cpp View File

@@ -572,27 +572,6 @@ CarlaEngine* CarlaEngine::newBridge(const char* const audioBaseName, const char*


CARLA_BACKEND_END_NAMESPACE CARLA_BACKEND_END_NAMESPACE


// -----------------------------------------------------------------------
// Extra stuff for linking purposes

CARLA_BACKEND_START_NAMESPACE

// CarlaEngine* CarlaEngine::newRtAudio(const AudioApi) { return nullptr; }
// unsigned int CarlaEngine::getRtAudioApiCount() { return 0; }
// const char* CarlaEngine::getRtAudioApiName(const unsigned int) { return nullptr; }
// const char* const* CarlaEngine::getRtAudioApiDeviceNames(const unsigned int) { return nullptr; }
// const EngineDriverDeviceInfo* CarlaEngine::getRtAudioDeviceInfo(const unsigned int, const char* const) { return nullptr; }
//
// #ifdef HAVE_JUCE
// CarlaEngine* CarlaEngine::newJuce(const AudioApi) { return nullptr; }
// unsigned int CarlaEngine::getJuceApiCount() { return 0; }
// const char* CarlaEngine::getJuceApiName(const unsigned int) { return nullptr; }
// const char* const* CarlaEngine::getJuceApiDeviceNames(const unsigned int) { return nullptr; }
// const EngineDriverDeviceInfo* CarlaEngine::getJuceDeviceInfo(const unsigned int, const char* const) { return nullptr; }
// #endif

CARLA_BACKEND_END_NAMESPACE

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


#if defined(CARLA_OS_WIN) && ! defined(__WINE__) #if defined(CARLA_OS_WIN) && ! defined(__WINE__)


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

@@ -858,7 +858,7 @@ public:
return; return;


LinkedList<int> newPlugins; LinkedList<int> newPlugins;
fNewGroups.spliceInsert(newPlugins);
fNewGroups.spliceInsertInto(newPlugins);


for (LinkedList<int>::Itenerator it = newPlugins.begin(); it.valid(); it.next()) for (LinkedList<int>::Itenerator it = newPlugins.begin(); it.valid(); it.next())
{ {


+ 5
- 5
source/backend/engine/CarlaEngineJuce.cpp View File

@@ -355,16 +355,16 @@ CarlaEngine* CarlaEngine::newJuce(const AudioApi api)
return new CarlaEngineJuce(deviceType); return new CarlaEngineJuce(deviceType);
} }


unsigned int CarlaEngine::getJuceApiCount()
uint CarlaEngine::getJuceApiCount()
{ {
return 0; // TODO return 0; // TODO


initJuceDevices(); initJuceDevices();


return static_cast<unsigned int>(gJuceDeviceTypes.size());
return static_cast<uint>(gJuceDeviceTypes.size());
} }


const char* CarlaEngine::getJuceApiName(const unsigned int index)
const char* CarlaEngine::getJuceApiName(const uint index)
{ {
initJuceDevices(); initJuceDevices();


@@ -379,7 +379,7 @@ const char* CarlaEngine::getJuceApiName(const unsigned int index)
return deviceType->getTypeName().toRawUTF8(); return deviceType->getTypeName().toRawUTF8();
} }


const char* const* CarlaEngine::getJuceApiDeviceNames(const unsigned int index)
const char* const* CarlaEngine::getJuceApiDeviceNames(const uint index)
{ {
initJuceDevices(); initJuceDevices();


@@ -416,7 +416,7 @@ const char* const* CarlaEngine::getJuceApiDeviceNames(const unsigned int index)
return gRetNames; return gRetNames;
} }


const EngineDriverDeviceInfo* CarlaEngine::getJuceDeviceInfo(const unsigned int index, const char* const deviceName)
const EngineDriverDeviceInfo* CarlaEngine::getJuceDeviceInfo(const uint index, const char* const deviceName)
{ {
initJuceDevices(); initJuceDevices();




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

@@ -637,7 +637,7 @@ protected:


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


const char* renamePlugin(const unsigned int id, const char* const newName) override
const char* renamePlugin(const uint id, const char* const newName) override
{ {
if (const char* const retName = CarlaEngine::renamePlugin(id, newName)) if (const char* const retName = CarlaEngine::renamePlugin(id, newName))
{ {
@@ -897,7 +897,7 @@ protected:
plugin->getParameterName(index, strBufName); plugin->getParameterName(index, strBufName);
plugin->getParameterUnit(index, strBufUnit); plugin->getParameterUnit(index, strBufUnit);


unsigned int hints = 0x0;
uint hints = 0x0;


if (paramData.hints & PARAMETER_IS_BOOLEAN) if (paramData.hints & PARAMETER_IS_BOOLEAN)
hints |= ::PARAMETER_IS_BOOLEAN; hints |= ::PARAMETER_IS_BOOLEAN;
@@ -1297,7 +1297,7 @@ protected:
bool firstPlugin = true; bool firstPlugin = true;
char strBuf[STR_MAX+1]; char strBuf[STR_MAX+1];


for (unsigned int i=0; i < pData->curPluginCount; ++i)
for (uint i=0; i < pData->curPluginCount; ++i)
{ {
CarlaPlugin* const plugin(pData->plugins[i].plugin); CarlaPlugin* const plugin(pData->plugins[i].plugin);


@@ -1648,18 +1648,18 @@ CARLA_BACKEND_START_NAMESPACE


CarlaEngine* CarlaEngine::newJack() { return nullptr; } CarlaEngine* CarlaEngine::newJack() { return nullptr; }


CarlaEngine* CarlaEngine::newRtAudio(const AudioApi) { return nullptr; }
unsigned int CarlaEngine::getRtAudioApiCount() { return 0; }
const char* CarlaEngine::getRtAudioApiName(const unsigned int) { return nullptr; }
const char* const* CarlaEngine::getRtAudioApiDeviceNames(const unsigned int) { return nullptr; }
const EngineDriverDeviceInfo* CarlaEngine::getRtAudioDeviceInfo(const unsigned int, const char* const) { return nullptr; }
CarlaEngine* CarlaEngine::newRtAudio(const AudioApi) { return nullptr; }
uint CarlaEngine::getRtAudioApiCount() { return 0; }
const char* CarlaEngine::getRtAudioApiName(const uint) { return nullptr; }
const char* const* CarlaEngine::getRtAudioApiDeviceNames(const uint) { return nullptr; }
const EngineDriverDeviceInfo* CarlaEngine::getRtAudioDeviceInfo(const uint, const char* const) { return nullptr; }


# ifdef HAVE_JUCE # ifdef HAVE_JUCE
CarlaEngine* CarlaEngine::newJuce(const AudioApi) { return nullptr; }
unsigned int CarlaEngine::getJuceApiCount() { return 0; }
const char* CarlaEngine::getJuceApiName(const unsigned int) { return nullptr; }
const char* const* CarlaEngine::getJuceApiDeviceNames(const unsigned int) { return nullptr; }
const EngineDriverDeviceInfo* CarlaEngine::getJuceDeviceInfo(const unsigned int, const char* const) { return nullptr; }
CarlaEngine* CarlaEngine::newJuce(const AudioApi) { return nullptr; }
uint CarlaEngine::getJuceApiCount() { return 0; }
const char* CarlaEngine::getJuceApiName(const uint) { return nullptr; }
const char* const* CarlaEngine::getJuceApiDeviceNames(const uint) { return nullptr; }
const EngineDriverDeviceInfo* CarlaEngine::getJuceDeviceInfo(const uint, const char* const) { return nullptr; }
# endif # endif


CARLA_BACKEND_END_NAMESPACE CARLA_BACKEND_END_NAMESPACE


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

@@ -1012,7 +1012,7 @@ private:


void splice() void splice()
{ {
dataPending.spliceAppend(data);
dataPending.spliceAppendTo(data);
} }
}; };




+ 0
- 5
source/backend/engine/CarlaEngineThread.cpp View File

@@ -31,11 +31,6 @@ CarlaEngineThread::CarlaEngineThread(CarlaEngine* const engine) noexcept
carla_debug("CarlaEngineThread::CarlaEngineThread(%p)", engine); carla_debug("CarlaEngineThread::CarlaEngineThread(%p)", engine);
} }


CarlaEngineThread::~CarlaEngineThread() noexcept
{
carla_debug("CarlaEngineThread::~CarlaEngineThread()");
}

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


void CarlaEngineThread::run() noexcept void CarlaEngineThread::run() noexcept


+ 0
- 1
source/backend/engine/CarlaEngineThread.hpp View File

@@ -34,7 +34,6 @@ class CarlaEngineThread : public CarlaThread
{ {
public: public:
CarlaEngineThread(CarlaEngine* const engine) noexcept; CarlaEngineThread(CarlaEngine* const engine) noexcept;
~CarlaEngineThread() noexcept override;


protected: protected:
void run() noexcept override; void run() noexcept override;


+ 6
- 5
source/backend/plugin/BridgePlugin.cpp View File

@@ -284,6 +284,7 @@ struct BridgeTime {


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


// FIXME - use CarlaString
struct BridgeParamInfo { struct BridgeParamInfo {
float value; float value;
QString name; QString name;
@@ -300,7 +301,7 @@ struct BridgeParamInfo {
class BridgePlugin : public CarlaPlugin class BridgePlugin : public CarlaPlugin
{ {
public: public:
BridgePlugin(CarlaEngine* const engine, const unsigned int id, const BinaryType btype, const PluginType ptype)
BridgePlugin(CarlaEngine* const engine, const uint id, const BinaryType btype, const PluginType ptype)
: CarlaPlugin(engine, id), : CarlaPlugin(engine, id),
fBinaryType(btype), fBinaryType(btype),
fPluginType(ptype), fPluginType(ptype),
@@ -430,9 +431,9 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
unsigned int options = 0x0;
uint options = 0x0;


options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;
options |= PLUGIN_OPTION_USE_CHUNKS; options |= PLUGIN_OPTION_USE_CHUNKS;
@@ -1295,7 +1296,7 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Plugin buffers // Plugin buffers


void clearBuffers() override
void clearBuffers() noexcept override
{ {
if (fParams != nullptr) if (fParams != nullptr)
{ {
@@ -1427,7 +1428,7 @@ public:


const uint32_t ucount(static_cast<uint32_t>(count)); const uint32_t ucount(static_cast<uint32_t>(count));


pData->param.createNew(ucount, false, true);
pData->param.createNew(ucount, false);
fParams = new BridgeParamInfo[ucount]; fParams = new BridgeParamInfo[ucount];
} }
break; break;


+ 10
- 18
source/backend/plugin/CarlaPlugin.cpp View File

@@ -67,14 +67,6 @@ struct ParamSymbol {


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


void CarlaPlugin::ProtectedData::tryTransient()
{
if (engine->getOptions().frontendWinId != 0)
transientTryCounter = 1;
}

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

CarlaPlugin* CarlaPlugin::newFileGIG(const Initializer& init, const bool use16Outs) CarlaPlugin* CarlaPlugin::newFileGIG(const Initializer& init, const bool use16Outs)
{ {
carla_debug("CarlaPlugin::newFileGIG({%p, \"%s\", \"%s\", \"%s\"}, %s)", init.engine, init.filename, init.name, init.label, bool2str(use16Outs)); carla_debug("CarlaPlugin::newFileGIG({%p, \"%s\", \"%s\", \"%s\"}, %s)", init.engine, init.filename, init.name, init.label, bool2str(use16Outs));
@@ -119,7 +111,7 @@ CarlaPlugin* CarlaPlugin::newFileSFZ(const Initializer& init)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Constructor and destructor // Constructor and destructor


CarlaPlugin::CarlaPlugin(CarlaEngine* const engine, const unsigned int id)
CarlaPlugin::CarlaPlugin(CarlaEngine* const engine, const uint id)
: pData(new ProtectedData(engine, id, this)) : pData(new ProtectedData(engine, id, this))
{ {
CARLA_SAFE_ASSERT_RETURN(engine != nullptr,); CARLA_SAFE_ASSERT_RETURN(engine != nullptr,);
@@ -157,17 +149,17 @@ CarlaPlugin::~CarlaPlugin()
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (base) // Information (base)


unsigned int CarlaPlugin::getId() const noexcept
uint CarlaPlugin::getId() const noexcept
{ {
return pData->id; return pData->id;
} }


unsigned int CarlaPlugin::getHints() const noexcept
uint CarlaPlugin::getHints() const noexcept
{ {
return pData->hints; return pData->hints;
} }


unsigned int CarlaPlugin::getOptionsEnabled() const noexcept
uint CarlaPlugin::getOptionsEnabled() const noexcept
{ {
return pData->options; return pData->options;
} }
@@ -315,7 +307,7 @@ int32_t CarlaPlugin::getChunkData(void** const dataPtr) const noexcept
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int CarlaPlugin::getOptionsAvailable() const noexcept
uint CarlaPlugin::getOptionsAvailable() const noexcept
{ {
CARLA_SAFE_ASSERT(false); // this should never happen CARLA_SAFE_ASSERT(false); // this should never happen
return 0x0; return 0x0;
@@ -915,7 +907,7 @@ bool CarlaPlugin::loadStateFromFile(const char* const filename)
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Set data (internal stuff) // Set data (internal stuff)


void CarlaPlugin::setId(const unsigned int newId) noexcept
void CarlaPlugin::setId(const uint newId) noexcept
{ {
pData->id = newId; pData->id = newId;
} }
@@ -930,7 +922,7 @@ void CarlaPlugin::setName(const char* const newName)
pData->name = carla_strdup(newName); pData->name = carla_strdup(newName);
} }


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


@@ -1523,14 +1515,14 @@ void CarlaPlugin::unlock() noexcept
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Plugin buffers // Plugin buffers


void CarlaPlugin::initBuffers()
void CarlaPlugin::initBuffers() const noexcept
{ {
pData->audioIn.initBuffers(); pData->audioIn.initBuffers();
pData->audioOut.initBuffers(); pData->audioOut.initBuffers();
pData->event.initBuffers(); pData->event.initBuffers();
} }


void CarlaPlugin::clearBuffers()
void CarlaPlugin::clearBuffers() noexcept
{ {
pData->clearBuffers(); pData->clearBuffers();
} }
@@ -1816,7 +1808,7 @@ void CarlaPlugin::sendMidiSingleNote(const uint8_t channel, const uint8_t note,
extNote.note = note; extNote.note = note;
extNote.velo = velo; extNote.velo = velo;


pData->extNotes.append(extNote);
pData->extNotes.appendNonRT(extNote);


if (sendGui && (pData->hints & PLUGIN_HAS_CUSTOM_UI) != 0) if (sendGui && (pData->hints & PLUGIN_HAS_CUSTOM_UI) != 0)
{ {


+ 134
- 131
source/backend/plugin/CarlaPluginInternal.cpp View File

@@ -36,18 +36,6 @@ CARLA_BACKEND_START_NAMESPACE


static const MidiProgramData kMidiProgramDataNull = { 0, 0, nullptr }; static const MidiProgramData kMidiProgramDataNull = { 0, 0, nullptr };


// -----------------------------------------------------------------------
// PluginAudioPort

PluginAudioPort::PluginAudioPort() noexcept
: rindex(0),
port(nullptr) {}

PluginAudioPort::~PluginAudioPort() noexcept
{
CARLA_ASSERT(port == nullptr);
}

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// PluginAudioData // PluginAudioData


@@ -57,18 +45,24 @@ PluginAudioData::PluginAudioData() noexcept


PluginAudioData::~PluginAudioData() noexcept PluginAudioData::~PluginAudioData() noexcept
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_ASSERT(ports == nullptr);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT(ports == nullptr);
} }


void PluginAudioData::createNew(const uint32_t newCount) void PluginAudioData::createNew(const uint32_t newCount)
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_RETURN(ports == nullptr,); CARLA_SAFE_ASSERT_RETURN(ports == nullptr,);
CARLA_SAFE_ASSERT_RETURN(newCount > 0,); CARLA_SAFE_ASSERT_RETURN(newCount > 0,);


ports = new PluginAudioPort[newCount]; ports = new PluginAudioPort[newCount];
count = newCount; count = newCount;

for (uint32_t i=0; i < count; ++i)
{
ports[i].rindex = 0;
ports[i].port = nullptr;
}
} }


void PluginAudioData::clear() noexcept void PluginAudioData::clear() noexcept
@@ -91,7 +85,7 @@ void PluginAudioData::clear() noexcept
count = 0; count = 0;
} }


void PluginAudioData::initBuffers() noexcept
void PluginAudioData::initBuffers() const noexcept
{ {
for (uint32_t i=0; i < count; ++i) for (uint32_t i=0; i < count; ++i)
{ {
@@ -100,19 +94,6 @@ void PluginAudioData::initBuffers() noexcept
} }
} }


// -----------------------------------------------------------------------
// PluginCVPort

PluginCVPort::PluginCVPort() noexcept
: rindex(0),
param(0),
port(nullptr) {}

PluginCVPort::~PluginCVPort() noexcept
{
CARLA_ASSERT(port == nullptr);
}

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// PluginCVData // PluginCVData


@@ -122,18 +103,25 @@ PluginCVData::PluginCVData() noexcept


PluginCVData::~PluginCVData() noexcept PluginCVData::~PluginCVData() noexcept
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_ASSERT(ports == nullptr);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT(ports == nullptr);
} }


void PluginCVData::createNew(const uint32_t newCount) void PluginCVData::createNew(const uint32_t newCount)
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_RETURN(ports == nullptr,); CARLA_SAFE_ASSERT_RETURN(ports == nullptr,);
CARLA_SAFE_ASSERT_RETURN(newCount > 0,); CARLA_SAFE_ASSERT_RETURN(newCount > 0,);


ports = new PluginCVPort[newCount]; ports = new PluginCVPort[newCount];
count = newCount; count = newCount;

for (uint32_t i=0; i < count; ++i)
{
ports[i].rindex = 0;
ports[i].param = 0;
ports[i].port = nullptr;
}
} }


void PluginCVData::clear() noexcept void PluginCVData::clear() noexcept
@@ -156,7 +144,7 @@ void PluginCVData::clear() noexcept
count = 0; count = 0;
} }


void PluginCVData::initBuffers() noexcept
void PluginCVData::initBuffers() const noexcept
{ {
for (uint32_t i=0; i < count; ++i) for (uint32_t i=0; i < count; ++i)
{ {
@@ -174,8 +162,8 @@ PluginEventData::PluginEventData() noexcept


PluginEventData::~PluginEventData() noexcept PluginEventData::~PluginEventData() noexcept
{ {
CARLA_ASSERT(portIn == nullptr);
CARLA_ASSERT(portOut == nullptr);
CARLA_SAFE_ASSERT(portIn == nullptr);
CARLA_SAFE_ASSERT(portOut == nullptr);
} }


void PluginEventData::clear() noexcept void PluginEventData::clear() noexcept
@@ -193,7 +181,7 @@ void PluginEventData::clear() noexcept
} }
} }


void PluginEventData::initBuffers() noexcept
void PluginEventData::initBuffers() const noexcept
{ {
if (portIn != nullptr) if (portIn != nullptr)
portIn->initBuffer(); portIn->initBuffer();
@@ -213,15 +201,15 @@ PluginParameterData::PluginParameterData() noexcept


PluginParameterData::~PluginParameterData() noexcept PluginParameterData::~PluginParameterData() noexcept
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_ASSERT(data == nullptr);
CARLA_ASSERT(ranges == nullptr);
CARLA_ASSERT(special == nullptr);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT(data == nullptr);
CARLA_SAFE_ASSERT(ranges == nullptr);
CARLA_SAFE_ASSERT(special == nullptr);
} }


void PluginParameterData::createNew(const uint32_t newCount, const bool withSpecial, const bool doReset)
void PluginParameterData::createNew(const uint32_t newCount, const bool withSpecial)
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_RETURN(data == nullptr,); CARLA_SAFE_ASSERT_RETURN(data == nullptr,);
CARLA_SAFE_ASSERT_RETURN(ranges == nullptr,); CARLA_SAFE_ASSERT_RETURN(ranges == nullptr,);
CARLA_SAFE_ASSERT_RETURN(special == nullptr,); CARLA_SAFE_ASSERT_RETURN(special == nullptr,);
@@ -234,9 +222,6 @@ void PluginParameterData::createNew(const uint32_t newCount, const bool withSpec
if (withSpecial) if (withSpecial)
special = new SpecialParameterType[newCount]; special = new SpecialParameterType[newCount];


if (! doReset)
return;

for (uint32_t i=0; i < newCount; ++i) for (uint32_t i=0; i < newCount; ++i)
{ {
data[i].type = PARAMETER_UNKNOWN; data[i].type = PARAMETER_UNKNOWN;
@@ -296,23 +281,21 @@ PluginProgramData::PluginProgramData() noexcept


PluginProgramData::~PluginProgramData() noexcept PluginProgramData::~PluginProgramData() noexcept
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_ASSERT_INT(current == -1, current);
CARLA_ASSERT(names == nullptr);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_INT(current == -1, current);
CARLA_SAFE_ASSERT(names == nullptr);
} }


void PluginProgramData::createNew(const uint32_t newCount) void PluginProgramData::createNew(const uint32_t newCount)
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_ASSERT_INT(current == -1, current);
CARLA_ASSERT(names == nullptr);
CARLA_ASSERT_INT(newCount > 0, newCount);

if (names != nullptr || newCount == 0)
return;
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_INT(current == -1, current);
CARLA_SAFE_ASSERT_RETURN(names == nullptr,);
CARLA_SAFE_ASSERT_RETURN(newCount > 0,);


names = new ProgramName[newCount];
count = newCount;
names = new ProgramName[newCount];
count = newCount;
current = -1;


for (uint32_t i=0; i < newCount; ++i) for (uint32_t i=0; i < newCount; ++i)
names[i] = nullptr; names[i] = nullptr;
@@ -349,23 +332,21 @@ PluginMidiProgramData::PluginMidiProgramData() noexcept


PluginMidiProgramData::~PluginMidiProgramData() noexcept PluginMidiProgramData::~PluginMidiProgramData() noexcept
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_ASSERT_INT(current == -1, current);
CARLA_ASSERT(data == nullptr);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_INT(current == -1, current);
CARLA_SAFE_ASSERT(data == nullptr);
} }


void PluginMidiProgramData::createNew(const uint32_t newCount) void PluginMidiProgramData::createNew(const uint32_t newCount)
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_ASSERT_INT(current == -1, current);
CARLA_ASSERT(data == nullptr);
CARLA_ASSERT_INT(newCount > 0, newCount);

if (data != nullptr || newCount == 0)
return;
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT_INT(current == -1, current);
CARLA_SAFE_ASSERT_RETURN(data == nullptr,);
CARLA_SAFE_ASSERT_RETURN(newCount > 0,);


data = new MidiProgramData[newCount];
count = newCount;
data = new MidiProgramData[newCount];
count = newCount;
current = -1;


for (uint32_t i=0; i < count; ++i) for (uint32_t i=0; i < count; ++i)
{ {
@@ -403,19 +384,20 @@ const MidiProgramData& PluginMidiProgramData::getCurrent() const noexcept
} }


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// ProtectedData::ExternalNotes


CarlaPlugin::ProtectedData::ExternalNotes::ExternalNotes()
CarlaPlugin::ProtectedData::ExternalNotes::ExternalNotes() noexcept
: dataPool(32, 152), : dataPool(32, 152),
data(dataPool) {} data(dataPool) {}


CarlaPlugin::ProtectedData::ExternalNotes::~ExternalNotes()
CarlaPlugin::ProtectedData::ExternalNotes::~ExternalNotes() noexcept
{ {
mutex.lock(); mutex.lock();
data.clear(); data.clear();
mutex.unlock(); mutex.unlock();
} }


void CarlaPlugin::ProtectedData::ExternalNotes::append(const ExternalMidiNote& note)
void CarlaPlugin::ProtectedData::ExternalNotes::appendNonRT(const ExternalMidiNote& note) noexcept
{ {
mutex.lock(); mutex.lock();
data.append_sleepy(note); data.append_sleepy(note);
@@ -423,32 +405,33 @@ void CarlaPlugin::ProtectedData::ExternalNotes::append(const ExternalMidiNote& n
} }


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// ProtectedData::PostRtEvents


CarlaPlugin::ProtectedData::PostRtEvents::PostRtEvents()
CarlaPlugin::ProtectedData::PostRtEvents::PostRtEvents() noexcept
: dataPool(128, 128), : dataPool(128, 128),
data(dataPool), data(dataPool),
dataPendingRT(dataPool) {} dataPendingRT(dataPool) {}


CarlaPlugin::ProtectedData::PostRtEvents::~PostRtEvents()
CarlaPlugin::ProtectedData::PostRtEvents::~PostRtEvents() noexcept
{ {
clear(); clear();
} }


void CarlaPlugin::ProtectedData::PostRtEvents::appendRT(const PluginPostRtEvent& e)
void CarlaPlugin::ProtectedData::PostRtEvents::appendRT(const PluginPostRtEvent& e) noexcept
{ {
dataPendingRT.append(e); dataPendingRT.append(e);
} }


void CarlaPlugin::ProtectedData::PostRtEvents::trySplice()
void CarlaPlugin::ProtectedData::PostRtEvents::trySplice() noexcept
{ {
if (mutex.tryLock()) if (mutex.tryLock())
{ {
dataPendingRT.spliceAppend(data);
dataPendingRT.spliceAppendTo(data);
mutex.unlock(); mutex.unlock();
} }
} }


void CarlaPlugin::ProtectedData::PostRtEvents::clear()
void CarlaPlugin::ProtectedData::PostRtEvents::clear() noexcept
{ {
mutex.lock(); mutex.lock();
data.clear(); data.clear();
@@ -456,9 +439,10 @@ void CarlaPlugin::ProtectedData::PostRtEvents::clear()
mutex.unlock(); mutex.unlock();
} }


#ifndef BUILD_BRIDGE
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// ProtectedData::PostProc


#ifndef BUILD_BRIDGE
CarlaPlugin::ProtectedData::PostProc::PostProc() noexcept CarlaPlugin::ProtectedData::PostProc::PostProc() noexcept
: dryWet(1.0f), : dryWet(1.0f),
volume(1.0f), volume(1.0f),
@@ -469,12 +453,12 @@ CarlaPlugin::ProtectedData::PostProc::PostProc() noexcept


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


CarlaPlugin::ProtectedData::OSC::OSC(CarlaEngine* const eng, CarlaPlugin* const plug)
CarlaPlugin::ProtectedData::OSC::OSC(CarlaEngine* const eng, CarlaPlugin* const plug) noexcept
: thread(eng, plug) {} : thread(eng, plug) {}


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


CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const unsigned int idx, CarlaPlugin* const self)
CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx, CarlaPlugin* const plug) noexcept
: engine(eng), : engine(eng),
client(nullptr), client(nullptr),
id(idx), id(idx),
@@ -494,13 +478,36 @@ CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const unsigned
filename(nullptr), filename(nullptr),
iconName(nullptr), iconName(nullptr),
identifier(nullptr), identifier(nullptr),
osc(eng, self) {}
osc(eng, plug) {}


CarlaPlugin::ProtectedData::~ProtectedData()
CarlaPlugin::ProtectedData::~ProtectedData() noexcept
{ {
CARLA_SAFE_ASSERT(! needsReset); CARLA_SAFE_ASSERT(! needsReset);
CARLA_SAFE_ASSERT(transientTryCounter == 0); CARLA_SAFE_ASSERT(transientTryCounter == 0);


{
// mutex MUST have been locked before
const bool lockMaster(masterMutex.tryLock());
const bool lockSingle(singleMutex.tryLock());
CARLA_SAFE_ASSERT(! lockMaster);
CARLA_SAFE_ASSERT(! lockSingle);
}

if (client != nullptr)
{
if (client->isActive())
{
// must not happen
carla_safe_assert("client->isActive()", __FILE__, __LINE__);
client->deactivate();
}

clearBuffers();

delete client;
client = nullptr;
}

if (name != nullptr) if (name != nullptr)
{ {
delete[] name; delete[] name;
@@ -525,29 +532,6 @@ CarlaPlugin::ProtectedData::~ProtectedData()
identifier = nullptr; identifier = nullptr;
} }


{
// mutex MUST have been locked before
const bool lockMaster(masterMutex.tryLock());
const bool lockSingle(singleMutex.tryLock());
CARLA_SAFE_ASSERT(! lockMaster);
CARLA_SAFE_ASSERT(! lockSingle);
}

if (client != nullptr)
{
if (client->isActive())
{
// must not happen
carla_safe_assert("client->isActive()", __FILE__, __LINE__);
client->deactivate();
}

clearBuffers();

delete client;
client = nullptr;
}

for (LinkedList<CustomData>::Itenerator it = custom.begin(); it.valid(); it.next()) for (LinkedList<CustomData>::Itenerator it = custom.begin(); it.valid(); it.next())
{ {
CustomData& cData(it.getValue()); CustomData& cData(it.getValue());
@@ -594,7 +578,7 @@ CarlaPlugin::ProtectedData::~ProtectedData()
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Buffer functions // Buffer functions


void CarlaPlugin::ProtectedData::clearBuffers()
void CarlaPlugin::ProtectedData::clearBuffers() noexcept
{ {
if (latencyBuffers != nullptr) if (latencyBuffers != nullptr)
{ {
@@ -614,7 +598,11 @@ void CarlaPlugin::ProtectedData::clearBuffers()
} }
else else
{ {
CARLA_SAFE_ASSERT(latency == 0);
if (latency != 0)
{
carla_safe_assert_int("latency != 0", __FILE__, __LINE__, static_cast<int>(latency));
latency = 0;
}
} }


audioIn.clear(); audioIn.clear();
@@ -627,7 +615,7 @@ void CarlaPlugin::ProtectedData::recreateLatencyBuffers()
{ {
if (latencyBuffers != nullptr) if (latencyBuffers != nullptr)
{ {
CARLA_ASSERT(audioIn.count > 0);
CARLA_SAFE_ASSERT(audioIn.count > 0);


for (uint32_t i=0; i < audioIn.count; ++i) for (uint32_t i=0; i < audioIn.count; ++i)
{ {
@@ -656,7 +644,14 @@ void CarlaPlugin::ProtectedData::recreateLatencyBuffers()
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Post-poned events // Post-poned events


void CarlaPlugin::ProtectedData::postponeRtEvent(const PluginPostRtEventType type, const int32_t value1, const int32_t value2, const float value3)
void CarlaPlugin::ProtectedData::postponeRtEvent(const PluginPostRtEvent& rtEvent) noexcept
{
CARLA_SAFE_ASSERT_RETURN(rtEvent.type != kPluginPostRtEventNull,);

postRtEvents.appendRT(rtEvent);
}

void CarlaPlugin::ProtectedData::postponeRtEvent(const PluginPostRtEventType type, const int32_t value1, const int32_t value2, const float value3) noexcept
{ {
CARLA_SAFE_ASSERT_RETURN(type != kPluginPostRtEventNull,); CARLA_SAFE_ASSERT_RETURN(type != kPluginPostRtEventNull,);


@@ -670,43 +665,43 @@ void CarlaPlugin::ProtectedData::postponeRtEvent(const PluginPostRtEventType typ


static LibCounter sLibCounter; static LibCounter sLibCounter;


const char* CarlaPlugin::ProtectedData::libError(const char* const fname)
const char* CarlaPlugin::ProtectedData::libError(const char* const fname) noexcept
{ {
return lib_error(fname); return lib_error(fname);
} }


bool CarlaPlugin::ProtectedData::libOpen(const char* const fname)
bool CarlaPlugin::ProtectedData::libOpen(const char* const fname) noexcept
{ {
lib = sLibCounter.open(fname); lib = sLibCounter.open(fname);
return (lib != nullptr); return (lib != nullptr);
} }


bool CarlaPlugin::ProtectedData::libClose()
bool CarlaPlugin::ProtectedData::libClose() noexcept
{ {
const bool ret = sLibCounter.close(lib); const bool ret = sLibCounter.close(lib);
lib = nullptr; lib = nullptr;
return ret; return ret;
} }


void* CarlaPlugin::ProtectedData::libSymbol(const char* const symbol)
void* CarlaPlugin::ProtectedData::libSymbol(const char* const symbol) const noexcept
{ {
return lib_symbol(lib, symbol); return lib_symbol(lib, symbol);
} }


bool CarlaPlugin::ProtectedData::uiLibOpen(const char* const fname, const bool canDelete)
bool CarlaPlugin::ProtectedData::uiLibOpen(const char* const fname, const bool canDelete) noexcept
{ {
uiLib = sLibCounter.open(fname, canDelete); uiLib = sLibCounter.open(fname, canDelete);
return (uiLib != nullptr); return (uiLib != nullptr);
} }


bool CarlaPlugin::ProtectedData::uiLibClose()
bool CarlaPlugin::ProtectedData::uiLibClose() noexcept
{ {
const bool ret = sLibCounter.close(uiLib); const bool ret = sLibCounter.close(uiLib);
uiLib = nullptr; uiLib = nullptr;
return ret; return ret;
} }


void* CarlaPlugin::ProtectedData::uiLibSymbol(const char* const symbol)
void* CarlaPlugin::ProtectedData::uiLibSymbol(const char* const symbol) const noexcept
{ {
return lib_symbol(uiLib, symbol); return lib_symbol(uiLib, symbol);
} }
@@ -714,7 +709,7 @@ void* CarlaPlugin::ProtectedData::uiLibSymbol(const char* const symbol)
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Settings functions // Settings functions


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


@@ -757,25 +752,25 @@ void CarlaPlugin::ProtectedData::saveSetting(const uint option, const bool yesNo
settings.endGroup(); settings.endGroup();
} }


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


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


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


CHECK_AND_SET_OPTION("FixedBuffers", PLUGIN_OPTION_FIXED_BUFFERS); CHECK_AND_SET_OPTION("FixedBuffers", PLUGIN_OPTION_FIXED_BUFFERS);
@@ -797,4 +792,12 @@ uint CarlaPlugin::ProtectedData::loadSettings(const uint curOptions, const uint


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


void CarlaPlugin::ProtectedData::tryTransient() noexcept
{
if (engine->getOptions().frontendWinId != 0)
transientTryCounter = 1;
}

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

CARLA_BACKEND_END_NAMESPACE CARLA_BACKEND_END_NAMESPACE

+ 39
- 48
source/backend/plugin/CarlaPluginInternal.hpp View File

@@ -51,15 +51,15 @@ class CarlaEngineEventPort;
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Maximum pre-allocated events for some plugin types // Maximum pre-allocated events for some plugin types


const unsigned short kPluginMaxMidiEvents = 512;
const ushort kPluginMaxMidiEvents = 512;


// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// Extra plugin hints, hidden from backend // Extra plugin hints, hidden from backend


const unsigned int PLUGIN_EXTRA_HINT_HAS_MIDI_IN = 0x01;
const unsigned int PLUGIN_EXTRA_HINT_HAS_MIDI_OUT = 0x02;
const unsigned int PLUGIN_EXTRA_HINT_CAN_RUN_RACK = 0x04;
const unsigned int PLUGIN_EXTRA_HINT_USES_MULTI_PROGS = 0x08;
const uint PLUGIN_EXTRA_HINT_HAS_MIDI_IN = 0x01;
const uint PLUGIN_EXTRA_HINT_HAS_MIDI_OUT = 0x02;
const uint PLUGIN_EXTRA_HINT_CAN_RUN_RACK = 0x04;
const uint PLUGIN_EXTRA_HINT_USES_MULTI_PROGS = 0x08;


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


@@ -73,7 +73,7 @@ const unsigned int PLUGIN_EXTRA_HINT_USES_MULTI_PROGS = 0x08;
enum PluginPostRtEventType { enum PluginPostRtEventType {
kPluginPostRtEventNull = 0, kPluginPostRtEventNull = 0,
kPluginPostRtEventDebug, kPluginPostRtEventDebug,
kPluginPostRtEventParameterChange, // param, SP (*), value (SP: if 1, don't report change to Callback and OSC)
kPluginPostRtEventParameterChange, // param, SP (*), value (SP: if 1 only report change to UI, don't report to Callback and OSC)
kPluginPostRtEventProgramChange, // index kPluginPostRtEventProgramChange, // index
kPluginPostRtEventMidiProgramChange, // index kPluginPostRtEventMidiProgramChange, // index
kPluginPostRtEventNoteOn, // channel, note, velo kPluginPostRtEventNoteOn, // channel, note, velo
@@ -104,11 +104,6 @@ struct ExternalMidiNote {
struct PluginAudioPort { struct PluginAudioPort {
uint32_t rindex; uint32_t rindex;
CarlaEngineAudioPort* port; CarlaEngineAudioPort* port;

PluginAudioPort() noexcept;
~PluginAudioPort() noexcept;

CARLA_DECLARE_NON_COPY_STRUCT(PluginAudioPort)
}; };


struct PluginAudioData { struct PluginAudioData {
@@ -119,7 +114,7 @@ struct PluginAudioData {
~PluginAudioData() noexcept; ~PluginAudioData() noexcept;
void createNew(const uint32_t newCount); void createNew(const uint32_t newCount);
void clear() noexcept; void clear() noexcept;
void initBuffers() noexcept;
void initBuffers() const noexcept;


CARLA_DECLARE_NON_COPY_STRUCT(PluginAudioData) CARLA_DECLARE_NON_COPY_STRUCT(PluginAudioData)
}; };
@@ -130,11 +125,6 @@ struct PluginCVPort {
uint32_t rindex; uint32_t rindex;
uint32_t param; uint32_t param;
CarlaEngineCVPort* port; CarlaEngineCVPort* port;

PluginCVPort() noexcept;
~PluginCVPort() noexcept;

CARLA_DECLARE_NON_COPY_STRUCT(PluginCVPort)
}; };


struct PluginCVData { struct PluginCVData {
@@ -145,7 +135,7 @@ struct PluginCVData {
~PluginCVData() noexcept; ~PluginCVData() noexcept;
void createNew(const uint32_t newCount); void createNew(const uint32_t newCount);
void clear() noexcept; void clear() noexcept;
void initBuffers() noexcept;
void initBuffers() const noexcept;


CARLA_DECLARE_NON_COPY_STRUCT(PluginCVData) CARLA_DECLARE_NON_COPY_STRUCT(PluginCVData)
}; };
@@ -159,7 +149,7 @@ struct PluginEventData {
PluginEventData() noexcept; PluginEventData() noexcept;
~PluginEventData() noexcept; ~PluginEventData() noexcept;
void clear() noexcept; void clear() noexcept;
void initBuffers() noexcept;
void initBuffers() const noexcept;


CARLA_DECLARE_NON_COPY_STRUCT(PluginEventData) CARLA_DECLARE_NON_COPY_STRUCT(PluginEventData)
}; };
@@ -182,7 +172,7 @@ struct PluginParameterData {


PluginParameterData() noexcept; PluginParameterData() noexcept;
~PluginParameterData() noexcept; ~PluginParameterData() noexcept;
void createNew(const uint32_t newCount, const bool withSpecial, const bool doReset);
void createNew(const uint32_t newCount, const bool withSpecial);
void clear() noexcept; void clear() noexcept;
float getFixedValue(const uint32_t parameterId, const float& value) const noexcept; float getFixedValue(const uint32_t parameterId, const float& value) const noexcept;


@@ -195,7 +185,7 @@ typedef const char* ProgramName;


struct PluginProgramData { struct PluginProgramData {
uint32_t count; uint32_t count;
int32_t current;
int32_t current;
ProgramName* names; ProgramName* names;


PluginProgramData() noexcept; PluginProgramData() noexcept;
@@ -210,7 +200,7 @@ struct PluginProgramData {


struct PluginMidiProgramData { struct PluginMidiProgramData {
uint32_t count; uint32_t count;
int32_t current;
int32_t current;
MidiProgramData* data; MidiProgramData* data;


PluginMidiProgramData() noexcept; PluginMidiProgramData() noexcept;
@@ -228,9 +218,9 @@ struct CarlaPlugin::ProtectedData {
CarlaEngine* const engine; CarlaEngine* const engine;
CarlaEngineClient* client; CarlaEngineClient* client;


unsigned int id;
unsigned int hints;
unsigned int options;
uint id;
uint hints;
uint options;


bool active; bool active;
bool enabled; bool enabled;
@@ -273,9 +263,9 @@ struct CarlaPlugin::ProtectedData {
RtLinkedList<ExternalMidiNote>::Pool dataPool; RtLinkedList<ExternalMidiNote>::Pool dataPool;
RtLinkedList<ExternalMidiNote> data; RtLinkedList<ExternalMidiNote> data;


ExternalNotes();
~ExternalNotes();
void append(const ExternalMidiNote& note);
ExternalNotes() noexcept;
~ExternalNotes() noexcept;
void appendNonRT(const ExternalMidiNote& note) noexcept;


CARLA_DECLARE_NON_COPY_STRUCT(ExternalNotes) CARLA_DECLARE_NON_COPY_STRUCT(ExternalNotes)


@@ -287,11 +277,11 @@ struct CarlaPlugin::ProtectedData {
RtLinkedList<PluginPostRtEvent> data; RtLinkedList<PluginPostRtEvent> data;
RtLinkedList<PluginPostRtEvent> dataPendingRT; RtLinkedList<PluginPostRtEvent> dataPendingRT;


PostRtEvents();
~PostRtEvents();
void appendRT(const PluginPostRtEvent& event);
void trySplice();
void clear();
PostRtEvents() noexcept;
~PostRtEvents() noexcept;
void appendRT(const PluginPostRtEvent& event) noexcept;
void trySplice() noexcept;
void clear() noexcept;


CARLA_DECLARE_NON_COPY_STRUCT(PostRtEvents) CARLA_DECLARE_NON_COPY_STRUCT(PostRtEvents)


@@ -316,7 +306,7 @@ struct CarlaPlugin::ProtectedData {
CarlaOscData data; CarlaOscData data;
CarlaPluginThread thread; CarlaPluginThread thread;


OSC(CarlaEngine* const engine, CarlaPlugin* const plugin);
OSC(CarlaEngine* const engine, CarlaPlugin* const plugin) noexcept;


#ifdef CARLA_PROPER_CPP11_SUPPORT #ifdef CARLA_PROPER_CPP11_SUPPORT
OSC() = delete; OSC() = delete;
@@ -324,43 +314,44 @@ struct CarlaPlugin::ProtectedData {
#endif #endif
} osc; } osc;


ProtectedData(CarlaEngine* const eng, const unsigned int idx, CarlaPlugin* const self);
~ProtectedData();
ProtectedData(CarlaEngine* const engine, const uint idx, CarlaPlugin* const plugin) noexcept;
~ProtectedData() noexcept;


// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Buffer functions // Buffer functions


void clearBuffers();
void clearBuffers() noexcept;
void recreateLatencyBuffers(); void recreateLatencyBuffers();


// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Post-poned events // Post-poned events


void postponeRtEvent(const PluginPostRtEventType type, const int32_t value1, const int32_t value2, const float value3);
void postponeRtEvent(const PluginPostRtEvent& rtEvent) noexcept;
void postponeRtEvent(const PluginPostRtEventType type, const int32_t value1, const int32_t value2, const float value3) noexcept;


// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Library functions // Library functions


const char* libError(const char* const filename);
static const char* libError(const char* const filename) noexcept;


bool libOpen(const char* const filename);
bool libClose();
void* libSymbol(const char* const symbol);
bool libOpen(const char* const filename) noexcept;
bool libClose() noexcept;
void* libSymbol(const char* const symbol) const noexcept;


bool uiLibOpen(const char* const filename, const bool canDelete);
bool uiLibClose();
void* uiLibSymbol(const char* const symbol);
bool uiLibOpen(const char* const filename, const bool canDelete) noexcept;
bool uiLibClose() noexcept;
void* uiLibSymbol(const char* const symbol) const noexcept;


// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Settings functions // Settings functions


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


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


void tryTransient();
void tryTransient() noexcept;


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




+ 5
- 3
source/backend/plugin/CarlaPluginThread.cpp View File

@@ -57,14 +57,16 @@ CarlaPluginThread::CarlaPluginThread(CarlaBackend::CarlaEngine* const engine, Ca
carla_debug("CarlaPluginThread::CarlaPluginThread(%p, %p, %s)", engine, plugin, PluginThreadMode2str(mode)); carla_debug("CarlaPluginThread::CarlaPluginThread(%p, %p, %s)", engine, plugin, PluginThreadMode2str(mode));
} }


CarlaPluginThread::~CarlaPluginThread()
CarlaPluginThread::~CarlaPluginThread() noexcept
{ {
carla_debug("CarlaPluginThread::~CarlaPluginThread()"); carla_debug("CarlaPluginThread::~CarlaPluginThread()");


if (fProcess != nullptr) if (fProcess != nullptr)
{ {
delete fProcess;
fProcess = nullptr;
try {
delete fProcess;
} CARLA_SAFE_EXCEPTION("~CarlaPluginThread(): delete QProcess");
fProcess = nullptr;
} }
} }




+ 1
- 1
source/backend/plugin/CarlaPluginThread.hpp View File

@@ -43,7 +43,7 @@ public:
}; };


CarlaPluginThread(CarlaEngine* const engine, CarlaPlugin* const plugin, const Mode mode = PLUGIN_THREAD_NULL) noexcept; CarlaPluginThread(CarlaEngine* const engine, CarlaPlugin* const plugin, const Mode mode = PLUGIN_THREAD_NULL) noexcept;
~CarlaPluginThread() override;
~CarlaPluginThread() noexcept override;


void setMode(const CarlaPluginThread::Mode mode) noexcept; void setMode(const CarlaPluginThread::Mode mode) noexcept;
void setOscData(const char* const binary, const char* const label, const char* const extra1="", const char* const extra2="") noexcept; void setOscData(const char* const binary, const char* const label, const char* const extra1="", const char* const extra2="") noexcept;


+ 1
- 1
source/backend/plugin/CsoundPlugin.cpp View File

@@ -32,7 +32,7 @@ CARLA_BACKEND_START_NAMESPACE
class CsoundPlugin : public CarlaPlugin class CsoundPlugin : public CarlaPlugin
{ {
public: public:
CsoundPlugin(CarlaEngine* const engine, const unsigned short id)
CsoundPlugin(CarlaEngine* const engine, const ushort id)
: CarlaPlugin(engine, id) : CarlaPlugin(engine, id)
{ {
carla_debug("CsoundPlugin::CsoundPlugin(%p, %i)", engine, id); carla_debug("CsoundPlugin::CsoundPlugin(%p, %i)", engine, id);


+ 15
- 15
source/backend/plugin/DssiPlugin.cpp View File

@@ -38,7 +38,7 @@ CARLA_BACKEND_START_NAMESPACE
class DssiPlugin : public CarlaPlugin class DssiPlugin : public CarlaPlugin
{ {
public: public:
DssiPlugin(CarlaEngine* const engine, const unsigned int id)
DssiPlugin(CarlaEngine* const engine, const uint id)
: CarlaPlugin(engine, id), : CarlaPlugin(engine, id),
fHandle(nullptr), fHandle(nullptr),
fHandle2(nullptr), fHandle2(nullptr),
@@ -151,7 +151,7 @@ public:
CARLA_SAFE_ASSERT_RETURN(dataPtr != nullptr, 0); CARLA_SAFE_ASSERT_RETURN(dataPtr != nullptr, 0);


int ret = 0; int ret = 0;
unsigned long dataSize = 0;
ulong dataSize = 0;


try { try {
ret = fDssiDescriptor->get_custom_data(fHandle, dataPtr, &dataSize); ret = fDssiDescriptor->get_custom_data(fHandle, dataPtr, &dataSize);
@@ -163,7 +163,7 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
#ifdef __USE_GNU #ifdef __USE_GNU
const bool isAmSynth(strcasestr(pData->filename, "amsynth")); const bool isAmSynth(strcasestr(pData->filename, "amsynth"));
@@ -173,7 +173,7 @@ public:
const bool isDssiVst(std::strstr(pData->filename, "dssi-vst")); const bool isDssiVst(std::strstr(pData->filename, "dssi-vst"));
#endif #endif


unsigned int options = 0x0;
uint options = 0x0;


options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


@@ -463,7 +463,7 @@ public:
if (fHandle2 == nullptr) if (fHandle2 == nullptr)
{ {
try { try {
fHandle2 = fDescriptor->instantiate(fDescriptor, (unsigned long)sampleRate);
fHandle2 = fDescriptor->instantiate(fDescriptor, (ulong)sampleRate);
} catch(...) {} } catch(...) {}
} }


@@ -510,7 +510,7 @@ public:


if (params > 0) if (params > 0)
{ {
pData->param.createNew(params, true, false);
pData->param.createNew(params, true);


fParamBuffers = new float[params]; fParamBuffers = new float[params];
FLOAT_CLEAR(fParamBuffers, params); FLOAT_CLEAR(fParamBuffers, params);
@@ -987,7 +987,7 @@ public:
return; return;
} }


unsigned long midiEventCount = 0;
ulong midiEventCount = 0;


// -------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------
// Check if needs reset // Check if needs reset
@@ -999,7 +999,7 @@ public:
midiEventCount = MAX_MIDI_CHANNELS*2; midiEventCount = MAX_MIDI_CHANNELS*2;
carla_zeroStruct<snd_seq_event_t>(fMidiEvents, midiEventCount); carla_zeroStruct<snd_seq_event_t>(fMidiEvents, midiEventCount);


for (unsigned char i=0, k=MAX_MIDI_CHANNELS; i < MAX_MIDI_CHANNELS; ++i)
for (uchar i=0, k=MAX_MIDI_CHANNELS; i < MAX_MIDI_CHANNELS; ++i)
{ {
fMidiEvents[i].type = SND_SEQ_EVENT_CONTROLLER; fMidiEvents[i].type = SND_SEQ_EVENT_CONTROLLER;
fMidiEvents[i].data.control.channel = i; fMidiEvents[i].data.control.channel = i;
@@ -1015,7 +1015,7 @@ public:
midiEventCount = MAX_MIDI_NOTE; midiEventCount = MAX_MIDI_NOTE;
carla_zeroStruct<snd_seq_event_t>(fMidiEvents, midiEventCount); carla_zeroStruct<snd_seq_event_t>(fMidiEvents, midiEventCount);


for (unsigned char i=0; i < MAX_MIDI_NOTE; ++i)
for (uchar i=0; i < MAX_MIDI_NOTE; ++i)
{ {
fMidiEvents[i].type = SND_SEQ_EVENT_NOTEOFF; fMidiEvents[i].type = SND_SEQ_EVENT_NOTEOFF;
fMidiEvents[i].data.note.channel = static_cast<uchar>(pData->ctrlChannel); fMidiEvents[i].data.note.channel = static_cast<uchar>(pData->ctrlChannel);
@@ -1442,7 +1442,7 @@ public:
} // End of Control Output } // End of Control Output
} }


bool processSingle(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t timeOffset, const unsigned long midiEventCount)
bool processSingle(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t timeOffset, const ulong midiEventCount)
{ {
CARLA_SAFE_ASSERT_RETURN(frames > 0, false); CARLA_SAFE_ASSERT_RETURN(frames > 0, false);


@@ -1494,10 +1494,10 @@ public:
} }
else if (fDssiDescriptor->run_multiple_synths != nullptr) else if (fDssiDescriptor->run_multiple_synths != nullptr)
{ {
unsigned long instances = (fHandle2 != nullptr) ? 2 : 1;
ulong instances = (fHandle2 != nullptr) ? 2 : 1;
LADSPA_Handle handlePtr[2] = { fHandle, fHandle2 }; LADSPA_Handle handlePtr[2] = { fHandle, fHandle2 };
snd_seq_event_t* midiEventsPtr[2] = { fMidiEvents, fMidiEvents }; snd_seq_event_t* midiEventsPtr[2] = { fMidiEvents, fMidiEvents };
unsigned long midiEventCountPtr[2] = { midiEventCount, midiEventCount };
ulong midiEventCountPtr[2] = { midiEventCount, midiEventCount };
fDssiDescriptor->run_multiple_synths(instances, handlePtr, frames, midiEventsPtr, midiEventCountPtr); fDssiDescriptor->run_multiple_synths(instances, handlePtr, frames, midiEventsPtr, midiEventCountPtr);
} }
else else
@@ -1672,7 +1672,7 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Plugin buffers // Plugin buffers


void clearBuffers() override
void clearBuffers() noexcept override
{ {
carla_debug("DssiPlugin::clearBuffers() - start"); carla_debug("DssiPlugin::clearBuffers() - start");


@@ -1834,7 +1834,7 @@ public:
// --------------------------------------------------------------- // ---------------------------------------------------------------
// get descriptor that matches label // get descriptor that matches label


unsigned long i = 0;
ulong i = 0;
while ((fDssiDescriptor = descFn(i++)) != nullptr) while ((fDssiDescriptor = descFn(i++)) != nullptr)
{ {
fDescriptor = fDssiDescriptor->LADSPA_Plugin; fDescriptor = fDssiDescriptor->LADSPA_Plugin;
@@ -1887,7 +1887,7 @@ public:
// initialize plugin // initialize plugin


try { try {
fHandle = fDescriptor->instantiate(fDescriptor, (unsigned long)pData->engine->getSampleRate());
fHandle = fDescriptor->instantiate(fDescriptor, (ulong)pData->engine->getSampleRate());
} catch(...) {} } catch(...) {}


if (fHandle == nullptr) if (fHandle == nullptr)


+ 2
- 2
source/backend/plugin/FluidSynthPlugin.cpp View File

@@ -555,7 +555,7 @@ public:
params = FluidSynthParametersMax; params = FluidSynthParametersMax;


pData->audioOut.createNew(aOuts); pData->audioOut.createNew(aOuts);
pData->param.createNew(params, false, false);
pData->param.createNew(params, false);


const uint portNameSize(pData->engine->getMaxPortNameSize()); const uint portNameSize(pData->engine->getMaxPortNameSize());
CarlaString portName; CarlaString portName;
@@ -1531,7 +1531,7 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Plugin buffers // Plugin buffers


void clearBuffers() override
void clearBuffers() noexcept override
{ {
carla_debug("FluidSynthPlugin::clearBuffers() - start"); carla_debug("FluidSynthPlugin::clearBuffers() - start");




+ 3
- 3
source/backend/plugin/JucePlugin.cpp View File

@@ -135,11 +135,11 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr, 0x0); CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr, 0x0);


unsigned int options = 0x0;
uint options = 0x0;


options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;
//options |= PLUGIN_OPTION_USE_CHUNKS; //options |= PLUGIN_OPTION_USE_CHUNKS;
@@ -351,7 +351,7 @@ public:


if (params > 0) if (params > 0)
{ {
pData->param.createNew(params, false, false);
pData->param.createNew(params, false);
needsCtrlIn = true; needsCtrlIn = true;
} }




+ 20
- 11
source/backend/plugin/LadspaPlugin.cpp View File

@@ -36,7 +36,7 @@ CARLA_BACKEND_START_NAMESPACE
class LadspaPlugin : public CarlaPlugin class LadspaPlugin : public CarlaPlugin
{ {
public: public:
LadspaPlugin(CarlaEngine* const engine, const unsigned int id)
LadspaPlugin(CarlaEngine* const engine, const uint id) noexcept
: CarlaPlugin(engine, id), : CarlaPlugin(engine, id),
fHandle(nullptr), fHandle(nullptr),
fHandle2(nullptr), fHandle2(nullptr),
@@ -49,7 +49,7 @@ public:
carla_debug("LadspaPlugin::LadspaPlugin(%p, %i)", engine, id); carla_debug("LadspaPlugin::LadspaPlugin(%p, %i)", engine, id);
} }


~LadspaPlugin() override
~LadspaPlugin() noexcept override
{ {
carla_debug("LadspaPlugin::~LadspaPlugin()"); carla_debug("LadspaPlugin::~LadspaPlugin()");


@@ -70,9 +70,18 @@ public:
if (fDescriptor->cleanup != nullptr) if (fDescriptor->cleanup != nullptr)
{ {
if (fHandle != nullptr) if (fHandle != nullptr)
fDescriptor->cleanup(fHandle);
{
try {
fDescriptor->cleanup(fHandle);
} catch(...) {}
}

if (fHandle2 != nullptr) if (fHandle2 != nullptr)
fDescriptor->cleanup(fHandle2);
{
try {
fDescriptor->cleanup(fHandle2);
} catch(...) {}
}
} }


fHandle = nullptr; fHandle = nullptr;
@@ -168,7 +177,7 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
#ifdef __USE_GNU #ifdef __USE_GNU
const bool isDssiVst(strcasestr(pData->filename, "dssi-vst")); const bool isDssiVst(strcasestr(pData->filename, "dssi-vst"));
@@ -176,7 +185,7 @@ public:
const bool isDssiVst(std::strstr(pData->filename, "dssi-vst")); const bool isDssiVst(std::strstr(pData->filename, "dssi-vst"));
#endif #endif


unsigned int options = 0x0;
uint options = 0x0;


if (! isDssiVst) if (! isDssiVst)
{ {
@@ -455,7 +464,7 @@ public:
if (fHandle2 == nullptr) if (fHandle2 == nullptr)
{ {
try { try {
fHandle2 = fDescriptor->instantiate(fDescriptor, (unsigned long)sampleRate);
fHandle2 = fDescriptor->instantiate(fDescriptor, (ulong)sampleRate);
} catch(...) {} } catch(...) {}
} }


@@ -496,7 +505,7 @@ public:


if (params > 0) if (params > 0)
{ {
pData->param.createNew(params, true, false);
pData->param.createNew(params, true);


fParamBuffers = new float[params]; fParamBuffers = new float[params];
FLOAT_CLEAR(fParamBuffers, params); FLOAT_CLEAR(fParamBuffers, params);
@@ -1283,7 +1292,7 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Plugin buffers // Plugin buffers


void clearBuffers() override
void clearBuffers() noexcept override
{ {
carla_debug("LadspaPlugin::clearBuffers() - start"); carla_debug("LadspaPlugin::clearBuffers() - start");


@@ -1383,7 +1392,7 @@ public:
// --------------------------------------------------------------- // ---------------------------------------------------------------
// get descriptor that matches label // get descriptor that matches label


unsigned long i = 0;
ulong i = 0;
while ((fDescriptor = descFn(i++)) != nullptr) while ((fDescriptor = descFn(i++)) != nullptr)
{ {
if (fDescriptor->Label != nullptr && std::strcmp(fDescriptor->Label, label) == 0) if (fDescriptor->Label != nullptr && std::strcmp(fDescriptor->Label, label) == 0)
@@ -1428,7 +1437,7 @@ public:
// initialize plugin // initialize plugin


try { try {
fHandle = fDescriptor->instantiate(fDescriptor, (unsigned long)pData->engine->getSampleRate());
fHandle = fDescriptor->instantiate(fDescriptor, (ulong)pData->engine->getSampleRate());
} catch(...) {} } catch(...) {}


if (fHandle == nullptr) if (fHandle == nullptr)


+ 3
- 3
source/backend/plugin/LinuxSamplerPlugin.cpp View File

@@ -180,7 +180,7 @@ CARLA_BACKEND_START_NAMESPACE
class LinuxSamplerPlugin : public CarlaPlugin class LinuxSamplerPlugin : public CarlaPlugin
{ {
public: public:
LinuxSamplerPlugin(CarlaEngine* const engine, const unsigned int id, const char* const format, const bool use16Outs)
LinuxSamplerPlugin(CarlaEngine* const engine, const uint id, const char* const format, const bool use16Outs)
: CarlaPlugin(engine, id), : CarlaPlugin(engine, id),
fUses16Outs(use16Outs), fUses16Outs(use16Outs),
fFormat(carla_strdup(format)), fFormat(carla_strdup(format)),
@@ -316,9 +316,9 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
unsigned int options = 0x0;
uint options = 0x0;


options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;
options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES;


+ 37
- 34
source/backend/plugin/Lv2Plugin.cpp View File

@@ -51,25 +51,25 @@ CARLA_BACKEND_START_NAMESPACE
#endif #endif


// Maximum default buffer size // Maximum default buffer size
const unsigned int MAX_DEFAULT_BUFFER_SIZE = 8192; // 0x2000
const uint MAX_DEFAULT_BUFFER_SIZE = 8192; // 0x2000


// Extra Plugin Hints // Extra Plugin Hints
const unsigned int PLUGIN_HAS_EXTENSION_OPTIONS = 0x1000;
const unsigned int PLUGIN_HAS_EXTENSION_PROGRAMS = 0x2000;
const unsigned int PLUGIN_HAS_EXTENSION_STATE = 0x4000;
const unsigned int PLUGIN_HAS_EXTENSION_WORKER = 0x8000;
const uint PLUGIN_HAS_EXTENSION_OPTIONS = 0x1000;
const uint PLUGIN_HAS_EXTENSION_PROGRAMS = 0x2000;
const uint PLUGIN_HAS_EXTENSION_STATE = 0x4000;
const uint PLUGIN_HAS_EXTENSION_WORKER = 0x8000;


// Extra Parameter Hints // Extra Parameter Hints
const unsigned int PARAMETER_IS_STRICT_BOUNDS = 0x1000;
const unsigned int PARAMETER_IS_TRIGGER = 0x2000;
const uint PARAMETER_IS_STRICT_BOUNDS = 0x1000;
const uint PARAMETER_IS_TRIGGER = 0x2000;


// LV2 Event Data/Types // LV2 Event Data/Types
const unsigned int CARLA_EVENT_DATA_ATOM = 0x01;
const unsigned int CARLA_EVENT_DATA_EVENT = 0x02;
const unsigned int CARLA_EVENT_DATA_MIDI_LL = 0x04;
const unsigned int CARLA_EVENT_TYPE_MESSAGE = 0x10; // unused
const unsigned int CARLA_EVENT_TYPE_MIDI = 0x20;
const unsigned int CARLA_EVENT_TYPE_TIME = 0x40;
const uint CARLA_EVENT_DATA_ATOM = 0x01;
const uint CARLA_EVENT_DATA_EVENT = 0x02;
const uint CARLA_EVENT_DATA_MIDI_LL = 0x04;
const uint CARLA_EVENT_TYPE_MESSAGE = 0x10; // unused
const uint CARLA_EVENT_TYPE_MIDI = 0x20;
const uint CARLA_EVENT_TYPE_TIME = 0x40;


// LV2 URI Map Ids // LV2 URI Map Ids
const uint32_t CARLA_URI_MAP_ID_NULL = 0; const uint32_t CARLA_URI_MAP_ID_NULL = 0;
@@ -170,12 +170,12 @@ struct Lv2EventData {
LV2_MIDI midi; LV2_MIDI midi;
}; };


Lv2EventData()
Lv2EventData() noexcept
: type(0x0), : type(0x0),
rindex(0), rindex(0),
port(nullptr) {} port(nullptr) {}


~Lv2EventData()
~Lv2EventData() noexcept
{ {
if (port != nullptr) if (port != nullptr)
{ {
@@ -218,18 +218,18 @@ struct Lv2PluginEventData {
Lv2EventData* ctrl; // default port, either this->data[x] or pData->portIn/Out Lv2EventData* ctrl; // default port, either this->data[x] or pData->portIn/Out
uint32_t ctrlIndex; uint32_t ctrlIndex;


Lv2PluginEventData()
Lv2PluginEventData() noexcept
: count(0), : count(0),
data(nullptr), data(nullptr),
ctrl(nullptr), ctrl(nullptr),
ctrlIndex(0) {} ctrlIndex(0) {}


~Lv2PluginEventData()
~Lv2PluginEventData() noexcept
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_ASSERT(data == nullptr);
CARLA_ASSERT(ctrl == nullptr);
CARLA_ASSERT_INT(ctrlIndex == 0, ctrlIndex);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT(data == nullptr);
CARLA_SAFE_ASSERT(ctrl == nullptr);
CARLA_SAFE_ASSERT_INT(ctrlIndex == 0, ctrlIndex);
} }


void createNew(const uint32_t newCount) void createNew(const uint32_t newCount)
@@ -242,9 +242,12 @@ struct Lv2PluginEventData {


data = new Lv2EventData[newCount]; data = new Lv2EventData[newCount];
count = newCount; count = newCount;

ctrl = nullptr;
ctrlIndex = 0;
} }


void clear()
void clear() noexcept
{ {
if (data != nullptr) if (data != nullptr)
{ {
@@ -298,7 +301,7 @@ struct Lv2PluginOptions {
const char* windowTitle; const char* windowTitle;
LV2_Options_Option opts[Count]; LV2_Options_Option opts[Count];


Lv2PluginOptions()
Lv2PluginOptions() noexcept
: maxBufferSize(0), : maxBufferSize(0),
minBufferSize(0), minBufferSize(0),
sequenceSize(MAX_DEFAULT_BUFFER_SIZE), sequenceSize(MAX_DEFAULT_BUFFER_SIZE),
@@ -363,7 +366,7 @@ struct Lv2PluginOptions {
optNull.value = nullptr; optNull.value = nullptr;
} }


~Lv2PluginOptions()
~Lv2PluginOptions() noexcept
{ {
LV2_Options_Option& optWindowTitle(opts[WindowTitle]); LV2_Options_Option& optWindowTitle(opts[WindowTitle]);


@@ -384,7 +387,7 @@ class Lv2Plugin : public CarlaPlugin,
CarlaPluginUi::CloseCallback CarlaPluginUi::CloseCallback
{ {
public: public:
Lv2Plugin(CarlaEngine* const engine, const unsigned int id)
Lv2Plugin(CarlaEngine* const engine, const uint id)
: CarlaPlugin(engine, id), : CarlaPlugin(engine, id),
fHandle(nullptr), fHandle(nullptr),
fHandle2(nullptr), fHandle2(nullptr),
@@ -682,11 +685,11 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
const bool hasMidiIn(getMidiInCount() > 0); const bool hasMidiIn(getMidiInCount() > 0);


unsigned int options = 0x0;
uint options = 0x0;


options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


@@ -1363,7 +1366,7 @@ public:


uint32_t aIns, aOuts, cvIns, cvOuts, params; uint32_t aIns, aOuts, cvIns, cvOuts, params;
aIns = aOuts = cvIns = cvOuts = params = 0; aIns = aOuts = cvIns = cvOuts = params = 0;
LinkedList<unsigned int> evIns, evOuts;
LinkedList<uint> evIns, evOuts;


const uint32_t eventBufferSize(static_cast<uint32_t>(fLv2Options.sequenceSize)); const uint32_t eventBufferSize(static_cast<uint32_t>(fLv2Options.sequenceSize));


@@ -1482,7 +1485,7 @@ public:


if (params > 0) if (params > 0)
{ {
pData->param.createNew(params, true, false);
pData->param.createNew(params, true);
fParamBuffers = new float[params]; fParamBuffers = new float[params];
FLOAT_CLEAR(fParamBuffers, params); FLOAT_CLEAR(fParamBuffers, params);
} }
@@ -1509,7 +1512,7 @@ public:
{ {
fEventsIn.data[i].type = CARLA_EVENT_DATA_MIDI_LL; fEventsIn.data[i].type = CARLA_EVENT_DATA_MIDI_LL;
fEventsIn.data[i].midi.capacity = eventBufferSize; fEventsIn.data[i].midi.capacity = eventBufferSize;
fEventsIn.data[i].midi.data = new unsigned char[eventBufferSize];
fEventsIn.data[i].midi.data = new uchar[eventBufferSize];
} }
} }
} }
@@ -1541,7 +1544,7 @@ public:
{ {
fEventsOut.data[i].type = CARLA_EVENT_DATA_MIDI_LL; fEventsOut.data[i].type = CARLA_EVENT_DATA_MIDI_LL;
fEventsOut.data[i].midi.capacity = eventBufferSize; fEventsOut.data[i].midi.capacity = eventBufferSize;
fEventsOut.data[i].midi.data = new unsigned char[eventBufferSize];
fEventsOut.data[i].midi.data = new uchar[eventBufferSize];
} }
} }
} }
@@ -3094,7 +3097,7 @@ public:


uint32_t eventSize; uint32_t eventSize;
double eventTime; double eventTime;
unsigned char* eventData;
uchar* eventData;


for (;;) for (;;)
{ {
@@ -3466,7 +3469,7 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Plugin buffers // Plugin buffers


void initBuffers() override
void initBuffers() const noexcept override
{ {
fCvIn.initBuffers(); fCvIn.initBuffers();
fCvOut.initBuffers(); fCvOut.initBuffers();
@@ -3476,7 +3479,7 @@ public:
CarlaPlugin::initBuffers(); CarlaPlugin::initBuffers();
} }


void clearBuffers() override
void clearBuffers() noexcept override
{ {
carla_debug("Lv2Plugin::clearBuffers() - start"); carla_debug("Lv2Plugin::clearBuffers() - start");




+ 16
- 16
source/backend/plugin/NativePlugin.cpp View File

@@ -47,16 +47,16 @@ struct NativePluginMidiData {
uint32_t* indexes; uint32_t* indexes;
CarlaEngineEventPort** ports; CarlaEngineEventPort** ports;


NativePluginMidiData()
NativePluginMidiData() noexcept
: count(0), : count(0),
indexes(nullptr), indexes(nullptr),
ports(nullptr) {} ports(nullptr) {}


~NativePluginMidiData()
~NativePluginMidiData() noexcept
{ {
CARLA_ASSERT_INT(count == 0, count);
CARLA_ASSERT(indexes == nullptr);
CARLA_ASSERT(ports == nullptr);
CARLA_SAFE_ASSERT_INT(count == 0, count);
CARLA_SAFE_ASSERT(indexes == nullptr);
CARLA_SAFE_ASSERT(ports == nullptr);
} }


void createNew(const uint32_t newCount) void createNew(const uint32_t newCount)
@@ -66,18 +66,18 @@ struct NativePluginMidiData {
CARLA_SAFE_ASSERT_RETURN(ports == nullptr,); CARLA_SAFE_ASSERT_RETURN(ports == nullptr,);
CARLA_SAFE_ASSERT_RETURN(newCount > 0,); CARLA_SAFE_ASSERT_RETURN(newCount > 0,);


ports = new CarlaEngineEventPort*[newCount];
indexes = new uint32_t[newCount]; indexes = new uint32_t[newCount];
ports = new CarlaEngineEventPort*[newCount];
count = newCount; count = newCount;


for (uint32_t i=0; i < newCount; ++i) for (uint32_t i=0; i < newCount; ++i)
ports[i] = nullptr;
indexes[i] = 0;


for (uint32_t i=0; i < newCount; ++i) for (uint32_t i=0; i < newCount; ++i)
indexes[i] = 0;
ports[i] = nullptr;
} }


void clear()
void clear() noexcept
{ {
if (ports != nullptr) if (ports != nullptr)
{ {
@@ -103,7 +103,7 @@ struct NativePluginMidiData {
count = 0; count = 0;
} }


void initBuffers()
void initBuffers() const noexcept
{ {
for (uint32_t i=0; i < count; ++i) for (uint32_t i=0; i < count; ++i)
{ {
@@ -135,7 +135,7 @@ struct ScopedInitializer {
class NativePlugin : public CarlaPlugin class NativePlugin : public CarlaPlugin
{ {
public: public:
NativePlugin(CarlaEngine* const engine, const unsigned int id)
NativePlugin(CarlaEngine* const engine, const uint id)
: CarlaPlugin(engine, id), : CarlaPlugin(engine, id),
fHandle(nullptr), fHandle(nullptr),
fHandle2(nullptr), fHandle2(nullptr),
@@ -278,7 +278,7 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr, 0x0); CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr, 0x0);
CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr, 0); CARLA_SAFE_ASSERT_RETURN(fHandle != nullptr, 0);
@@ -286,7 +286,7 @@ public:
// FIXME - try // FIXME - try
const bool hasMidiProgs(fDescriptor->get_midi_program_count != nullptr && fDescriptor->get_midi_program_count(fHandle) > 0); const bool hasMidiProgs(fDescriptor->get_midi_program_count != nullptr && fDescriptor->get_midi_program_count(fHandle) > 0);


unsigned int options = 0x0;
uint options = 0x0;


if (hasMidiProgs && (fDescriptor->supports & ::PLUGIN_SUPPORTS_PROGRAM_CHANGES) == 0) if (hasMidiProgs && (fDescriptor->supports & ::PLUGIN_SUPPORTS_PROGRAM_CHANGES) == 0)
options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;
@@ -826,7 +826,7 @@ public:


if (params > 0) if (params > 0)
{ {
pData->param.createNew(params, true, false);
pData->param.createNew(params, true);
} }


const uint portNameSize(pData->engine->getMaxPortNameSize()); const uint portNameSize(pData->engine->getMaxPortNameSize());
@@ -1919,7 +1919,7 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Plugin buffers // Plugin buffers


void initBuffers() override
void initBuffers() const noexcept override
{ {
fMidiIn.initBuffers(); fMidiIn.initBuffers();
fMidiOut.initBuffers(); fMidiOut.initBuffers();
@@ -1927,7 +1927,7 @@ public:
CarlaPlugin::initBuffers(); CarlaPlugin::initBuffers();
} }


void clearBuffers() override
void clearBuffers() noexcept override
{ {
carla_debug("NativePlugin::clearBuffers() - start"); carla_debug("NativePlugin::clearBuffers() - start");




+ 4
- 4
source/backend/plugin/ReWirePlugin.cpp View File

@@ -275,7 +275,7 @@ struct RewireBridge {
class ReWirePlugin : public CarlaPlugin class ReWirePlugin : public CarlaPlugin
{ {
public: public:
ReWirePlugin(CarlaEngine* const engine, const unsigned int id)
ReWirePlugin(CarlaEngine* const engine, const uint id)
: CarlaPlugin(engine, id), : CarlaPlugin(engine, id),
fIsOpen(false), fIsOpen(false),
fIsPanelLaunched(false), fIsPanelLaunched(false),
@@ -366,9 +366,9 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
unsigned int options = 0x0;
uint options = 0x0;


if (getMidiInCount() > 0) if (getMidiInCount() > 0)
{ {
@@ -552,7 +552,7 @@ public:


if (params > 0) if (params > 0)
{ {
pData->param.createNew(params, false, true);
pData->param.createNew(params, false);
needsCtrlIn = true; needsCtrlIn = true;
} }




+ 8
- 8
source/backend/plugin/VstPlugin.cpp View File

@@ -47,10 +47,10 @@ CARLA_BACKEND_START_NAMESPACE


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


const unsigned int PLUGIN_CAN_PROCESS_REPLACING = 0x1000;
const unsigned int PLUGIN_HAS_COCKOS_EXTENSIONS = 0x2000;
const unsigned int PLUGIN_USES_OLD_VSTSDK = 0x4000;
const unsigned int PLUGIN_WANTS_MIDI_INPUT = 0x8000;
const uint PLUGIN_CAN_PROCESS_REPLACING = 0x1000;
const uint PLUGIN_HAS_COCKOS_EXTENSIONS = 0x2000;
const uint PLUGIN_USES_OLD_VSTSDK = 0x4000;
const uint PLUGIN_WANTS_MIDI_INPUT = 0x8000;


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


@@ -58,7 +58,7 @@ class VstPlugin : public CarlaPlugin,
CarlaPluginUi::CloseCallback CarlaPluginUi::CloseCallback
{ {
public: public:
VstPlugin(CarlaEngine* const engine, const unsigned int id)
VstPlugin(CarlaEngine* const engine, const uint id)
: CarlaPlugin(engine, id), : CarlaPlugin(engine, id),
fUnique1(1), fUnique1(1),
fEffect(nullptr), fEffect(nullptr),
@@ -204,11 +204,11 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr, 0); CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr, 0);


unsigned int options = 0x0;
uint options = 0x0;


options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


@@ -560,7 +560,7 @@ public:


if (params > 0) if (params > 0)
{ {
pData->param.createNew(params, false, false);
pData->param.createNew(params, false);
needsCtrlIn = true; needsCtrlIn = true;
} }




+ 11
- 9
source/bridges/jackplugin/CarlaJackPlugin.cpp View File

@@ -218,12 +218,12 @@ CARLA_EXPORT int jack_is_realtime(jack_client_t* client);
CARLA_EXPORT jack_nframes_t jack_get_sample_rate(jack_client_t* client); CARLA_EXPORT jack_nframes_t jack_get_sample_rate(jack_client_t* client);
CARLA_EXPORT jack_nframes_t jack_get_buffer_size(jack_client_t* client); CARLA_EXPORT jack_nframes_t jack_get_buffer_size(jack_client_t* client);


CARLA_EXPORT jack_port_t* jack_port_register(jack_client_t* client, const char* port_name, const char* port_type, unsigned long flags, unsigned long buffer_size);
CARLA_EXPORT jack_port_t* jack_port_register(jack_client_t* client, const char* port_name, const char* port_type, ulong flags, ulong buffer_size);
CARLA_EXPORT void* jack_port_get_buffer(jack_port_t* port, jack_nframes_t frames); CARLA_EXPORT void* jack_port_get_buffer(jack_port_t* port, jack_nframes_t frames);


CARLA_EXPORT const char* jack_port_name(const jack_port_t* port); CARLA_EXPORT const char* jack_port_name(const jack_port_t* port);


CARLA_EXPORT const char** jack_get_ports(jack_client_t*, const char* port_name_pattern, const char* type_name_pattern, unsigned long flags);
CARLA_EXPORT const char** jack_get_ports(jack_client_t*, const char* port_name_pattern, const char* type_name_pattern, ulong flags);
CARLA_EXPORT jack_port_t* jack_port_by_name(jack_client_t* client, const char* port_name); CARLA_EXPORT jack_port_t* jack_port_by_name(jack_client_t* client, const char* port_name);
CARLA_EXPORT jack_port_t* jack_port_by_id(jack_client_t* client, jack_port_id_t port_id); CARLA_EXPORT jack_port_t* jack_port_by_id(jack_client_t* client, jack_port_id_t port_id);


@@ -359,7 +359,7 @@ jack_nframes_t jack_get_buffer_size(jack_client_t* client)


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


jack_port_t* jack_port_register(jack_client_t* client, const char* port_name, const char* port_type, unsigned long flags, unsigned long)
jack_port_t* jack_port_register(jack_client_t* client, const char* port_name, const char* port_type, ulong flags, ulong)
{ {
CARLA_SAFE_ASSERT_RETURN(client == &gJackClient, nullptr); CARLA_SAFE_ASSERT_RETURN(client == &gJackClient, nullptr);


@@ -434,7 +434,7 @@ const char* jack_port_name(const jack_port_t* port)


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


const char** jack_get_ports(jack_client_t* client, const char* port_name_pattern, const char* type_name_pattern, unsigned long flags)
const char** jack_get_ports(jack_client_t* client, const char* port_name_pattern, const char* type_name_pattern, ulong flags)
{ {
CARLA_SAFE_ASSERT_RETURN(client == &gJackClient, nullptr); CARLA_SAFE_ASSERT_RETURN(client == &gJackClient, nullptr);


@@ -624,13 +624,13 @@ CARLA_BACKEND_START_NAMESPACE
class JackPlugin : public CarlaPlugin class JackPlugin : public CarlaPlugin
{ {
public: public:
JackPlugin(CarlaEngine* const engine, const uint id)
JackPlugin(CarlaEngine* const engine, const uint id) noexcept
: CarlaPlugin(engine, id) : CarlaPlugin(engine, id)
{ {
carla_debug("JackPlugin::JackPlugin(%p, %i)", engine, id); carla_debug("JackPlugin::JackPlugin(%p, %i)", engine, id);
} }


~JackPlugin() override
~JackPlugin() noexcept override
{ {
carla_debug("JackPlugin::~JackPlugin()"); carla_debug("JackPlugin::~JackPlugin()");


@@ -649,10 +649,12 @@ public:
clearBuffers(); clearBuffers();
} }


void clearBuffers() override
void clearBuffers() noexcept override
{ {
pData->audioIn.count = 0; pData->audioIn.count = 0;
pData->audioOut.count = 0; pData->audioOut.count = 0;

CarlaPlugin::initBuffers();
} }


// ------------------------------------------------------------------- // -------------------------------------------------------------------
@@ -691,9 +693,9 @@ public:
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Information (per-plugin data) // Information (per-plugin data)


unsigned int getOptionsAvailable() const noexcept override
uint getOptionsAvailable() const noexcept override
{ {
unsigned int options = 0x0;
uint options = 0x0;


//options |= PLUGIN_OPTION_FIXED_BUFFERS; //options |= PLUGIN_OPTION_FIXED_BUFFERS;
options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES;


+ 0
- 3
source/carla_backend.py View File

@@ -448,9 +448,6 @@ PARAMETER_INPUT = 1
# Ouput parameter. # Ouput parameter.
PARAMETER_OUTPUT = 2 PARAMETER_OUTPUT = 2


# Special (hidden) parameter.
PARAMETER_SPECIAL = 3

# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Internal Parameter Index # Internal Parameter Index
# Special parameters used internally in Carla. # Special parameters used internally in Carla.


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

@@ -161,8 +161,6 @@ const char* ParameterType2Str(const ParameterType type) noexcept
return "PARAMETER_INPUT"; return "PARAMETER_INPUT";
case PARAMETER_OUTPUT: case PARAMETER_OUTPUT:
return "PARAMETER_OUTPUT"; return "PARAMETER_OUTPUT";
case PARAMETER_SPECIAL:
return "PARAMETER_SPECIAL";
} }


carla_stderr("CarlaBackend::ParameterType2Str(%i) - invalid type", type); carla_stderr("CarlaBackend::ParameterType2Str(%i) - invalid type", type);


+ 2
- 2
source/utils/LinkedList.hpp View File

@@ -341,7 +341,7 @@ public:
} }
} }


void spliceAppend(AbstractLinkedList<T>& list) noexcept
void spliceAppendTo(AbstractLinkedList<T>& list) noexcept
{ {
if (fQueue.next == &fQueue) if (fQueue.next == &fQueue)
return; return;
@@ -352,7 +352,7 @@ public:
_init(); _init();
} }


void spliceInsert(AbstractLinkedList<T>& list) noexcept
void spliceInsertInto(AbstractLinkedList<T>& list) noexcept
{ {
if (fQueue.next == &fQueue) if (fQueue.next == &fQueue)
return; return;


+ 4
- 4
source/utils/RtLinkedList.hpp View File

@@ -119,18 +119,18 @@ public:
fMemPool.resize(minPreallocated, maxPreallocated); fMemPool.resize(minPreallocated, maxPreallocated);
} }


void spliceAppend(RtLinkedList<T>& list) noexcept
void spliceAppendTo(RtLinkedList<T>& list) noexcept
{ {
CARLA_SAFE_ASSERT_RETURN(fMemPool == list.fMemPool,); CARLA_SAFE_ASSERT_RETURN(fMemPool == list.fMemPool,);


AbstractLinkedList<T>::spliceAppend(list);
AbstractLinkedList<T>::spliceAppendTo(list);
} }


void spliceInsert(RtLinkedList<T>& list) noexcept
void spliceInsertInto(RtLinkedList<T>& list) noexcept
{ {
CARLA_SAFE_ASSERT_RETURN(fMemPool == list.fMemPool,); CARLA_SAFE_ASSERT_RETURN(fMemPool == list.fMemPool,);


AbstractLinkedList<T>::spliceInsert(list);
AbstractLinkedList<T>::spliceInsertInto(list);
} }


protected: protected:


Loading…
Cancel
Save