| @@ -175,7 +175,7 @@ FLUIDSYNTH_LIBS = $(shell pkg-config --libs fluidsynth) | |||||
| endif | endif | ||||
| ifeq ($(HAVE_LINUXSAMPLER),true) | ifeq ($(HAVE_LINUXSAMPLER),true) | ||||
| LINUXSAMPLER_FLAGS = $(shell pkg-config --cflags linuxsampler) | |||||
| LINUXSAMPLER_FLAGS = $(shell pkg-config --cflags linuxsampler) -Wno-unused-parameter | |||||
| LINUXSAMPLER_LIBS = $(shell pkg-config --libs linuxsampler) | LINUXSAMPLER_LIBS = $(shell pkg-config --libs linuxsampler) | ||||
| ifeq ($(WIN32),true) | ifeq ($(WIN32),true) | ||||
| LINUXSAMPLER_LIBS += -lrpcrt4 | LINUXSAMPLER_LIBS += -lrpcrt4 | ||||
| @@ -19,8 +19,8 @@ BUILD_CXX_FLAGS += $(QTXML_FLAGS) | |||||
| BUILD_CXX_FLAGS += -DWANT_NATIVE | BUILD_CXX_FLAGS += -DWANT_NATIVE | ||||
| ifeq ($(CARLA_PLUGIN_SUPPORT),true) | ifeq ($(CARLA_PLUGIN_SUPPORT),true) | ||||
| BUILD_CXX_FLAGS += -DWANT_LADSPA | |||||
| # -DWANT_DSSI -DWANT_LV2 -DWANT_VST | |||||
| BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 | |||||
| # -DWANT_VST | |||||
| # ifeq ($(CARLA_VESTIGE_HEADER),true) | # ifeq ($(CARLA_VESTIGE_HEADER),true) | ||||
| # BUILD_CXX_FLAGS += -DVESTIGE_HEADER | # BUILD_CXX_FLAGS += -DVESTIGE_HEADER | ||||
| # endif | # endif | ||||
| @@ -36,9 +36,9 @@ ifeq ($(HAVE_FLUIDSYNTH),true) | |||||
| BUILD_CXX_FLAGS += -DWANT_FLUIDSYNTH | BUILD_CXX_FLAGS += -DWANT_FLUIDSYNTH | ||||
| endif | endif | ||||
| # ifeq ($(HAVE_LINUXSAMPLER),true) | |||||
| # BUILD_CXX_FLAGS += -DWANT_LINUXSAMPLER | |||||
| # endif | |||||
| ifeq ($(HAVE_LINUXSAMPLER),true) | |||||
| BUILD_CXX_FLAGS += -DWANT_LINUXSAMPLER | |||||
| endif | |||||
| # -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
| @@ -368,9 +368,9 @@ void CarlaEngineProtectedData::processRackFull(float** const inBuf, const uint32 | |||||
| { | { | ||||
| bool first = true; | bool first = true; | ||||
| for (List<uint>::Itenerator it = rack->connectedIns[0].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedIns[0].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < inCount); | CARLA_SAFE_ASSERT_CONTINUE(port < inCount); | ||||
| if (first) | if (first) | ||||
| @@ -396,9 +396,9 @@ void CarlaEngineProtectedData::processRackFull(float** const inBuf, const uint32 | |||||
| { | { | ||||
| bool first = true; | bool first = true; | ||||
| for (List<uint>::Itenerator it = rack->connectedIns[1].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedIns[1].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < inCount); | CARLA_SAFE_ASSERT_CONTINUE(port < inCount); | ||||
| if (first) | if (first) | ||||
| @@ -425,9 +425,9 @@ void CarlaEngineProtectedData::processRackFull(float** const inBuf, const uint32 | |||||
| // connect output buffers | // connect output buffers | ||||
| if (rack->connectedOuts[0].count() != 0) | if (rack->connectedOuts[0].count() != 0) | ||||
| { | { | ||||
| for (List<uint>::Itenerator it = rack->connectedOuts[0].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedOuts[0].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < outCount); | CARLA_SAFE_ASSERT_CONTINUE(port < outCount); | ||||
| FLOAT_ADD(outBuf[port], rack->out[0], nframes); | FLOAT_ADD(outBuf[port], rack->out[0], nframes); | ||||
| @@ -436,9 +436,9 @@ void CarlaEngineProtectedData::processRackFull(float** const inBuf, const uint32 | |||||
| if (rack->connectedOuts[1].count() != 0) | if (rack->connectedOuts[1].count() != 0) | ||||
| { | { | ||||
| for (List<uint>::Itenerator it = rack->connectedOuts[1].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedOuts[1].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < outCount); | CARLA_SAFE_ASSERT_CONTINUE(port < outCount); | ||||
| FLOAT_ADD(outBuf[port], rack->out[1], nframes); | FLOAT_ADD(outBuf[port], rack->out[1], nframes); | ||||
| @@ -601,9 +601,8 @@ bool CarlaEngineEventPort::writeControlEvent(const uint32_t time, const uint8_t | |||||
| CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS, false); | CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS, false); | ||||
| CARLA_SAFE_ASSERT(value >= 0.0f && value <= 1.0f); | CARLA_SAFE_ASSERT(value >= 0.0f && value <= 1.0f); | ||||
| if (type == kEngineControlEventTypeParameter) | |||||
| { | |||||
| CARLA_ASSERT(! MIDI_IS_CONTROL_BANK_SELECT(param)); | |||||
| if (type == kEngineControlEventTypeParameter) { | |||||
| CARLA_SAFE_ASSERT(! MIDI_IS_CONTROL_BANK_SELECT(param)); | |||||
| } | } | ||||
| const float fixedValue(carla_fixValue<float>(0.0f, 1.0f, value)); | const float fixedValue(carla_fixValue<float>(0.0f, 1.0f, value)); | ||||
| @@ -1998,9 +1997,9 @@ bool CarlaEngine::patchbayDisconnect(const int connectionId) | |||||
| CARLA_SAFE_ASSERT_RETURN_ERR(rack->usedConnections.count() > 0, "No connections available"); | CARLA_SAFE_ASSERT_RETURN_ERR(rack->usedConnections.count() > 0, "No connections available"); | ||||
| for (List<ConnectionToId>::Itenerator it=rack->usedConnections.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<ConnectionToId>::Itenerator it=rack->usedConnections.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const ConnectionToId& connection(it.getConstValue()); | |||||
| const ConnectionToId& connection(it.getValue()); | |||||
| if (connection.id == connectionId) | if (connection.id == connectionId) | ||||
| { | { | ||||
| @@ -2019,7 +2018,7 @@ bool CarlaEngine::patchbayDisconnect(const int connectionId) | |||||
| } | } | ||||
| else if (targetPort >= RACK_PATCHBAY_GROUP_AUDIO_OUT*1000) | else if (targetPort >= RACK_PATCHBAY_GROUP_AUDIO_OUT*1000) | ||||
| { | { | ||||
| CARLA_ASSERT(carlaPort == RACK_PATCHBAY_PORT_AUDIO_OUT1 || carlaPort == RACK_PATCHBAY_PORT_AUDIO_OUT2); | |||||
| CARLA_SAFE_ASSERT_RETURN(carlaPort == RACK_PATCHBAY_PORT_AUDIO_OUT1 || carlaPort == RACK_PATCHBAY_PORT_AUDIO_OUT2, false); | |||||
| const int portId(targetPort-RACK_PATCHBAY_GROUP_AUDIO_OUT*1000); | const int portId(targetPort-RACK_PATCHBAY_GROUP_AUDIO_OUT*1000); | ||||
| @@ -2034,7 +2033,7 @@ bool CarlaEngine::patchbayDisconnect(const int connectionId) | |||||
| } | } | ||||
| else if (targetPort >= RACK_PATCHBAY_GROUP_AUDIO_IN*1000) | else if (targetPort >= RACK_PATCHBAY_GROUP_AUDIO_IN*1000) | ||||
| { | { | ||||
| CARLA_ASSERT(carlaPort == RACK_PATCHBAY_PORT_AUDIO_IN1 || carlaPort == RACK_PATCHBAY_PORT_AUDIO_IN2); | |||||
| CARLA_SAFE_ASSERT_RETURN(carlaPort == RACK_PATCHBAY_PORT_AUDIO_IN1 || carlaPort == RACK_PATCHBAY_PORT_AUDIO_IN2, false); | |||||
| const int portId(targetPort-RACK_PATCHBAY_GROUP_AUDIO_IN*1000); | const int portId(targetPort-RACK_PATCHBAY_GROUP_AUDIO_IN*1000); | ||||
| @@ -2049,7 +2048,7 @@ bool CarlaEngine::patchbayDisconnect(const int connectionId) | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| CARLA_ASSERT(false); | |||||
| CARLA_SAFE_ASSERT_RETURN(false, false); | |||||
| } | } | ||||
| callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, connection.id, connection.portOut, connection.portIn, 0.0f, nullptr); | callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, connection.id, connection.portOut, connection.portIn, 0.0f, nullptr); | ||||
| @@ -24,7 +24,7 @@ | |||||
| #include "CarlaPlugin.hpp" | #include "CarlaPlugin.hpp" | ||||
| #include "CarlaMutex.hpp" | #include "CarlaMutex.hpp" | ||||
| #include "List.hpp" | |||||
| #include "LinkedList.hpp" | |||||
| #ifdef HAVE_JUCE | #ifdef HAVE_JUCE | ||||
| # include "juce_audio_basics.h" | # include "juce_audio_basics.h" | ||||
| @@ -205,12 +205,12 @@ struct EngineRackBuffers { | |||||
| float* out[2]; | float* out[2]; | ||||
| // connections stuff | // connections stuff | ||||
| List<uint> connectedIns[2]; | |||||
| List<uint> connectedOuts[2]; | |||||
| LinkedList<uint> connectedIns[2]; | |||||
| LinkedList<uint> connectedOuts[2]; | |||||
| CarlaMutex connectLock; | CarlaMutex connectLock; | ||||
| int lastConnectionId; | int lastConnectionId; | ||||
| List<ConnectionToId> usedConnections; | |||||
| LinkedList<ConnectionToId> usedConnections; | |||||
| EngineRackBuffers(const uint32_t bufferSize) | EngineRackBuffers(const uint32_t bufferSize) | ||||
| : lastConnectionId(0) | : lastConnectionId(0) | ||||
| @@ -17,9 +17,7 @@ | |||||
| #include "CarlaEngineInternal.hpp" | #include "CarlaEngineInternal.hpp" | ||||
| #include "CarlaBackendUtils.hpp" | #include "CarlaBackendUtils.hpp" | ||||
| #include "CarlaMIDI.h" | |||||
| #include "List.hpp" | |||||
| #include "jackbridge/JackBridge.hpp" | #include "jackbridge/JackBridge.hpp" | ||||
| #include <cmath> | #include <cmath> | ||||
| @@ -251,9 +249,8 @@ public: | |||||
| CARLA_SAFE_ASSERT_RETURN(param < 0x5F, false); | CARLA_SAFE_ASSERT_RETURN(param < 0x5F, false); | ||||
| CARLA_SAFE_ASSERT(value >= 0.0f && value <= 1.0f); | CARLA_SAFE_ASSERT(value >= 0.0f && value <= 1.0f); | ||||
| if (type == kEngineControlEventTypeParameter) | |||||
| { | |||||
| CARLA_ASSERT(! MIDI_IS_CONTROL_BANK_SELECT(param)); | |||||
| if (type == kEngineControlEventTypeParameter) { | |||||
| CARLA_SAFE_ASSERT(! MIDI_IS_CONTROL_BANK_SELECT(param)); | |||||
| } | } | ||||
| uint8_t size = 0; | uint8_t size = 0; | ||||
| @@ -768,16 +765,10 @@ public: | |||||
| #ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
| const char* renamePlugin(const unsigned int id, const char* const newName) override | const char* renamePlugin(const unsigned int id, const char* const newName) override | ||||
| { | { | ||||
| CARLA_ASSERT(pData->curPluginCount > 0); | |||||
| CARLA_ASSERT(id < pData->curPluginCount); | |||||
| CARLA_ASSERT(pData->plugins != nullptr); | |||||
| CARLA_ASSERT(newName != nullptr); | |||||
| if (pData->plugins == nullptr) | |||||
| { | |||||
| setLastError("Critical error: no plugins are currently loaded!"); | |||||
| return nullptr; | |||||
| } | |||||
| CARLA_SAFE_ASSERT_RETURN(pData->curPluginCount > 0, nullptr); | |||||
| CARLA_SAFE_ASSERT_RETURN(id < pData->curPluginCount, nullptr); | |||||
| CARLA_SAFE_ASSERT_RETURN(pData->plugins != nullptr, nullptr); | |||||
| CARLA_SAFE_ASSERT_RETURN(newName != nullptr && newName[0] != '\0', nullptr); | |||||
| CarlaPlugin* const plugin(pData->plugins[id].plugin); | CarlaPlugin* const plugin(pData->plugins[id].plugin); | ||||
| @@ -787,12 +778,12 @@ public: | |||||
| return nullptr; | return nullptr; | ||||
| } | } | ||||
| CARLA_ASSERT(plugin->getId() == id); | |||||
| CARLA_SAFE_ASSERT(plugin->getId() == id); | |||||
| bool needsReinit = (pData->options.processMode == ENGINE_PROCESS_MODE_SINGLE_CLIENT); | bool needsReinit = (pData->options.processMode == ENGINE_PROCESS_MODE_SINGLE_CLIENT); | ||||
| const char* name = getUniquePluginName(newName); | const char* name = getUniquePluginName(newName); | ||||
| // TODO - use rename port if single-client | |||||
| // TODO - use rename port if single-client and JACK2 | |||||
| // JACK client rename | // JACK client rename | ||||
| if (pData->options.processMode == ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS) | if (pData->options.processMode == ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS) | ||||
| @@ -810,7 +801,7 @@ public: | |||||
| // we should not be able to do this, jack really needs to allow client rename | // we should not be able to do this, jack really needs to allow client rename | ||||
| needsReinit = true; | needsReinit = true; | ||||
| if (jack_client_t* jclient = jackbridge_client_open(name, JackNullOption, nullptr)) | |||||
| if (jack_client_t* const jclient = jackbridge_client_open(name, JackNullOption, nullptr)) | |||||
| { | { | ||||
| //const char* const iconName(plugin->getIconName()); | //const char* const iconName(plugin->getIconName()); | ||||
| //jackbridge_custom_publish_data(jclient, URI_CANVAS_ICON, iconName, std::strlen(iconName)+1); | //jackbridge_custom_publish_data(jclient, URI_CANVAS_ICON, iconName, std::strlen(iconName)+1); | ||||
| @@ -858,7 +849,7 @@ public: | |||||
| bool patchbayConnect(int portA, int portB) override | bool patchbayConnect(int portA, int portB) override | ||||
| { | { | ||||
| CARLA_ASSERT(fClient != nullptr); | |||||
| CARLA_SAFE_ASSERT_RETURN(fClient != nullptr, false); | |||||
| if (fClient == nullptr) | if (fClient == nullptr) | ||||
| { | { | ||||
| @@ -882,17 +873,11 @@ public: | |||||
| bool patchbayDisconnect(int connectionId) override | bool patchbayDisconnect(int connectionId) override | ||||
| { | { | ||||
| CARLA_ASSERT(fClient != nullptr); | |||||
| if (fClient == nullptr) | |||||
| { | |||||
| setLastError("Invalid JACK client"); | |||||
| return false; | |||||
| } | |||||
| CARLA_SAFE_ASSERT_RETURN(fClient != nullptr, false); | |||||
| for (List<ConnectionToId>::Itenerator it = fUsedConnections.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<ConnectionToId>::Itenerator it = fUsedConnections.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const ConnectionToId& connectionToId(it.getConstValue()); | |||||
| const ConnectionToId& connectionToId(it.getValue()); | |||||
| if (connectionToId.id == connectionId) | if (connectionToId.id == connectionId) | ||||
| { | { | ||||
| @@ -1238,16 +1223,9 @@ protected: | |||||
| const char* const portName(jackbridge_port_short_name(jackPort)); | const char* const portName(jackbridge_port_short_name(jackPort)); | ||||
| const char* const fullPortName(jackbridge_port_name(jackPort)); | const char* const fullPortName(jackbridge_port_name(jackPort)); | ||||
| CARLA_ASSERT(jackPort != nullptr); | |||||
| CARLA_ASSERT(portName != nullptr); | |||||
| CARLA_ASSERT(fullPortName != nullptr); | |||||
| if (jackPort == nullptr) | |||||
| return; | |||||
| if (portName == nullptr) | |||||
| return; | |||||
| if (fullPortName == nullptr) | |||||
| return; | |||||
| CARLA_SAFE_ASSERT_RETURN(jackPort != nullptr,); | |||||
| CARLA_SAFE_ASSERT_RETURN(portName != nullptr,); | |||||
| CARLA_SAFE_ASSERT_RETURN(fullPortName != nullptr,); | |||||
| CarlaString groupName(fullPortName); | CarlaString groupName(fullPortName); | ||||
| groupName.truncate(groupName.rfind(portName)-1); | groupName.truncate(groupName.rfind(portName)-1); | ||||
| @@ -1298,11 +1276,8 @@ protected: | |||||
| { | { | ||||
| const int portId(getPortId(fullPortName)); | const int portId(getPortId(fullPortName)); | ||||
| CARLA_ASSERT(groupId != -1); | |||||
| CARLA_ASSERT(portId != -1); | |||||
| if (groupId == -1 || portId == -1) | |||||
| return; | |||||
| CARLA_SAFE_ASSERT_RETURN(groupId != -1,); | |||||
| CARLA_SAFE_ASSERT_RETURN(portId != -1,); | |||||
| PortNameToId portNameId(groupId, portId, portName, fullPortName); | PortNameToId portNameId(groupId, portId, portName, fullPortName); | ||||
| fUsedPortNames.removeOne(portNameId); | fUsedPortNames.removeOne(portNameId); | ||||
| @@ -1318,19 +1293,10 @@ protected: | |||||
| const char* const fullPortNameA(jackbridge_port_name(jackPortA)); | const char* const fullPortNameA(jackbridge_port_name(jackPortA)); | ||||
| const char* const fullPortNameB(jackbridge_port_name(jackPortB)); | const char* const fullPortNameB(jackbridge_port_name(jackPortB)); | ||||
| CARLA_ASSERT(jackPortA != nullptr); | |||||
| CARLA_ASSERT(jackPortB != nullptr); | |||||
| CARLA_ASSERT(fullPortNameA != nullptr); | |||||
| CARLA_ASSERT(fullPortNameB != nullptr); | |||||
| if (jackPortA == nullptr) | |||||
| return; | |||||
| if (jackPortB == nullptr) | |||||
| return; | |||||
| if (fullPortNameA == nullptr) | |||||
| return; | |||||
| if (fullPortNameB == nullptr) | |||||
| return; | |||||
| CARLA_SAFE_ASSERT_RETURN(jackPortA != nullptr,); | |||||
| CARLA_SAFE_ASSERT_RETURN(jackPortB != nullptr,); | |||||
| CARLA_SAFE_ASSERT_RETURN(fullPortNameA != nullptr,); | |||||
| CARLA_SAFE_ASSERT_RETURN(fullPortNameB != nullptr,); | |||||
| const int portIdA(getPortId(fullPortNameA)); | const int portIdA(getPortId(fullPortNameA)); | ||||
| const int portIdB(getPortId(fullPortNameB)); | const int portIdB(getPortId(fullPortNameB)); | ||||
| @@ -1347,9 +1313,9 @@ protected: | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| for (List<ConnectionToId>::Itenerator it = fUsedConnections.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<ConnectionToId>::Itenerator it = fUsedConnections.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const ConnectionToId& connectionToId(it.getConstValue()); | |||||
| const ConnectionToId& connectionToId(it.getValue()); | |||||
| if (connectionToId.portOut == portIdA && connectionToId.portIn == portIdB) | if (connectionToId.portOut == portIdA && connectionToId.portIn == portIdB) | ||||
| { | { | ||||
| @@ -1363,7 +1329,7 @@ protected: | |||||
| void handleJackClientRenameCallback(const char* const oldName, const char* const newName) | void handleJackClientRenameCallback(const char* const oldName, const char* const newName) | ||||
| { | { | ||||
| for (List<GroupNameToId>::Itenerator it = fUsedGroupNames.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<GroupNameToId>::Itenerator it = fUsedGroupNames.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| GroupNameToId& groupNameToId(it.getValue()); | GroupNameToId& groupNameToId(it.getValue()); | ||||
| @@ -1381,31 +1347,23 @@ protected: | |||||
| jack_port_t* const jackPort(jackbridge_port_by_id(fClient, port)); | jack_port_t* const jackPort(jackbridge_port_by_id(fClient, port)); | ||||
| const char* const portName(jackbridge_port_short_name(jackPort)); | const char* const portName(jackbridge_port_short_name(jackPort)); | ||||
| CARLA_ASSERT(jackPort != nullptr); | |||||
| CARLA_ASSERT(portName != nullptr); | |||||
| if (jackPort == nullptr) | |||||
| return; | |||||
| if (portName == nullptr) | |||||
| return; | |||||
| CARLA_SAFE_ASSERT_RETURN(jackPort != nullptr,); | |||||
| CARLA_SAFE_ASSERT_RETURN(portName != nullptr,); | |||||
| CarlaString groupName(newName); | CarlaString groupName(newName); | ||||
| groupName.truncate(groupName.rfind(portName)-1); | groupName.truncate(groupName.rfind(portName)-1); | ||||
| const int groupId(getGroupId(groupName)); | const int groupId(getGroupId(groupName)); | ||||
| CARLA_ASSERT(groupId != -1); | |||||
| if (groupId == -1) | |||||
| return; | |||||
| CARLA_SAFE_ASSERT_RETURN(groupId != -1,); | |||||
| for (List<PortNameToId>::Itenerator it = fUsedPortNames.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<PortNameToId>::Itenerator it = fUsedPortNames.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| PortNameToId& portNameId(it.getValue()); | PortNameToId& portNameId(it.getValue()); | ||||
| if (std::strcmp(portNameId.fullName, oldName) == 0) | if (std::strcmp(portNameId.fullName, oldName) == 0) | ||||
| { | { | ||||
| CARLA_ASSERT(portNameId.groupId == groupId); | |||||
| CARLA_SAFE_ASSERT(portNameId.groupId == groupId); | |||||
| portNameId.rename(portName, newName); | portNameId.rename(portName, newName); | ||||
| callback(ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED, groupId, portNameId.portId, 0, 0.0f, newName); | callback(ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED, groupId, portNameId.portId, 0, 0.0f, newName); | ||||
| break; | break; | ||||
| @@ -1567,18 +1525,18 @@ private: | |||||
| int fLastPortId; | int fLastPortId; | ||||
| int fLastConnectionId; | int fLastConnectionId; | ||||
| List<GroupNameToId> fUsedGroupNames; | |||||
| List<PortNameToId> fUsedPortNames; | |||||
| List<ConnectionToId> fUsedConnections; | |||||
| //List<int> fGroupIconsChanged; | |||||
| LinkedList<GroupNameToId> fUsedGroupNames; | |||||
| LinkedList<PortNameToId> fUsedPortNames; | |||||
| LinkedList<ConnectionToId> fUsedConnections; | |||||
| //LinkedList<int> fGroupIconsChanged; | |||||
| int getGroupId(const char* const name) | int getGroupId(const char* const name) | ||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(name != nullptr, -1); | CARLA_SAFE_ASSERT_RETURN(name != nullptr, -1); | ||||
| for (List<GroupNameToId>::Itenerator it = fUsedGroupNames.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<GroupNameToId>::Itenerator it = fUsedGroupNames.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const GroupNameToId& groupNameId(it.getConstValue()); | |||||
| const GroupNameToId& groupNameId(it.getValue()); | |||||
| if (std::strcmp(groupNameId.name, name) == 0) | if (std::strcmp(groupNameId.name, name) == 0) | ||||
| return groupNameId.id; | return groupNameId.id; | ||||
| @@ -1593,9 +1551,9 @@ private: | |||||
| CARLA_SAFE_ASSERT_RETURN(groupId >= 0, fallback); | CARLA_SAFE_ASSERT_RETURN(groupId >= 0, fallback); | ||||
| for (List<GroupNameToId>::Itenerator it = fUsedGroupNames.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<GroupNameToId>::Itenerator it = fUsedGroupNames.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const GroupNameToId& groupNameId(it.getConstValue()); | |||||
| const GroupNameToId& groupNameId(it.getValue()); | |||||
| if (groupNameId.id == groupId) | if (groupNameId.id == groupId) | ||||
| return groupNameId.name; | return groupNameId.name; | ||||
| @@ -1608,9 +1566,9 @@ private: | |||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(fullName != nullptr, -1); | CARLA_SAFE_ASSERT_RETURN(fullName != nullptr, -1); | ||||
| for (List<PortNameToId>::Itenerator it = fUsedPortNames.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<PortNameToId>::Itenerator it = fUsedPortNames.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const PortNameToId& portNameId(it.getConstValue()); | |||||
| const PortNameToId& portNameId(it.getValue()); | |||||
| if (std::strcmp(portNameId.fullName, fullName) == 0) | if (std::strcmp(portNameId.fullName, fullName) == 0) | ||||
| return portNameId.portId; | return portNameId.portId; | ||||
| @@ -1621,9 +1579,9 @@ private: | |||||
| void getFullPortName(const int portId, char nameBuf[STR_MAX+1]) | void getFullPortName(const int portId, char nameBuf[STR_MAX+1]) | ||||
| { | { | ||||
| for (List<PortNameToId>::Itenerator it = fUsedPortNames.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<PortNameToId>::Itenerator it = fUsedPortNames.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const PortNameToId& portNameId(it.getConstValue()); | |||||
| const PortNameToId& portNameId(it.getValue()); | |||||
| if (portNameId.portId == portId) | if (portNameId.portId == portId) | ||||
| { | { | ||||
| @@ -1675,14 +1633,14 @@ private: | |||||
| CarlaString groupName(fullPortName); | CarlaString groupName(fullPortName); | ||||
| groupName.truncate(groupName.rfind(portName, &found)-1); | groupName.truncate(groupName.rfind(portName, &found)-1); | ||||
| CARLA_ASSERT(found); | |||||
| CARLA_SAFE_ASSERT(found); | |||||
| QString qGroupName((const char*)groupName); | QString qGroupName((const char*)groupName); | ||||
| if (parsedGroups.contains(qGroupName)) | if (parsedGroups.contains(qGroupName)) | ||||
| { | { | ||||
| groupId = getGroupId(groupName); | groupId = getGroupId(groupName); | ||||
| CARLA_ASSERT(groupId != -1); | |||||
| CARLA_SAFE_ASSERT(groupId != -1); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -22,7 +22,7 @@ | |||||
| #include "CarlaEngineInternal.hpp" | #include "CarlaEngineInternal.hpp" | ||||
| #include "CarlaBackendUtils.hpp" | #include "CarlaBackendUtils.hpp" | ||||
| // #include "RtList.hpp" | |||||
| // #include "RtLinkedList.hpp" | |||||
| #include "juce_audio_devices.h" | #include "juce_audio_devices.h" | ||||
| @@ -321,9 +321,9 @@ public: | |||||
| // Connections | // Connections | ||||
| rack->connectLock.lock(); | rack->connectLock.lock(); | ||||
| for (List<uint>::Itenerator it = rack->connectedIns[0].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedIns[0].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.inCount); | CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.inCount); | ||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| @@ -337,9 +337,9 @@ public: | |||||
| rack->lastConnectionId++; | rack->lastConnectionId++; | ||||
| } | } | ||||
| for (List<uint>::Itenerator it = rack->connectedIns[1].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedIns[1].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.inCount); | CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.inCount); | ||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| @@ -353,9 +353,9 @@ public: | |||||
| rack->lastConnectionId++; | rack->lastConnectionId++; | ||||
| } | } | ||||
| for (List<uint>::Itenerator it = rack->connectedOuts[0].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedOuts[0].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.outCount); | CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.outCount); | ||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| @@ -369,9 +369,9 @@ public: | |||||
| rack->lastConnectionId++; | rack->lastConnectionId++; | ||||
| } | } | ||||
| for (List<uint>::Itenerator it = rack->connectedOuts[1].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedOuts[1].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.outCount); | CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.outCount); | ||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| @@ -388,9 +388,9 @@ public: | |||||
| pData->bufAudio.rack->connectLock.unlock(); | pData->bufAudio.rack->connectLock.unlock(); | ||||
| #if 0 | #if 0 | ||||
| for (List<MidiPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<MidiPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const MidiPort& midiPort(it.getConstValue()); | |||||
| const MidiPort& midiPort(it.getValue()); | |||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| connectionToId.id = rack->lastConnectionId; | connectionToId.id = rack->lastConnectionId; | ||||
| @@ -403,9 +403,9 @@ public: | |||||
| rack->lastConnectionId++; | rack->lastConnectionId++; | ||||
| } | } | ||||
| for (List<MidiPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<MidiPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const MidiPort& midiPort(it.getConstValue()); | |||||
| const MidiPort& midiPort(it.getValue()); | |||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| connectionToId.id = rack->lastConnectionId; | connectionToId.id = rack->lastConnectionId; | ||||
| @@ -17,8 +17,8 @@ | |||||
| #include "CarlaEngineInternal.hpp" | #include "CarlaEngineInternal.hpp" | ||||
| #include "CarlaBackendUtils.hpp" | #include "CarlaBackendUtils.hpp" | ||||
| #include "CarlaMIDI.h" | |||||
| #include "RtList.hpp" | |||||
| #include "RtLinkedList.hpp" | |||||
| #include "rtaudio/RtAudio.h" | #include "rtaudio/RtAudio.h" | ||||
| #include "rtmidi/RtMidi.h" | #include "rtmidi/RtMidi.h" | ||||
| @@ -351,7 +351,7 @@ public: | |||||
| fDeviceName.clear(); | fDeviceName.clear(); | ||||
| for (List<MidiPort>::Itenerator it = fMidiIns.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<MidiPort>::Itenerator it = fMidiIns.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| MidiPort& port(it.getValue()); | MidiPort& port(it.getValue()); | ||||
| RtMidiIn* const midiInPort((RtMidiIn*)port.rtmidi); | RtMidiIn* const midiInPort((RtMidiIn*)port.rtmidi); | ||||
| @@ -360,7 +360,7 @@ public: | |||||
| delete midiInPort; | delete midiInPort; | ||||
| } | } | ||||
| for (List<MidiPort>::Itenerator it = fMidiOuts.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<MidiPort>::Itenerator it = fMidiOuts.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| MidiPort& port(it.getValue()); | MidiPort& port(it.getValue()); | ||||
| RtMidiOut* const midiOutPort((RtMidiOut*)port.rtmidi); | RtMidiOut* const midiOutPort((RtMidiOut*)port.rtmidi); | ||||
| @@ -499,9 +499,9 @@ public: | |||||
| // Connections | // Connections | ||||
| rack->connectLock.lock(); | rack->connectLock.lock(); | ||||
| for (List<uint>::Itenerator it = rack->connectedIns[0].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedIns[0].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.inCount); | CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.inCount); | ||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| @@ -515,9 +515,9 @@ public: | |||||
| rack->lastConnectionId++; | rack->lastConnectionId++; | ||||
| } | } | ||||
| for (List<uint>::Itenerator it = rack->connectedIns[1].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedIns[1].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.inCount); | CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.inCount); | ||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| @@ -531,9 +531,9 @@ public: | |||||
| rack->lastConnectionId++; | rack->lastConnectionId++; | ||||
| } | } | ||||
| for (List<uint>::Itenerator it = rack->connectedOuts[0].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedOuts[0].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.outCount); | CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.outCount); | ||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| @@ -547,9 +547,9 @@ public: | |||||
| rack->lastConnectionId++; | rack->lastConnectionId++; | ||||
| } | } | ||||
| for (List<uint>::Itenerator it = rack->connectedOuts[1].begin(); it.valid(); it.next()) | |||||
| for (LinkedList<uint>::Itenerator it = rack->connectedOuts[1].begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const uint& port(it.getConstValue()); | |||||
| const uint& port(it.getValue()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.outCount); | CARLA_SAFE_ASSERT_CONTINUE(port < pData->bufAudio.outCount); | ||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| @@ -565,9 +565,9 @@ public: | |||||
| pData->bufAudio.rack->connectLock.unlock(); | pData->bufAudio.rack->connectLock.unlock(); | ||||
| for (List<MidiPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<MidiPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const MidiPort& midiPort(it.getConstValue()); | |||||
| const MidiPort& midiPort(it.getValue()); | |||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| connectionToId.id = rack->lastConnectionId; | connectionToId.id = rack->lastConnectionId; | ||||
| @@ -580,9 +580,9 @@ public: | |||||
| rack->lastConnectionId++; | rack->lastConnectionId++; | ||||
| } | } | ||||
| for (List<MidiPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<MidiPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const MidiPort& midiPort(it.getConstValue()); | |||||
| const MidiPort& midiPort(it.getValue()); | |||||
| ConnectionToId connectionToId; | ConnectionToId connectionToId; | ||||
| connectionToId.id = rack->lastConnectionId; | connectionToId.id = rack->lastConnectionId; | ||||
| @@ -839,7 +839,7 @@ protected: | |||||
| CARLA_SAFE_ASSERT_RETURN(static_cast<size_t>(portId) < fUsedMidiIns.count(), false); | CARLA_SAFE_ASSERT_RETURN(static_cast<size_t>(portId) < fUsedMidiIns.count(), false); | ||||
| carla_debug("CarlaEngineRtAudio::connectRackMidiInPort(%i)", portId); | carla_debug("CarlaEngineRtAudio::connectRackMidiInPort(%i)", portId); | ||||
| for (List<MidiPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<MidiPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| MidiPort& midiPort(it.getValue()); | MidiPort& midiPort(it.getValue()); | ||||
| @@ -864,7 +864,7 @@ protected: | |||||
| CARLA_SAFE_ASSERT_RETURN(static_cast<size_t>(portId) < fUsedMidiOuts.count(), false); | CARLA_SAFE_ASSERT_RETURN(static_cast<size_t>(portId) < fUsedMidiOuts.count(), false); | ||||
| carla_debug("CarlaEngineRtAudio::disconnectRackMidiOutPort(%i)", portId); | carla_debug("CarlaEngineRtAudio::disconnectRackMidiOutPort(%i)", portId); | ||||
| for (List<MidiPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<MidiPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| MidiPort& midiPort(it.getValue()); | MidiPort& midiPort(it.getValue()); | ||||
| @@ -903,16 +903,16 @@ private: | |||||
| RtMidiIn fDummyMidiIn; | RtMidiIn fDummyMidiIn; | ||||
| RtMidiOut fDummyMidiOut; | RtMidiOut fDummyMidiOut; | ||||
| List<PortNameToId> fUsedMidiIns; | |||||
| List<PortNameToId> fUsedMidiOuts; | |||||
| LinkedList<PortNameToId> fUsedMidiIns; | |||||
| LinkedList<PortNameToId> fUsedMidiOuts; | |||||
| struct MidiPort { | struct MidiPort { | ||||
| RtMidi* rtmidi; | RtMidi* rtmidi; | ||||
| int portId; | int portId; | ||||
| }; | }; | ||||
| List<MidiPort> fMidiIns; | |||||
| List<MidiPort> fMidiOuts; | |||||
| LinkedList<MidiPort> fMidiIns; | |||||
| LinkedList<MidiPort> fMidiOuts; | |||||
| struct RtMidiEvent { | struct RtMidiEvent { | ||||
| uint64_t time; // needs to compare to internal time | uint64_t time; // needs to compare to internal time | ||||
| @@ -922,9 +922,9 @@ private: | |||||
| struct RtMidiEvents { | struct RtMidiEvents { | ||||
| CarlaMutex mutex; | CarlaMutex mutex; | ||||
| RtList<RtMidiEvent>::Pool dataPool; | |||||
| RtList<RtMidiEvent> data; | |||||
| RtList<RtMidiEvent> dataPending; | |||||
| RtLinkedList<RtMidiEvent>::Pool dataPool; | |||||
| RtLinkedList<RtMidiEvent> data; | |||||
| RtLinkedList<RtMidiEvent> dataPending; | |||||
| RtMidiEvents() | RtMidiEvents() | ||||
| : dataPool(512, 512), | : dataPool(512, 512), | ||||
| @@ -1050,7 +1050,7 @@ const char* const* CarlaEngine::getRtAudioApiDeviceNames(const unsigned int inde | |||||
| if (devCount == 0) | if (devCount == 0) | ||||
| return nullptr; | return nullptr; | ||||
| List<const char*> devNames; | |||||
| LinkedList<const char*> devNames; | |||||
| for (unsigned int i=0; i < devCount; ++i) | for (unsigned int i=0; i < devCount; ++i) | ||||
| { | { | ||||
| @@ -582,9 +582,9 @@ const SaveState& CarlaPlugin::getSaveState() | |||||
| // --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
| // Custom Data | // Custom Data | ||||
| for (List<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const CustomData& cData(it.getConstValue()); | |||||
| const CustomData& cData(it.getValue()); | |||||
| StateCustomData* stateCustomData(new StateCustomData()); | StateCustomData* stateCustomData(new StateCustomData()); | ||||
| @@ -609,9 +609,9 @@ void CarlaPlugin::loadSaveState(const SaveState& saveState) | |||||
| // --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
| // Part 1 - PRE-set custom data (only that which reload programs) | // Part 1 - PRE-set custom data (only that which reload programs) | ||||
| for (List<StateCustomData*>::Itenerator it = saveState.customData.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<StateCustomData*>::Itenerator it = saveState.customData.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const StateCustomData* const stateCustomData(it.getConstValue()); | |||||
| const StateCustomData* const stateCustomData(it.getValue()); | |||||
| const char* const key(stateCustomData->key); | const char* const key(stateCustomData->key); | ||||
| bool wantData = false; | bool wantData = false; | ||||
| @@ -667,7 +667,7 @@ void CarlaPlugin::loadSaveState(const SaveState& saveState) | |||||
| // --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
| // Part 4a - get plugin parameter symbols | // Part 4a - get plugin parameter symbols | ||||
| List<ParamSymbol*> paramSymbols; | |||||
| LinkedList<ParamSymbol*> paramSymbols; | |||||
| if (getType() == PLUGIN_LADSPA || getType() == PLUGIN_LV2) | if (getType() == PLUGIN_LADSPA || getType() == PLUGIN_LV2) | ||||
| { | { | ||||
| @@ -689,7 +689,7 @@ void CarlaPlugin::loadSaveState(const SaveState& saveState) | |||||
| const float sampleRate(static_cast<float>(pData->engine->getSampleRate())); | const float sampleRate(static_cast<float>(pData->engine->getSampleRate())); | ||||
| for (List<StateParameter*>::Itenerator it = saveState.parameters.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<StateParameter*>::Itenerator it = saveState.parameters.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| StateParameter* const stateParameter(it.getValue()); | StateParameter* const stateParameter(it.getValue()); | ||||
| @@ -700,7 +700,7 @@ void CarlaPlugin::loadSaveState(const SaveState& saveState) | |||||
| // Try to set by symbol, otherwise use index | // Try to set by symbol, otherwise use index | ||||
| if (stateParameter->symbol != nullptr && stateParameter->symbol[0] != '\0') | if (stateParameter->symbol != nullptr && stateParameter->symbol[0] != '\0') | ||||
| { | { | ||||
| for (List<ParamSymbol*>::Itenerator it = paramSymbols.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<ParamSymbol*>::Itenerator it = paramSymbols.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| ParamSymbol* const paramSymbol(it.getValue()); | ParamSymbol* const paramSymbol(it.getValue()); | ||||
| @@ -721,7 +721,7 @@ void CarlaPlugin::loadSaveState(const SaveState& saveState) | |||||
| // Symbol only | // Symbol only | ||||
| if (stateParameter->symbol != nullptr && stateParameter->symbol[0] != '\0') | if (stateParameter->symbol != nullptr && stateParameter->symbol[0] != '\0') | ||||
| { | { | ||||
| for (List<ParamSymbol*>::Itenerator it = paramSymbols.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<ParamSymbol*>::Itenerator it = paramSymbols.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| ParamSymbol* const paramSymbol(it.getValue()); | ParamSymbol* const paramSymbol(it.getValue()); | ||||
| @@ -762,7 +762,7 @@ void CarlaPlugin::loadSaveState(const SaveState& saveState) | |||||
| // --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
| // Part 4c - clear | // Part 4c - clear | ||||
| for (List<ParamSymbol*>::Itenerator it = paramSymbols.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<ParamSymbol*>::Itenerator it = paramSymbols.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| ParamSymbol* const paramSymbol(it.getValue()); | ParamSymbol* const paramSymbol(it.getValue()); | ||||
| delete paramSymbol; | delete paramSymbol; | ||||
| @@ -773,9 +773,9 @@ void CarlaPlugin::loadSaveState(const SaveState& saveState) | |||||
| // --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
| // Part 5 - set custom data | // Part 5 - set custom data | ||||
| for (List<StateCustomData*>::Itenerator it = saveState.customData.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<StateCustomData*>::Itenerator it = saveState.customData.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const StateCustomData* const stateCustomData(it.getConstValue()); | |||||
| const StateCustomData* const stateCustomData(it.getValue()); | |||||
| const char* const key(stateCustomData->key); | const char* const key(stateCustomData->key); | ||||
| if (getType() == PLUGIN_DSSI && (std::strcmp(key, "reloadprograms") == 0 || std::strcmp(key, "load") == 0 || std::strncmp(key, "patches", 7) == 0)) | if (getType() == PLUGIN_DSSI && (std::strcmp(key, "reloadprograms") == 0 || std::strcmp(key, "load") == 0 || std::strncmp(key, "patches", 7) == 0)) | ||||
| @@ -1226,7 +1226,7 @@ void CarlaPlugin::setCustomData(const char* const type, const char* const key, c | |||||
| return; | return; | ||||
| // Check if we already have this key | // Check if we already have this key | ||||
| for (List<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| CustomData& cData(it.getValue()); | CustomData& cData(it.getValue()); | ||||
| @@ -1682,9 +1682,9 @@ void CarlaPlugin::updateOscData(const lo_address& source, const char* const url) | |||||
| osc_send_sample_rate(pData->osc.data, static_cast<float>(pData->engine->getSampleRate())); | osc_send_sample_rate(pData->osc.data, static_cast<float>(pData->engine->getSampleRate())); | ||||
| for (List<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const CustomData& cData(it.getConstValue()); | |||||
| const CustomData& cData(it.getValue()); | |||||
| CARLA_ASSERT(cData.type != nullptr); | CARLA_ASSERT(cData.type != nullptr); | ||||
| CARLA_ASSERT(cData.key != nullptr); | CARLA_ASSERT(cData.key != nullptr); | ||||
| @@ -26,7 +26,7 @@ | |||||
| #include "CarlaOscUtils.hpp" | #include "CarlaOscUtils.hpp" | ||||
| #include "CarlaStateUtils.hpp" | #include "CarlaStateUtils.hpp" | ||||
| #include "CarlaMutex.hpp" | #include "CarlaMutex.hpp" | ||||
| #include "RtList.hpp" | |||||
| #include "RtLinkedList.hpp" | |||||
| #ifdef HAVE_JUCE | #ifdef HAVE_JUCE | ||||
| # include "juce_audio_basics.h" | # include "juce_audio_basics.h" | ||||
| @@ -532,7 +532,7 @@ struct CarlaPluginProtectedData { | |||||
| PluginParameterData param; | PluginParameterData param; | ||||
| PluginProgramData prog; | PluginProgramData prog; | ||||
| PluginMidiProgramData midiprog; | PluginMidiProgramData midiprog; | ||||
| List<CustomData> custom; | |||||
| LinkedList<CustomData> custom; | |||||
| SaveState saveState; | SaveState saveState; | ||||
| @@ -541,8 +541,8 @@ struct CarlaPluginProtectedData { | |||||
| struct ExternalNotes { | struct ExternalNotes { | ||||
| CarlaMutex mutex; | CarlaMutex mutex; | ||||
| RtList<ExternalMidiNote>::Pool dataPool; | |||||
| RtList<ExternalMidiNote> data; | |||||
| RtLinkedList<ExternalMidiNote>::Pool dataPool; | |||||
| RtLinkedList<ExternalMidiNote> data; | |||||
| ExternalNotes() | ExternalNotes() | ||||
| : dataPool(32, 152), | : dataPool(32, 152), | ||||
| @@ -568,9 +568,9 @@ struct CarlaPluginProtectedData { | |||||
| struct PostRtEvents { | struct PostRtEvents { | ||||
| CarlaMutex mutex; | CarlaMutex mutex; | ||||
| RtList<PluginPostRtEvent>::Pool dataPool; | |||||
| RtList<PluginPostRtEvent> data; | |||||
| RtList<PluginPostRtEvent> dataPendingRT; | |||||
| RtLinkedList<PluginPostRtEvent>::Pool dataPool; | |||||
| RtLinkedList<PluginPostRtEvent> data; | |||||
| RtLinkedList<PluginPostRtEvent> dataPendingRT; | |||||
| PostRtEvents() | PostRtEvents() | ||||
| : dataPool(128, 128), | : dataPool(128, 128), | ||||
| @@ -719,7 +719,7 @@ struct CarlaPluginProtectedData { | |||||
| client = nullptr; | client = nullptr; | ||||
| } | } | ||||
| for (List<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()); | ||||
| @@ -74,7 +74,7 @@ public: | |||||
| if (fDescriptor != nullptr) | if (fDescriptor != nullptr) | ||||
| { | { | ||||
| if (pData->name.isNotEmpty() && fDssiDescriptor != nullptr && fDssiDescriptor->run_synth == nullptr && fDssiDescriptor->run_multiple_synths != nullptr) | |||||
| if (pData->name != nullptr && fDssiDescriptor != nullptr && fDssiDescriptor->run_synth == nullptr && fDssiDescriptor->run_multiple_synths != nullptr) | |||||
| removeUniqueMultiSynth(fDescriptor->Label); | removeUniqueMultiSynth(fDescriptor->Label); | ||||
| if (fDescriptor->cleanup != nullptr) | if (fDescriptor->cleanup != nullptr) | ||||
| @@ -156,8 +156,13 @@ public: | |||||
| unsigned int getOptionsAvailable() const override | unsigned int getOptionsAvailable() const override | ||||
| { | { | ||||
| const bool isAmSynth = pData->filename.contains("amsynth", true); | |||||
| const bool isDssiVst = pData->filename.contains("dssi-vst", true); | |||||
| #ifdef __USE_GNU | |||||
| const bool isAmSynth(strcasestr(pData->filename, "amsynth")); | |||||
| const bool isDssiVst(strcasestr(pData->filename, "dssi-vst")); | |||||
| #else | |||||
| const bool isAmSynth(std::strstr(pData->filename, "amsynth")); | |||||
| const bool isDssiVst(std::strstr(pData->filename, "dssi-vst")); | |||||
| #endif | |||||
| unsigned int options = 0x0; | unsigned int options = 0x0; | ||||
| @@ -318,18 +323,12 @@ public: | |||||
| CARLA_SAFE_ASSERT_RETURN(fHandle2 == nullptr,); | CARLA_SAFE_ASSERT_RETURN(fHandle2 == nullptr,); | ||||
| CARLA_SAFE_ASSERT_RETURN(stringData != nullptr,); | CARLA_SAFE_ASSERT_RETURN(stringData != nullptr,); | ||||
| // TODO | |||||
| #if 0 | |||||
| QByteArray chunk(QByteArray::fromBase64(stringData)); | QByteArray chunk(QByteArray::fromBase64(stringData)); | ||||
| CARLA_ASSERT(chunk.size() > 0); | |||||
| CARLA_SAFE_ASSERT_RETURN(chunk.size() > 0,); | |||||
| if (chunk.size() > 0) | |||||
| { | |||||
| const ScopedSingleProcessLocker spl(this, true); | |||||
| fDssiDescriptor->set_custom_data(fHandle, chunk.data(), chunk.size()); | |||||
| } | |||||
| #endif | |||||
| const ScopedSingleProcessLocker spl(this, true); | |||||
| fDssiDescriptor->set_custom_data(fHandle, chunk.data(), chunk.size()); | |||||
| } | } | ||||
| void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override | void setMidiProgram(int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback) override | ||||
| @@ -483,10 +482,7 @@ public: | |||||
| pData->param.createNew(params); | pData->param.createNew(params); | ||||
| fParamBuffers = new float[params]; | fParamBuffers = new float[params]; | ||||
| #ifdef HAVE_JUCE | |||||
| FloatVectorOperations::clear(fParamBuffers, params); | |||||
| #else | |||||
| #endif | |||||
| FLOAT_CLEAR(fParamBuffers, params); | |||||
| } | } | ||||
| const uint portNameSize(pData->engine->getMaxPortNameSize()); | const uint portNameSize(pData->engine->getMaxPortNameSize()); | ||||
| @@ -615,7 +611,7 @@ public: | |||||
| if (LADSPA_IS_PORT_INPUT(portType)) | if (LADSPA_IS_PORT_INPUT(portType)) | ||||
| { | { | ||||
| pData->param.data[j].hints |= PARAMETER_IS_INPUT; | |||||
| pData->param.data[j].type = PARAMETER_INPUT; | |||||
| pData->param.data[j].hints |= PARAMETER_IS_ENABLED; | pData->param.data[j].hints |= PARAMETER_IS_ENABLED; | ||||
| pData->param.data[j].hints |= PARAMETER_IS_AUTOMABLE; | pData->param.data[j].hints |= PARAMETER_IS_AUTOMABLE; | ||||
| needsCtrlIn = true; | needsCtrlIn = true; | ||||
| @@ -643,8 +639,8 @@ public: | |||||
| stepSmall = 1.0f; | stepSmall = 1.0f; | ||||
| stepLarge = 1.0f; | stepLarge = 1.0f; | ||||
| //pData->param.data[j].type = PARAMETER_LATENCY; | |||||
| pData->param.data[j].hints = 0; | |||||
| pData->param.data[j].type = PARAMETER_SPECIAL; | |||||
| pData->param.data[j].hints = 0; // TODO PARAMETER_LATENCY | |||||
| } | } | ||||
| else if (std::strcmp(fDescriptor->PortNames[i], "_sample-rate") == 0) | else if (std::strcmp(fDescriptor->PortNames[i], "_sample-rate") == 0) | ||||
| { | { | ||||
| @@ -653,11 +649,12 @@ public: | |||||
| stepSmall = 1.0f; | stepSmall = 1.0f; | ||||
| stepLarge = 1.0f; | stepLarge = 1.0f; | ||||
| //pData->param.data[j].type = PARAMETER_SAMPLE_RATE; | |||||
| pData->param.data[j].hints = 0; | |||||
| pData->param.data[j].type = PARAMETER_SPECIAL; | |||||
| pData->param.data[j].hints = 0; // TODO PARAMETER_SAMPLE_RATE | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| pData->param.data[j].type = PARAMETER_OUTPUT; | |||||
| pData->param.data[j].hints |= PARAMETER_IS_ENABLED; | pData->param.data[j].hints |= PARAMETER_IS_ENABLED; | ||||
| pData->param.data[j].hints |= PARAMETER_IS_AUTOMABLE; | pData->param.data[j].hints |= PARAMETER_IS_AUTOMABLE; | ||||
| needsCtrlOut = true; | needsCtrlOut = true; | ||||
| @@ -665,6 +662,7 @@ public: | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| pData->param.data[j].type = PARAMETER_UNKNOWN; | |||||
| carla_stderr2("WARNING - Got a broken Port (Control, but not input or output)"); | carla_stderr2("WARNING - Got a broken Port (Control, but not input or output)"); | ||||
| } | } | ||||
| @@ -954,13 +952,7 @@ public: | |||||
| { | { | ||||
| // disable any output sound | // disable any output sound | ||||
| for (uint32_t i=0; i < pData->audioOut.count; ++i) | for (uint32_t i=0; i < pData->audioOut.count; ++i) | ||||
| { | |||||
| #ifdef HAVE_JUCE | |||||
| FloatVectorOperations::clear(outBuffer[i], frames); | |||||
| #else | |||||
| #endif | |||||
| } | |||||
| FLOAT_CLEAR(outBuffer[i], frames); | |||||
| return; | return; | ||||
| } | } | ||||
| @@ -1003,12 +995,7 @@ public: | |||||
| if (pData->latency > 0) | if (pData->latency > 0) | ||||
| { | { | ||||
| for (uint32_t i=0; i < pData->audioIn.count; ++i) | for (uint32_t i=0; i < pData->audioIn.count; ++i) | ||||
| { | |||||
| #ifdef HAVE_JUCE | |||||
| FloatVectorOperations::clear(pData->latencyBuffers[i], pData->latency); | |||||
| #else | |||||
| #endif | |||||
| } | |||||
| FLOAT_CLEAR(pData->latencyBuffers[i], pData->latency); | |||||
| } | } | ||||
| pData->needsReset = false; | pData->needsReset = false; | ||||
| @@ -1161,7 +1148,7 @@ public: | |||||
| continue; | continue; | ||||
| if (pData->param.data[k].midiCC != ctrlEvent.param) | if (pData->param.data[k].midiCC != ctrlEvent.param) | ||||
| continue; | continue; | ||||
| if ((pData->param.data[k].hints & PARAMETER_IS_INPUT) == 0) | |||||
| if (pData->param.data[k].type != PARAMETER_INPUT) | |||||
| continue; | continue; | ||||
| if ((pData->param.data[k].hints & PARAMETER_IS_AUTOMABLE) == 0) | if ((pData->param.data[k].hints & PARAMETER_IS_AUTOMABLE) == 0) | ||||
| continue; | continue; | ||||
| @@ -1197,7 +1184,7 @@ public: | |||||
| midiEvent.type = SND_SEQ_EVENT_CONTROLLER; | midiEvent.type = SND_SEQ_EVENT_CONTROLLER; | ||||
| midiEvent.data.control.channel = event.channel; | midiEvent.data.control.channel = event.channel; | ||||
| midiEvent.data.control.param = ctrlEvent.param; | midiEvent.data.control.param = ctrlEvent.param; | ||||
| midiEvent.data.control.value = ctrlEvent.value*127.0f; | |||||
| midiEvent.data.control.value = int8_t(ctrlEvent.value*127.0f); | |||||
| } | } | ||||
| break; | break; | ||||
| @@ -1283,7 +1270,7 @@ public: | |||||
| // Fix bad note-off (per DSSI spec) | // Fix bad note-off (per DSSI spec) | ||||
| if (MIDI_IS_STATUS_NOTE_ON(status) && engineEvent.data[2] == 0) | if (MIDI_IS_STATUS_NOTE_ON(status) && engineEvent.data[2] == 0) | ||||
| status -= 0x10; | |||||
| status = MIDI_STATUS_NOTE_OFF; | |||||
| snd_seq_event_t& midiEvent(fMidiEvents[midiEventCount]); | snd_seq_event_t& midiEvent(fMidiEvents[midiEventCount]); | ||||
| carla_zeroStruct<snd_seq_event_t>(midiEvent); | carla_zeroStruct<snd_seq_event_t>(midiEvent); | ||||
| @@ -1409,14 +1396,16 @@ public: | |||||
| for (uint32_t k=0; k < pData->param.count; ++k) | for (uint32_t k=0; k < pData->param.count; ++k) | ||||
| { | { | ||||
| if (pData->param.data[k].hints & PARAMETER_IS_INPUT) | |||||
| if (pData->param.data[k].type != PARAMETER_OUTPUT) | |||||
| continue; | continue; | ||||
| pData->param.ranges[k].fixValue(fParamBuffers[k]); | |||||
| if (pData->param.data[k].midiCC > 0) | if (pData->param.data[k].midiCC > 0) | ||||
| { | { | ||||
| channel = pData->param.data[k].midiChannel; | channel = pData->param.data[k].midiChannel; | ||||
| param = static_cast<uint16_t>(pData->param.data[k].midiCC); | param = static_cast<uint16_t>(pData->param.data[k].midiCC); | ||||
| value = pData->param.ranges[k].getFixedAndNormalizedValue(fParamBuffers[k]); | |||||
| value = pData->param.ranges[k].getNormalizedValue(fParamBuffers[k]); | |||||
| pData->event.portOut->writeControlEvent(0, channel, kEngineControlEventTypeParameter, param, value); | pData->event.portOut->writeControlEvent(0, channel, kEngineControlEventTypeParameter, param, value); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1459,20 +1448,10 @@ public: | |||||
| // Reset audio buffers | // Reset audio buffers | ||||
| for (uint32_t i=0; i < pData->audioIn.count; ++i) | for (uint32_t i=0; i < pData->audioIn.count; ++i) | ||||
| { | |||||
| #ifdef HAVE_JUCE | |||||
| FloatVectorOperations::copy(fAudioInBuffers[i], inBuffer[i]+timeOffset, frames); | |||||
| #else | |||||
| #endif | |||||
| } | |||||
| FLOAT_COPY(fAudioInBuffers[i], inBuffer[i]+timeOffset, frames); | |||||
| for (uint32_t i=0; i < pData->audioOut.count; ++i) | for (uint32_t i=0; i < pData->audioOut.count; ++i) | ||||
| { | |||||
| #ifdef HAVE_JUCE | |||||
| FloatVectorOperations::clear(fAudioOutBuffers[i], frames); | |||||
| #else | |||||
| #endif | |||||
| } | |||||
| FLOAT_CLEAR(fAudioOutBuffers[i], frames); | |||||
| // -------------------------------------------------------------------------------------------------------- | // -------------------------------------------------------------------------------------------------------- | ||||
| // Run plugin | // Run plugin | ||||
| @@ -1537,10 +1516,7 @@ public: | |||||
| if (isPair) | if (isPair) | ||||
| { | { | ||||
| CARLA_ASSERT(i+1 < pData->audioOut.count); | CARLA_ASSERT(i+1 < pData->audioOut.count); | ||||
| #ifdef HAVE_JUCE | |||||
| FloatVectorOperations::copy(oldBufLeft, fAudioOutBuffers[i], frames); | |||||
| #else | |||||
| #endif | |||||
| FLOAT_COPY(oldBufLeft, fAudioOutBuffers[i], frames); | |||||
| } | } | ||||
| float balRangeL = (pData->postProc.balanceLeft + 1.0f)/2.0f; | float balRangeL = (pData->postProc.balanceLeft + 1.0f)/2.0f; | ||||
| @@ -1655,7 +1631,7 @@ public: | |||||
| void sampleRateChanged(const double newSampleRate) override | void sampleRateChanged(const double newSampleRate) override | ||||
| { | { | ||||
| CARLA_ASSERT_INT(newSampleRate > 0.0, newSampleRate); | |||||
| CARLA_ASSERT_INT(newSampleRate > 0.0, (int)newSampleRate); | |||||
| carla_debug("DssiPlugin::sampleRateChanged(%g) - start", newSampleRate); | carla_debug("DssiPlugin::sampleRateChanged(%g) - start", newSampleRate); | ||||
| // TODO | // TODO | ||||
| @@ -1865,10 +1841,7 @@ public: | |||||
| else | else | ||||
| pData->name = pData->engine->getUniquePluginName(fDescriptor->Label); | pData->name = pData->engine->getUniquePluginName(fDescriptor->Label); | ||||
| pData->filename = filename; | |||||
| CARLA_ASSERT(pData->name.isNotEmpty()); | |||||
| CARLA_ASSERT(pData->filename.isNotEmpty()); | |||||
| pData->filename = carla_strdup(filename); | |||||
| // --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
| // register client | // register client | ||||
| @@ -1909,18 +1882,23 @@ public: | |||||
| // --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
| // gui stuff | // gui stuff | ||||
| //if (const char* const guiFilename = find_dssi_ui(filename, fDescriptor->Label)) | |||||
| if (const char* const guiFilename = find_dssi_ui(filename, fDescriptor->Label)) | |||||
| { | { | ||||
| //pData->osc.thread.setOscData(guiFilename, fDescriptor->Label); | |||||
| //fGuiFilename = guiFilename; | |||||
| pData->osc.thread.setOscData(guiFilename, fDescriptor->Label); | |||||
| fGuiFilename = guiFilename; | |||||
| } | } | ||||
| // --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
| // load plugin settings | // load plugin settings | ||||
| { | { | ||||
| const bool isAmSynth = pData->filename.contains("amsynth", true); | |||||
| const bool isDssiVst = pData->filename.contains("dssi-vst", true); | |||||
| #ifdef __USE_GNU | |||||
| const bool isAmSynth(strcasestr(pData->filename, "amsynth")); | |||||
| const bool isDssiVst(strcasestr(pData->filename, "dssi-vst")); | |||||
| #else | |||||
| const bool isAmSynth(std::strstr(pData->filename, "amsynth")); | |||||
| const bool isDssiVst(std::strstr(pData->filename, "dssi-vst")); | |||||
| #endif | |||||
| // set default options | // set default options | ||||
| pData->options = 0x0; | pData->options = 0x0; | ||||
| @@ -1947,11 +1925,19 @@ public: | |||||
| carla_stderr2("WARNING: Plugin can ONLY use run_multiple_synths!"); | carla_stderr2("WARNING: Plugin can ONLY use run_multiple_synths!"); | ||||
| } | } | ||||
| // set identifier string | |||||
| CarlaString identifier("DSSI/"); | |||||
| if (const char* const shortname = std::strrchr(filename, OS_SEP)) | |||||
| { | |||||
| identifier += shortname+1; | |||||
| identifier += ","; | |||||
| } | |||||
| identifier += label; | |||||
| pData->identifier = identifier.dup(); | |||||
| // load settings | // load settings | ||||
| pData->idStr = "DSSI/"; | |||||
| pData->idStr += std::strrchr(filename, OS_SEP)+1; | |||||
| pData->idStr += "/"; | |||||
| pData->idStr += label; | |||||
| pData->options = pData->loadSettings(pData->options, getOptionsAvailable()); | pData->options = pData->loadSettings(pData->options, getOptionsAvailable()); | ||||
| // ignore settings, we need this anyway | // ignore settings, we need this anyway | ||||
| @@ -1976,15 +1962,15 @@ private: | |||||
| float* fParamBuffers; | float* fParamBuffers; | ||||
| snd_seq_event_t fMidiEvents[kPluginMaxMidiEvents]; | snd_seq_event_t fMidiEvents[kPluginMaxMidiEvents]; | ||||
| static List<const char*> sMultiSynthList; | |||||
| static LinkedList<const char*> sMultiSynthList; | |||||
| static bool addUniqueMultiSynth(const char* const label) | static bool addUniqueMultiSynth(const char* const label) | ||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(label != nullptr, true); | CARLA_SAFE_ASSERT_RETURN(label != nullptr, true); | ||||
| for (List<const char*>::Itenerator it = sMultiSynthList.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<const char*>::Itenerator it = sMultiSynthList.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const char*& itLabel(*it); | |||||
| const char*& itLabel(it.getValue()); | |||||
| if (std::strcmp(label, itLabel) == 0) | if (std::strcmp(label, itLabel) == 0) | ||||
| return false; | return false; | ||||
| @@ -1998,9 +1984,9 @@ private: | |||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(label != nullptr,); | CARLA_SAFE_ASSERT_RETURN(label != nullptr,); | ||||
| for (List<const char*>::Itenerator it = sMultiSynthList.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<const char*>::Itenerator it = sMultiSynthList.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const char*& itLabel(*it); | |||||
| const char*& itLabel(it.getValue()); | |||||
| if (std::strcmp(label, itLabel) == 0) | if (std::strcmp(label, itLabel) == 0) | ||||
| { | { | ||||
| @@ -2014,7 +2000,7 @@ private: | |||||
| CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DssiPlugin) | CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DssiPlugin) | ||||
| }; | }; | ||||
| List<const char*> DssiPlugin::sMultiSynthList; | |||||
| LinkedList<const char*> DssiPlugin::sMultiSynthList; | |||||
| CARLA_BACKEND_END_NAMESPACE | CARLA_BACKEND_END_NAMESPACE | ||||
| @@ -1130,21 +1130,21 @@ public: | |||||
| { | { | ||||
| float value; | float value; | ||||
| if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_DRYWET) > 0) | |||||
| if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_DRYWET) != 0) | |||||
| { | { | ||||
| value = ctrlEvent.value; | value = ctrlEvent.value; | ||||
| setDryWet(value, false, false); | setDryWet(value, false, false); | ||||
| pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | ||||
| } | } | ||||
| if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_VOLUME) > 0) | |||||
| if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_VOLUME) != 0) | |||||
| { | { | ||||
| value = ctrlEvent.value*127.0f/100.0f; | value = ctrlEvent.value*127.0f/100.0f; | ||||
| setVolume(value, false, false); | setVolume(value, false, false); | ||||
| pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | ||||
| } | } | ||||
| if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_BALANCE) > 0) | |||||
| if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_BALANCE) != 0) | |||||
| { | { | ||||
| float left, right; | float left, right; | ||||
| value = ctrlEvent.value/0.5f - 1.0f; | value = ctrlEvent.value/0.5f - 1.0f; | ||||
| @@ -1613,7 +1613,12 @@ public: | |||||
| // set identifier string | // set identifier string | ||||
| CarlaString identifier("SF2/"); | CarlaString identifier("SF2/"); | ||||
| identifier += label; | |||||
| if (const char* const shortname = std::strrchr(filename, OS_SEP)) | |||||
| identifier += shortname+1; | |||||
| else | |||||
| identifier += label; | |||||
| pData->identifier = identifier.dup(); | pData->identifier = identifier.dup(); | ||||
| // load settings | // load settings | ||||
| @@ -915,7 +915,7 @@ public: | |||||
| case kEngineEventTypeControl: | case kEngineEventTypeControl: | ||||
| { | { | ||||
| const EngineControlEvent& ctrlEvent = event.ctrl; | |||||
| const EngineControlEvent& ctrlEvent(event.ctrl); | |||||
| switch (ctrlEvent.type) | switch (ctrlEvent.type) | ||||
| { | { | ||||
| @@ -930,21 +930,21 @@ public: | |||||
| { | { | ||||
| float value; | float value; | ||||
| if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_DRYWET) > 0) | |||||
| if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_DRYWET) != 0) | |||||
| { | { | ||||
| value = ctrlEvent.value; | value = ctrlEvent.value; | ||||
| setDryWet(value, false, false); | setDryWet(value, false, false); | ||||
| pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | ||||
| } | } | ||||
| if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_VOLUME) > 0) | |||||
| if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_VOLUME) != 0) | |||||
| { | { | ||||
| value = ctrlEvent.value*127.0f/100.0f; | value = ctrlEvent.value*127.0f/100.0f; | ||||
| setVolume(value, false, false); | setVolume(value, false, false); | ||||
| pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | ||||
| } | } | ||||
| if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_BALANCE) > 0) | |||||
| if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_BALANCE) != 0) | |||||
| { | { | ||||
| float left, right; | float left, right; | ||||
| value = ctrlEvent.value/0.5f - 1.0f; | value = ctrlEvent.value/0.5f - 1.0f; | ||||
| @@ -71,7 +71,7 @@ public: | |||||
| uint SampleRate() override | uint SampleRate() override | ||||
| { | { | ||||
| return fEngine->getSampleRate(); | |||||
| return (uint)fEngine->getSampleRate(); | |||||
| } | } | ||||
| String Driver() override | String Driver() override | ||||
| @@ -126,7 +126,7 @@ public: | |||||
| MidiInputPort* CreateMidiPort() override | MidiInputPort* CreateMidiPort() override | ||||
| { | { | ||||
| return new MidiInputPortPlugin(this, Ports.size()); | |||||
| return new MidiInputPortPlugin(this, (int)Ports.size()); | |||||
| } | } | ||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| @@ -163,7 +163,7 @@ CARLA_BACKEND_START_NAMESPACE | |||||
| class LinuxSamplerPlugin : public CarlaPlugin | class LinuxSamplerPlugin : public CarlaPlugin | ||||
| { | { | ||||
| public: | public: | ||||
| LinuxSamplerPlugin(CarlaEngine* const engine, const unsigned short id, const bool isGIG, const bool use16Outs) | |||||
| LinuxSamplerPlugin(CarlaEngine* const engine, const unsigned int id, const bool isGIG, const bool use16Outs) | |||||
| : CarlaPlugin(engine, id), | : CarlaPlugin(engine, id), | ||||
| kIsGIG(isGIG), | kIsGIG(isGIG), | ||||
| kUses16Outs(use16Outs), | kUses16Outs(use16Outs), | ||||
| @@ -434,13 +434,10 @@ public: | |||||
| pData->midiprog.clear(); | pData->midiprog.clear(); | ||||
| // Query new programs | // Query new programs | ||||
| uint32_t i, count = fInstrumentIds.size(); | |||||
| uint32_t i, count = (uint32_t)fInstrumentIds.size(); | |||||
| // sound kits must always have at least 1 midi-program | // sound kits must always have at least 1 midi-program | ||||
| CARLA_ASSERT(count > 0); | |||||
| if (count == 0) | |||||
| return; | |||||
| CARLA_SAFE_ASSERT_RETURN(count > 0,); | |||||
| pData->midiprog.createNew(count); | pData->midiprog.createNew(count); | ||||
| @@ -536,8 +533,8 @@ public: | |||||
| } | } | ||||
| else if (pData->ctrlChannel >= 0 && pData->ctrlChannel < MAX_MIDI_CHANNELS) | else if (pData->ctrlChannel >= 0 && pData->ctrlChannel < MAX_MIDI_CHANNELS) | ||||
| { | { | ||||
| for (k=0; k < MAX_MIDI_NOTE; ++k) | |||||
| fMidiInputPort->DispatchNoteOff(k, 0, pData->ctrlChannel); | |||||
| for (uint8_t i=0; i < MAX_MIDI_NOTE; ++i) | |||||
| fMidiInputPort->DispatchNoteOff(i, 0, (uint)pData->ctrlChannel); | |||||
| } | } | ||||
| pData->needsReset = false; | pData->needsReset = false; | ||||
| @@ -632,21 +629,21 @@ public: | |||||
| { | { | ||||
| float value; | float value; | ||||
| if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_DRYWET) > 0) | |||||
| if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_DRYWET) != 0) | |||||
| { | { | ||||
| value = ctrlEvent.value; | value = ctrlEvent.value; | ||||
| setDryWet(value, false, false); | setDryWet(value, false, false); | ||||
| pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | ||||
| } | } | ||||
| if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_VOLUME) > 0) | |||||
| if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_VOLUME) != 0) | |||||
| { | { | ||||
| value = ctrlEvent.value*127.0f/100.0f; | value = ctrlEvent.value*127.0f/100.0f; | ||||
| setVolume(value, false, false); | setVolume(value, false, false); | ||||
| pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | pData->postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | ||||
| } | } | ||||
| if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_BALANCE) > 0) | |||||
| if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (pData->hints & PLUGIN_CAN_BALANCE) != 0) | |||||
| { | { | ||||
| float left, right; | float left, right; | ||||
| value = ctrlEvent.value/0.5f - 1.0f; | value = ctrlEvent.value/0.5f - 1.0f; | ||||
| @@ -682,12 +679,12 @@ public: | |||||
| continue; | continue; | ||||
| if (pData->param.data[k].midiCC != ctrlEvent.param) | if (pData->param.data[k].midiCC != ctrlEvent.param) | ||||
| continue; | continue; | ||||
| if ((pData->param.data[k].hints & PARAMETER_IS_INPUT) == 0) | |||||
| if (pData->param.data[k].hints != PARAMETER_INPUT) | |||||
| continue; | continue; | ||||
| if ((pData->param.data[k].hints & PARAMETER_IS_AUTOMABLE) == 0) | if ((pData->param.data[k].hints & PARAMETER_IS_AUTOMABLE) == 0) | ||||
| continue; | continue; | ||||
| double value; | |||||
| float value; | |||||
| if (pData->param.data[k].hints & PARAMETER_IS_BOOLEAN) | if (pData->param.data[k].hints & PARAMETER_IS_BOOLEAN) | ||||
| { | { | ||||
| @@ -707,7 +704,7 @@ public: | |||||
| if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param <= 0x5F) | if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param <= 0x5F) | ||||
| { | { | ||||
| fMidiInputPort->DispatchControlChange(ctrlEvent.param, ctrlEvent.value*127.0f, event.channel, sampleAccurate ? startTime : time); | |||||
| fMidiInputPort->DispatchControlChange(uint8_t(ctrlEvent.param), uint8_t(ctrlEvent.value*127.0f), event.channel, int32_t(sampleAccurate ? startTime : time)); | |||||
| } | } | ||||
| break; | break; | ||||
| @@ -768,7 +765,7 @@ public: | |||||
| // Fix bad note-off (per DSSI spec) | // Fix bad note-off (per DSSI spec) | ||||
| if (MIDI_IS_STATUS_NOTE_ON(status) && midiEvent.data[2] == 0) | if (MIDI_IS_STATUS_NOTE_ON(status) && midiEvent.data[2] == 0) | ||||
| status -= 0x10; | |||||
| status = MIDI_STATUS_NOTE_OFF; | |||||
| int32_t fragmentPos = sampleAccurate ? startTime : time; | int32_t fragmentPos = sampleAccurate ? startTime : time; | ||||
| @@ -1100,10 +1097,17 @@ public: | |||||
| pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; | ||||
| pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; | ||||
| // set identifier string | |||||
| CarlaString identifier(kIsGIG ? "GIG/" : "SFZ/"); | |||||
| if (const char* const shortname = std::strrchr(filename, OS_SEP)) | |||||
| identifier += shortname+1; | |||||
| else | |||||
| identifier += label; | |||||
| pData->identifier = identifier.dup(); | |||||
| // load settings | // load settings | ||||
| pData->idStr = kIsGIG ? "GIG" : "SFZ"; | |||||
| pData->idStr += "/"; | |||||
| pData->idStr += label; | |||||
| pData->options = pData->loadSettings(pData->options, getOptionsAvailable()); | pData->options = pData->loadSettings(pData->options, getOptionsAvailable()); | ||||
| } | } | ||||
| @@ -141,6 +141,7 @@ enum Lv2PluginGuiType { | |||||
| PLUGIN_UI_EXTERNAL | PLUGIN_UI_EXTERNAL | ||||
| }; | }; | ||||
| #if 0 | |||||
| struct Lv2EventData { | struct Lv2EventData { | ||||
| uint32_t type; | uint32_t type; | ||||
| uint32_t rindex; | uint32_t rindex; | ||||
| @@ -5408,6 +5409,7 @@ private: | |||||
| }; | }; | ||||
| // ------------------------------------------------------------------------------------------------------------------- | // ------------------------------------------------------------------------------------------------------------------- | ||||
| #endif | |||||
| #define lv2PluginPtr ((Lv2Plugin*)plugin) | #define lv2PluginPtr ((Lv2Plugin*)plugin) | ||||
| @@ -5417,7 +5419,7 @@ int CarlaEngineOsc::handleMsgLv2AtomTransfer(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||||
| carla_debug("CarlaOsc::handleMsgLv2AtomTransfer()"); | carla_debug("CarlaOsc::handleMsgLv2AtomTransfer()"); | ||||
| const int32_t portIndex = argv[0]->i; | const int32_t portIndex = argv[0]->i; | ||||
| const char* const atomBuf = (const char*)&argv[1]->s; | |||||
| //const char* const atomBuf = (const char*)&argv[1]->s; | |||||
| if (portIndex < 0) | if (portIndex < 0) | ||||
| return 0; | return 0; | ||||
| @@ -5428,6 +5430,9 @@ int CarlaEngineOsc::handleMsgLv2AtomTransfer(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||||
| // LV2_Atom* const atom = (LV2_Atom*)chunk.data(); | // LV2_Atom* const atom = (LV2_Atom*)chunk.data(); | ||||
| // lv2PluginPtr->handleTransferAtom(portIndex, atom); | // lv2PluginPtr->handleTransferAtom(portIndex, atom); | ||||
| return 0; | return 0; | ||||
| // unused for now | |||||
| (void)plugin; | |||||
| } | } | ||||
| int CarlaEngineOsc::handleMsgLv2UridMap(CARLA_ENGINE_OSC_HANDLE_ARGS2) | int CarlaEngineOsc::handleMsgLv2UridMap(CARLA_ENGINE_OSC_HANDLE_ARGS2) | ||||
| @@ -5436,13 +5441,16 @@ int CarlaEngineOsc::handleMsgLv2UridMap(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||||
| carla_debug("CarlaOsc::handleMsgLv2EventTransfer()"); | carla_debug("CarlaOsc::handleMsgLv2EventTransfer()"); | ||||
| const int32_t urid = argv[0]->i; | const int32_t urid = argv[0]->i; | ||||
| const char* const uri = (const char*)&argv[1]->s; | |||||
| //const char* const uri = (const char*)&argv[1]->s; | |||||
| if (urid <= 0) | if (urid <= 0) | ||||
| return 0; | return 0; | ||||
| lv2PluginPtr->handleUridMap(urid, uri); | |||||
| //lv2PluginPtr->handleUridMap(urid, uri); | |||||
| return 0; | return 0; | ||||
| // unused for now | |||||
| (void)plugin; | |||||
| } | } | ||||
| #undef lv2PluginPtr | #undef lv2PluginPtr | ||||
| @@ -5457,7 +5465,7 @@ CarlaPlugin* CarlaPlugin::newLV2(const Initializer& init) | |||||
| { | { | ||||
| carla_debug("CarlaPlugin::newLV2({%p, \"%s\", \"%s\"})", init.engine, init.name, init.label); | carla_debug("CarlaPlugin::newLV2({%p, \"%s\", \"%s\"})", init.engine, init.name, init.label); | ||||
| #ifdef WANT_LV2 | |||||
| #if 0 //def WANT_LV2 | |||||
| Lv2Plugin* const plugin(new Lv2Plugin(init.engine, init.id)); | Lv2Plugin* const plugin(new Lv2Plugin(init.engine, init.id)); | ||||
| if (! plugin->init(init.name, init.label)) | if (! plugin->init(init.name, init.label)) | ||||
| @@ -643,9 +643,9 @@ public: | |||||
| if (fDescriptor->ui_set_custom_data != nullptr) | if (fDescriptor->ui_set_custom_data != nullptr) | ||||
| { | { | ||||
| for (List<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const CustomData& cData(it.getConstValue()); | |||||
| const CustomData& cData(it.getValue()); | |||||
| if (std::strcmp(cData.type, CUSTOM_DATA_TYPE_STRING) == 0 && std::strcmp(cData.key, "midiPrograms") != 0) | if (std::strcmp(cData.type, CUSTOM_DATA_TYPE_STRING) == 0 && std::strcmp(cData.key, "midiPrograms") != 0) | ||||
| fDescriptor->ui_set_custom_data(fHandle, cData.key, cData.value); | fDescriptor->ui_set_custom_data(fHandle, cData.key, cData.value); | ||||
| @@ -2196,9 +2196,9 @@ public: | |||||
| // --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
| // get descriptor that matches label | // get descriptor that matches label | ||||
| for (List<const NativePluginDescriptor*>::Itenerator it = sPluginDescriptors.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = sPluginDescriptors.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| fDescriptor = it.getConstValue(); | |||||
| fDescriptor = it.getValue(); | |||||
| CARLA_SAFE_ASSERT_BREAK(fDescriptor != nullptr); | CARLA_SAFE_ASSERT_BREAK(fDescriptor != nullptr); | ||||
| @@ -2357,7 +2357,7 @@ private: | |||||
| NativeTimeInfo fTimeInfo; | NativeTimeInfo fTimeInfo; | ||||
| static List<const NativePluginDescriptor*> sPluginDescriptors; | |||||
| static LinkedList<const NativePluginDescriptor*> sPluginDescriptors; | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| @@ -2423,7 +2423,7 @@ private: | |||||
| CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(NativePlugin) | CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(NativePlugin) | ||||
| }; | }; | ||||
| List<const NativePluginDescriptor*> NativePlugin::sPluginDescriptors; | |||||
| LinkedList<const NativePluginDescriptor*> NativePlugin::sPluginDescriptors; | |||||
| static const NativePlugin::ScopedInitializer _si; | static const NativePlugin::ScopedInitializer _si; | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "CarlaMIDI.h" | #include "CarlaMIDI.h" | ||||
| #include "CarlaMutex.hpp" | #include "CarlaMutex.hpp" | ||||
| #include "List.hpp" | |||||
| #include "LinkedList.hpp" | |||||
| #define MAX_EVENT_DATA_SIZE 4 | #define MAX_EVENT_DATA_SIZE 4 | ||||
| #define MIN_PREALLOCATED_EVENT_COUNT 100 | #define MIN_PREALLOCATED_EVENT_COUNT 100 | ||||
| @@ -59,7 +59,7 @@ public: | |||||
| ~MidiPattern() | ~MidiPattern() | ||||
| { | { | ||||
| fData.clear_const(); | |||||
| fData.clear(); | |||||
| } | } | ||||
| void addControl(const uint64_t time, const uint8_t channel, const uint8_t control, const uint8_t value) | void addControl(const uint64_t time, const uint8_t channel, const uint8_t control, const uint8_t value) | ||||
| @@ -174,9 +174,9 @@ public: | |||||
| if (! fMutex.tryLock()) | if (! fMutex.tryLock()) | ||||
| return; | return; | ||||
| for (List<const RawMidiEvent*>::Itenerator it = fData.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const RawMidiEvent* const rawMidiEvent(it.getConstValue()); | |||||
| const RawMidiEvent* const rawMidiEvent(it.getValue()); | |||||
| if (timePosFrame > rawMidiEvent->time) | if (timePosFrame > rawMidiEvent->time) | ||||
| continue; | continue; | ||||
| @@ -192,7 +192,7 @@ public: | |||||
| void clear() | void clear() | ||||
| { | { | ||||
| const CarlaMutex::ScopedLocker sl(fMutex); | const CarlaMutex::ScopedLocker sl(fMutex); | ||||
| fData.clear_const(); | |||||
| fData.clear(); | |||||
| } | } | ||||
| private: | private: | ||||
| @@ -202,7 +202,7 @@ private: | |||||
| uint32_t fDuration; // unused | uint32_t fDuration; // unused | ||||
| CarlaMutex fMutex; | CarlaMutex fMutex; | ||||
| List<const RawMidiEvent*> fData; | |||||
| LinkedList<const RawMidiEvent*> fData; | |||||
| void append(const RawMidiEvent* const event) | void append(const RawMidiEvent* const event) | ||||
| { | { | ||||
| @@ -213,9 +213,9 @@ private: | |||||
| return; | return; | ||||
| } | } | ||||
| for (List<const RawMidiEvent*>::Itenerator it = fData.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const RawMidiEvent* const oldEvent(it.getConstValue()); | |||||
| const RawMidiEvent* const oldEvent(it.getValue()); | |||||
| if (event->time >= oldEvent->time) | if (event->time >= oldEvent->time) | ||||
| continue; | continue; | ||||
| @@ -22,7 +22,7 @@ | |||||
| #include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
| #include "CarlaMIDI.h" | #include "CarlaMIDI.h" | ||||
| #include "CarlaThread.hpp" | #include "CarlaThread.hpp" | ||||
| #include "List.hpp" | |||||
| #include "LinkedList.hpp" | |||||
| #include "zynaddsubfx/DSP/FFTwrapper.h" | #include "zynaddsubfx/DSP/FFTwrapper.h" | ||||
| #include "zynaddsubfx/Misc/Master.h" | #include "zynaddsubfx/Misc/Master.h" | ||||
| @@ -92,7 +92,7 @@ public: | |||||
| for (auto it = fPrograms.begin(); it.valid(); it.next()) | for (auto it = fPrograms.begin(); it.valid(); it.next()) | ||||
| { | { | ||||
| const ProgramInfo* const& pInfo(it.getConstValue()); | |||||
| const ProgramInfo* const& pInfo(it.getValue()); | |||||
| delete pInfo; | delete pInfo; | ||||
| } | } | ||||
| @@ -219,7 +219,7 @@ private: | |||||
| bool fInitiated; | bool fInitiated; | ||||
| NativeMidiProgram fRetProgram; | NativeMidiProgram fRetProgram; | ||||
| List<const ProgramInfo*> fPrograms; | |||||
| LinkedList<const ProgramInfo*> fPrograms; | |||||
| CARLA_DECLARE_NON_COPY_CLASS(ZynAddSubFxPrograms) | CARLA_DECLARE_NON_COPY_CLASS(ZynAddSubFxPrograms) | ||||
| }; | }; | ||||
| @@ -46,12 +46,9 @@ ifeq ($(HAVE_FLUIDSYNTH),true) | |||||
| LINK_FLAGS += $(FLUIDSYNTH_LIBS) | LINK_FLAGS += $(FLUIDSYNTH_LIBS) | ||||
| endif | endif | ||||
| # ifeq ($(HAVE_LINUXSAMPLER),true) | |||||
| # LINK_FLAGS += $(shell pkg-config --libs linuxsampler) | |||||
| # ifeq ($(WIN32),true) | |||||
| # LINK_FLAGS += lrpcrt4 | |||||
| # endif | |||||
| # endif | |||||
| ifeq ($(HAVE_LINUXSAMPLER),true) | |||||
| LINK_FLAGS += $(LINUXSAMPLER_LIBS) | |||||
| endif | |||||
| # -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
| # Coomon | # Coomon | ||||
| @@ -21,12 +21,7 @@ | |||||
| #include "CarlaNative.h" | #include "CarlaNative.h" | ||||
| #include "CarlaBackendUtils.hpp" | #include "CarlaBackendUtils.hpp" | ||||
| #include "List.hpp" | |||||
| // TODO: remove | |||||
| #ifndef CARLA_NATIVE_PLUGIN_LV2 | |||||
| # define CARLA_NATIVE_PLUGIN_LV2 | |||||
| #endif | |||||
| #include "LinkedList.hpp" | |||||
| #ifdef CARLA_NATIVE_PLUGIN_LV2 | #ifdef CARLA_NATIVE_PLUGIN_LV2 | ||||
| # include "lv2/lv2.h" | # include "lv2/lv2.h" | ||||
| @@ -71,7 +66,7 @@ struct PluginListManager { | |||||
| ~PluginListManager() | ~PluginListManager() | ||||
| { | { | ||||
| #ifdef CARLA_NATIVE_PLUGIN_LV2 | #ifdef CARLA_NATIVE_PLUGIN_LV2 | ||||
| for (List<const LV2_Descriptor*>::Itenerator it = lv2Descs.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<const LV2_Descriptor*>::Itenerator it = lv2Descs.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const LV2_Descriptor*& lv2Desc(it.getValue()); | const LV2_Descriptor*& lv2Desc(it.getValue()); | ||||
| delete[] lv2Desc->URI; | delete[] lv2Desc->URI; | ||||
| @@ -90,9 +85,9 @@ struct PluginListManager { | |||||
| } | } | ||||
| #ifdef CARLA_NATIVE_PLUGIN_LV2 | #ifdef CARLA_NATIVE_PLUGIN_LV2 | ||||
| List<const LV2_Descriptor*> lv2Descs; | |||||
| LinkedList<const LV2_Descriptor*> lv2Descs; | |||||
| #endif | #endif | ||||
| List<const NativePluginDescriptor*> descs; | |||||
| LinkedList<const NativePluginDescriptor*> descs; | |||||
| }; | }; | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -114,9 +114,9 @@ void writeManifestFile(PluginListManager& plm) | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Plugins | // Plugins | ||||
| for (List<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const NativePluginDescriptor* const& pluginDesc(it.getConstValue()); | |||||
| const NativePluginDescriptor* const& pluginDesc(it.getValue()); | |||||
| const String label(pluginDesc->label); | const String label(pluginDesc->label); | ||||
| if (label == "carla") | if (label == "carla") | ||||
| @@ -566,9 +566,9 @@ int main() | |||||
| writeManifestFile(plm); | writeManifestFile(plm); | ||||
| for (List<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const NativePluginDescriptor* const& pluginDesc(it.getConstValue()); | |||||
| const NativePluginDescriptor* const& pluginDesc(it.getValue()); | |||||
| writePluginFile(pluginDesc); | writePluginFile(pluginDesc); | ||||
| } | } | ||||
| @@ -1194,9 +1194,9 @@ static LV2_Handle lv2_instantiate(const LV2_Descriptor* lv2Descriptor, double sa | |||||
| PluginListManager& plm(PluginListManager::getInstance()); | PluginListManager& plm(PluginListManager::getInstance()); | ||||
| for (List<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| const NativePluginDescriptor* const& tmpDesc(it.getConstValue()); | |||||
| const NativePluginDescriptor* const& tmpDesc(it.getValue()); | |||||
| if (std::strcmp(tmpDesc->label, pluginLabel) == 0) | if (std::strcmp(tmpDesc->label, pluginLabel) == 0) | ||||
| { | { | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "CarlaLibUtils.hpp" | #include "CarlaLibUtils.hpp" | ||||
| #include "CarlaMutex.hpp" | #include "CarlaMutex.hpp" | ||||
| #include "List.hpp" | |||||
| #include "LinkedList.hpp" | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -35,7 +35,7 @@ public: | |||||
| const CarlaMutex::ScopedLocker sl(fMutex); | const CarlaMutex::ScopedLocker sl(fMutex); | ||||
| for (List<Lib>::Itenerator it = fLibs.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<Lib>::Itenerator it = fLibs.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| Lib& lib(it.getValue()); | Lib& lib(it.getValue()); | ||||
| CARLA_ASSERT(lib.count > 0); | CARLA_ASSERT(lib.count > 0); | ||||
| @@ -69,7 +69,7 @@ public: | |||||
| const CarlaMutex::ScopedLocker sl(fMutex); | const CarlaMutex::ScopedLocker sl(fMutex); | ||||
| for (List<Lib>::Itenerator it = fLibs.begin(); it.valid(); it.next()) | |||||
| for (LinkedList<Lib>::Itenerator it = fLibs.begin(); it.valid(); it.next()) | |||||
| { | { | ||||
| Lib& lib(it.getValue()); | Lib& lib(it.getValue()); | ||||
| CARLA_ASSERT(lib.count > 0); | CARLA_ASSERT(lib.count > 0); | ||||
| @@ -106,8 +106,8 @@ private: | |||||
| int count; | int count; | ||||
| }; | }; | ||||
| List<Lib> fLibs; | |||||
| CarlaMutex fMutex; | CarlaMutex fMutex; | ||||
| LinkedList<Lib> fLibs; | |||||
| }; | }; | ||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -20,7 +20,7 @@ | |||||
| #include "CarlaBackendUtils.hpp" | #include "CarlaBackendUtils.hpp" | ||||
| #include "CarlaMIDI.h" | #include "CarlaMIDI.h" | ||||
| #include "List.hpp" | |||||
| #include "LinkedList.hpp" | |||||
| #include <QtXml/QDomNode> | #include <QtXml/QDomNode> | ||||
| @@ -93,11 +93,11 @@ struct StateCustomData { | |||||
| CARLA_DECLARE_NON_COPY_STRUCT(StateCustomData) | CARLA_DECLARE_NON_COPY_STRUCT(StateCustomData) | ||||
| }; | }; | ||||
| typedef List<StateParameter*> StateParameterList; | |||||
| typedef List<StateCustomData*> StateCustomDataList; | |||||
| typedef LinkedList<StateParameter*> StateParameterList; | |||||
| typedef LinkedList<StateCustomData*> StateCustomDataList; | |||||
| typedef List<StateParameter*>::Itenerator StateParameterItenerator; | |||||
| typedef List<StateCustomData*>::Itenerator StateCustomDataItenerator; | |||||
| typedef LinkedList<StateParameter*>::Itenerator StateParameterItenerator; | |||||
| typedef LinkedList<StateCustomData*>::Itenerator StateCustomDataItenerator; | |||||
| struct SaveState { | struct SaveState { | ||||
| const char* type; | const char* type; | ||||