| @@ -189,7 +189,7 @@ void CarlaEngineClient::_addEventPortName(const bool isInput, const char* const | |||
| static void getUniquePortName(CarlaString& sname, const CarlaStringList& list) | |||
| { | |||
| for (CarlaStringList::Itenerator it = list.begin(); it.valid(); it.next()) | |||
| for (CarlaStringList::Itenerator it = list.begin2(); it.valid(); it.next()) | |||
| { | |||
| const char* const portName(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(portName != nullptr && portName[0] != '\0'); | |||
| @@ -91,7 +91,7 @@ ExternalGraphPorts::ExternalGraphPorts() noexcept | |||
| const char* ExternalGraphPorts::getName(const bool isInput, const uint portId) const noexcept | |||
| { | |||
| for (LinkedList<PortNameToId>::Itenerator it = isInput ? ins.begin() : outs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PortNameToId>::Itenerator it = isInput ? ins.begin2() : outs.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const PortNameToId portNameFallback = { 0, 0, { '\0' }, { '\0' } }; | |||
| @@ -107,7 +107,7 @@ const char* ExternalGraphPorts::getName(const bool isInput, const uint portId) c | |||
| uint ExternalGraphPorts::getPortId(const bool isInput, const char portName[], bool* const ok) const noexcept | |||
| { | |||
| for (LinkedList<PortNameToId>::Itenerator it = isInput ? ins.begin() : outs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PortNameToId>::Itenerator it = isInput ? ins.begin2() : outs.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const PortNameToId portNameFallback = { 0, 0, { '\0' }, { '\0' } }; | |||
| @@ -230,7 +230,7 @@ bool ExternalGraph::disconnect(const uint connectionId) noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(connections.list.count() > 0, false); | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const ConnectionToId fallback = { 0, 0, 0, 0, 0 }; | |||
| @@ -347,7 +347,7 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| const CarlaString groupName(strBuf); | |||
| int h = 0; | |||
| for (LinkedList<PortNameToId>::Itenerator it = audioPorts.ins.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PortNameToId>::Itenerator it = audioPorts.ins.begin2(); it.valid(); it.next()) | |||
| { | |||
| PortNameToId& portNameToId(it.getValue()); | |||
| portNameToId.setFullName(groupName + portNameToId.name); | |||
| @@ -370,7 +370,7 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| const CarlaString groupName(strBuf); | |||
| int h = 0; | |||
| for (LinkedList<PortNameToId>::Itenerator it = audioPorts.outs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PortNameToId>::Itenerator it = audioPorts.outs.begin2(); it.valid(); it.next()) | |||
| { | |||
| PortNameToId& portNameToId(it.getValue()); | |||
| portNameToId.setFullName(groupName + portNameToId.name); | |||
| @@ -387,7 +387,7 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| const CarlaString groupNamePlus("Readable MIDI ports:"); | |||
| int h = 0; | |||
| for (LinkedList<PortNameToId>::Itenerator it = midiPorts.ins.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PortNameToId>::Itenerator it = midiPorts.ins.begin2(); it.valid(); it.next()) | |||
| { | |||
| PortNameToId& portNameToId(it.getValue()); | |||
| portNameToId.setFullName(groupNamePlus + portNameToId.name); | |||
| @@ -404,7 +404,7 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| const CarlaString groupNamePlus("Writable MIDI ports:"); | |||
| int h = 0; | |||
| for (LinkedList<PortNameToId>::Itenerator it = midiPorts.outs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PortNameToId>::Itenerator it = midiPorts.outs.begin2(); it.valid(); it.next()) | |||
| { | |||
| PortNameToId& portNameToId(it.getValue()); | |||
| portNameToId.setFullName(groupNamePlus + portNameToId.name); | |||
| @@ -425,7 +425,7 @@ const char* const* ExternalGraph::getConnections() const noexcept | |||
| char strBuf[STR_MAX+1]; | |||
| strBuf[STR_MAX] = '\0'; | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const ConnectionToId fallback = { 0, 0, 0, 0, 0 }; | |||
| @@ -692,7 +692,7 @@ void RackGraph::refresh(const char* const deviceName) | |||
| // Connections | |||
| const CarlaRecursiveMutexLocker cml(audioBuffers.mutex); | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedIn1.begin(); it.valid(); it.next()) | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedIn1.begin2(); it.valid(); it.next()) | |||
| { | |||
| const uint& portId(it.getValue(0)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(portId > 0); | |||
| @@ -708,7 +708,7 @@ void RackGraph::refresh(const char* const deviceName) | |||
| extGraph.connections.list.append(connectionToId); | |||
| } | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedIn2.begin(); it.valid(); it.next()) | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedIn2.begin2(); it.valid(); it.next()) | |||
| { | |||
| const uint& portId(it.getValue(0)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(portId > 0); | |||
| @@ -724,7 +724,7 @@ void RackGraph::refresh(const char* const deviceName) | |||
| extGraph.connections.list.append(connectionToId); | |||
| } | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedOut1.begin(); it.valid(); it.next()) | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedOut1.begin2(); it.valid(); it.next()) | |||
| { | |||
| const uint& portId(it.getValue(0)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(portId > 0); | |||
| @@ -740,7 +740,7 @@ void RackGraph::refresh(const char* const deviceName) | |||
| extGraph.connections.list.append(connectionToId); | |||
| } | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedOut2.begin(); it.valid(); it.next()) | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedOut2.begin2(); it.valid(); it.next()) | |||
| { | |||
| const uint& portId(it.getValue(0)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(portId > 0); | |||
| @@ -906,7 +906,7 @@ void RackGraph::processHelper(CarlaEngine::ProtectedData* const data, const floa | |||
| bool noConnections = true; | |||
| // connect input buffers | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedIn1.begin(); it.valid(); it.next()) | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedIn1.begin2(); it.valid(); it.next()) | |||
| { | |||
| const uint& port(it.getValue(0)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(port > 0); | |||
| @@ -928,7 +928,7 @@ void RackGraph::processHelper(CarlaEngine::ProtectedData* const data, const floa | |||
| noConnections = true; | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedIn2.begin(); it.valid(); it.next()) | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedIn2.begin2(); it.valid(); it.next()) | |||
| { | |||
| const uint& port(it.getValue(0)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(port > 0); | |||
| @@ -963,7 +963,7 @@ void RackGraph::processHelper(CarlaEngine::ProtectedData* const data, const floa | |||
| // connect output buffers | |||
| if (audioBuffers.connectedOut1.count() != 0) | |||
| { | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedOut1.begin(); it.valid(); it.next()) | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedOut1.begin2(); it.valid(); it.next()) | |||
| { | |||
| const uint& port(it.getValue(0)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(port > 0); | |||
| @@ -975,7 +975,7 @@ void RackGraph::processHelper(CarlaEngine::ProtectedData* const data, const floa | |||
| if (audioBuffers.connectedOut2.count() != 0) | |||
| { | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedOut2.begin(); it.valid(); it.next()) | |||
| for (LinkedList<uint>::Itenerator it = audioBuffers.connectedOut2.begin2(); it.valid(); it.next()) | |||
| { | |||
| const uint& port(it.getValue(0)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(port > 0); | |||
| @@ -1578,7 +1578,7 @@ bool PatchbayGraph::disconnect(const uint connectionId) | |||
| if (usingExternal) | |||
| return extGraph.disconnect(connectionId); | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const ConnectionToId fallback = { 0, 0, 0, 0, 0 }; | |||
| @@ -1614,7 +1614,7 @@ void PatchbayGraph::disconnectInternalGroup(const uint groupId) noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT(! usingExternal); | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const ConnectionToId fallback = { 0, 0, 0, 0, 0 }; | |||
| @@ -1718,7 +1718,7 @@ const char* const* PatchbayGraph::getConnections(const bool external) const | |||
| CarlaStringList connList; | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<ConnectionToId>::Itenerator it=connections.list.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const ConnectionToId fallback = { 0, 0, 0, 0, 0 }; | |||
| @@ -590,7 +590,7 @@ public: | |||
| void invalidate() noexcept | |||
| { | |||
| for (LinkedList<CarlaEngineJackAudioPort*>::Itenerator it = fAudioPorts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CarlaEngineJackAudioPort*>::Itenerator it = fAudioPorts.begin2(); it.valid(); it.next()) | |||
| { | |||
| CarlaEngineJackAudioPort* const port(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(port != nullptr); | |||
| @@ -598,7 +598,7 @@ public: | |||
| port->invalidate(); | |||
| } | |||
| for (LinkedList<CarlaEngineJackCVPort*>::Itenerator it = fCVPorts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CarlaEngineJackCVPort*>::Itenerator it = fCVPorts.begin2(); it.valid(); it.next()) | |||
| { | |||
| CarlaEngineJackCVPort* const port(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(port != nullptr); | |||
| @@ -606,7 +606,7 @@ public: | |||
| port->invalidate(); | |||
| } | |||
| for (LinkedList<CarlaEngineJackEventPort*>::Itenerator it = fEventPorts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CarlaEngineJackEventPort*>::Itenerator it = fEventPorts.begin2(); it.valid(); it.next()) | |||
| { | |||
| CarlaEngineJackEventPort* const port(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(port != nullptr); | |||
| @@ -924,7 +924,7 @@ public: | |||
| LinkedList<uint> newPlugins; | |||
| fNewGroups.moveTo(newPlugins); | |||
| for (LinkedList<uint>::Itenerator it = newPlugins.begin(); it.valid(); it.next()) | |||
| for (LinkedList<uint>::Itenerator it = newPlugins.begin2(); it.valid(); it.next()) | |||
| { | |||
| const uint groupId(it.getValue(0)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(groupId > 0); | |||
| @@ -1135,7 +1135,7 @@ public: | |||
| if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY && ! fExternalPatchbay) | |||
| return CarlaEngine::patchbayDisconnect(connectionId); | |||
| for (LinkedList<ConnectionToId>::Itenerator it = fUsedConnections.list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<ConnectionToId>::Itenerator it = fUsedConnections.list.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const ConnectionToId fallback = { 0, 0, 0, 0, 0 }; | |||
| @@ -1632,7 +1632,7 @@ protected: | |||
| } | |||
| else | |||
| { | |||
| for (LinkedList<ConnectionToId>::Itenerator it = fUsedConnections.list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<ConnectionToId>::Itenerator it = fUsedConnections.list.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const ConnectionToId fallback = { 0, 0, 0, 0, 0 }; | |||
| @@ -1658,7 +1658,7 @@ protected: | |||
| // ignore this if on internal patchbay mode | |||
| if (! fExternalPatchbay) return; | |||
| for (LinkedList<GroupNameToId>::Itenerator it = fUsedGroups.list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<GroupNameToId>::Itenerator it = fUsedGroups.list.begin2(); it.valid(); it.next()) | |||
| { | |||
| static GroupNameToId groupNameFallback = { 0, { '\0' } }; | |||
| @@ -1697,7 +1697,7 @@ protected: | |||
| const uint groupId(fUsedGroups.getGroupId(groupName)); | |||
| CARLA_SAFE_ASSERT_RETURN(groupId > 0,); | |||
| for (LinkedList<PortNameToId>::Itenerator it = fUsedPorts.list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PortNameToId>::Itenerator it = fUsedPorts.list.begin2(); it.valid(); it.next()) | |||
| { | |||
| static PortNameToId portNameFallback = { 0, 0, { '\0' }, { '\0' } }; | |||
| @@ -203,7 +203,7 @@ public: | |||
| pData->graph.destroy(); | |||
| for (LinkedList<MidiInPort>::Itenerator it = fMidiIns.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiInPort>::Itenerator it = fMidiIns.begin2(); it.valid(); it.next()) | |||
| { | |||
| MidiInPort& inPort(it.getValue()); | |||
| CARLA_SAFE_ASSERT_CONTINUE(inPort.port != nullptr); | |||
| @@ -217,7 +217,7 @@ public: | |||
| fMidiOutMutex.lock(); | |||
| for (LinkedList<MidiOutPort>::Itenerator it = fMidiOuts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiOutPort>::Itenerator it = fMidiOuts.begin2(); it.valid(); it.next()) | |||
| { | |||
| MidiOutPort& outPort(it.getValue()); | |||
| CARLA_SAFE_ASSERT_CONTINUE(outPort.port != nullptr); | |||
| @@ -348,7 +348,7 @@ public: | |||
| // --------------------------------------------------------------- | |||
| // add midi connections | |||
| for (LinkedList<MidiInPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiInPort>::Itenerator it=fMidiIns.begin2(); it.valid(); it.next()) | |||
| { | |||
| const MidiInPort& inPort(it.getValue()); | |||
| @@ -367,7 +367,7 @@ public: | |||
| fMidiOutMutex.lock(); | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin2(); it.valid(); it.next()) | |||
| { | |||
| const MidiOutPort& outPort(it.getValue()); | |||
| @@ -438,7 +438,7 @@ protected: | |||
| uint32_t engineEventIndex = 0; | |||
| fMidiInEvents.splice(); | |||
| for (LinkedList<RtMidiEvent>::Itenerator it = fMidiInEvents.data.begin(); it.valid(); it.next()) | |||
| for (LinkedList<RtMidiEvent>::Itenerator it = fMidiInEvents.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| const RtMidiEvent& midiEvent(it.getValue()); | |||
| EngineEvent& engineEvent(pData->events.in[engineEventIndex++]); | |||
| @@ -508,7 +508,7 @@ protected: | |||
| { | |||
| MidiMessage message(static_cast<const void*>(dataPtr), static_cast<int>(size), static_cast<double>(engineEvent.time)/nframes); | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin2(); it.valid(); it.next()) | |||
| { | |||
| MidiOutPort& outPort(it.getValue()); | |||
| CARLA_SAFE_ASSERT_CONTINUE(outPort.port != nullptr); | |||
| @@ -633,7 +633,7 @@ protected: | |||
| return CarlaEngine::disconnectExternalGraphPort(connectionType, portId, portName); | |||
| case kExternalGraphConnectionMidiInput: | |||
| for (LinkedList<MidiInPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiInPort>::Itenerator it=fMidiIns.begin2(); it.valid(); it.next()) | |||
| { | |||
| MidiInPort& inPort(it.getValue()); | |||
| CARLA_SAFE_ASSERT_CONTINUE(inPort.port != nullptr); | |||
| @@ -652,7 +652,7 @@ protected: | |||
| case kExternalGraphConnectionMidiOutput: { | |||
| const CarlaMutexLocker cml(fMidiOutMutex); | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin2(); it.valid(); it.next()) | |||
| { | |||
| MidiOutPort& outPort(it.getValue()); | |||
| CARLA_SAFE_ASSERT_CONTINUE(outPort.port != nullptr); | |||
| @@ -57,10 +57,8 @@ static void initRtAudioAPIsIfNeeded() | |||
| std::vector<RtAudio::Api> apis; | |||
| RtAudio::getCompiledApi(apis); | |||
| for (std::vector<RtAudio::Api>::iterator it = apis.begin(), end = apis.end(); it != end; ++it) | |||
| for (const RtAudio::Api& api : apis) | |||
| { | |||
| const RtAudio::Api& api(*it); | |||
| if (api == RtAudio::MACOSX_CORE) | |||
| continue; | |||
| if (api == RtAudio::WINDOWS_ASIO) | |||
| @@ -339,7 +337,7 @@ public: | |||
| pData->graph.destroy(); | |||
| for (LinkedList<MidiInPort>::Itenerator it = fMidiIns.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiInPort>::Itenerator it = fMidiIns.begin2(); it.valid(); it.next()) | |||
| { | |||
| static MidiInPort fallback = { nullptr, { '\0' } }; | |||
| @@ -356,7 +354,7 @@ public: | |||
| fMidiOutMutex.lock(); | |||
| for (LinkedList<MidiOutPort>::Itenerator it = fMidiOuts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiOutPort>::Itenerator it = fMidiOuts.begin2(); it.valid(); it.next()) | |||
| { | |||
| static MidiOutPort fallback = { nullptr, { '\0' } }; | |||
| @@ -480,7 +478,7 @@ public: | |||
| // --------------------------------------------------------------- | |||
| // add midi connections | |||
| for (LinkedList<MidiInPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiInPort>::Itenerator it=fMidiIns.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const MidiInPort fallback = { nullptr, { '\0' } }; | |||
| @@ -503,7 +501,7 @@ public: | |||
| fMidiOutMutex.lock(); | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const MidiOutPort fallback = { nullptr, { '\0' } }; | |||
| @@ -609,7 +607,7 @@ protected: | |||
| uint32_t engineEventIndex = 0; | |||
| fMidiInEvents.splice(); | |||
| for (LinkedList<RtMidiEvent>::Itenerator it = fMidiInEvents.data.begin(); it.valid(); it.next()) | |||
| for (LinkedList<RtMidiEvent>::Itenerator it = fMidiInEvents.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const RtMidiEvent fallback = { 0, 0, { 0 } }; | |||
| @@ -683,7 +681,7 @@ protected: | |||
| { | |||
| fMidiOutVector.assign(dataPtr, dataPtr + size); | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin2(); it.valid(); it.next()) | |||
| { | |||
| static MidiOutPort fallback = { nullptr, { '\0' } }; | |||
| @@ -869,7 +867,7 @@ protected: | |||
| return CarlaEngine::disconnectExternalGraphPort(connectionType, portId, portName); | |||
| case kExternalGraphConnectionMidiInput: | |||
| for (LinkedList<MidiInPort>::Itenerator it=fMidiIns.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiInPort>::Itenerator it=fMidiIns.begin2(); it.valid(); it.next()) | |||
| { | |||
| static MidiInPort fallback = { nullptr, { '\0' } }; | |||
| @@ -891,7 +889,7 @@ protected: | |||
| case kExternalGraphConnectionMidiOutput: { | |||
| const CarlaMutexLocker cml(fMidiOutMutex); | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin(); it.valid(); it.next()) | |||
| for (LinkedList<MidiOutPort>::Itenerator it=fMidiOuts.begin2(); it.valid(); it.next()) | |||
| { | |||
| static MidiOutPort fallback = { nullptr, { '\0' } }; | |||
| @@ -601,7 +601,7 @@ const CarlaStateSave& CarlaPlugin::getStateSave(const bool callPrepareForSave) | |||
| // --------------------------------------------------------------- | |||
| // Custom Data | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin2(); it.valid(); it.next()) | |||
| { | |||
| const CustomData& cData(it.getValue(kCustomDataFallback)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(cData.isValid()); | |||
| @@ -628,7 +628,7 @@ void CarlaPlugin::loadStateSave(const CarlaStateSave& stateSave) | |||
| // --------------------------------------------------------------- | |||
| // Part 1 - PRE-set custom data (only those which reload programs) | |||
| for (CarlaStateSave::CustomDataItenerator it = stateSave.customData.begin(); it.valid(); it.next()) | |||
| for (CarlaStateSave::CustomDataItenerator it = stateSave.customData.begin2(); it.valid(); it.next()) | |||
| { | |||
| const CarlaStateSave::CustomData* const stateCustomData(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(stateCustomData != nullptr); | |||
| @@ -712,7 +712,7 @@ void CarlaPlugin::loadStateSave(const CarlaStateSave& stateSave) | |||
| const float sampleRate(static_cast<float>(pData->engine->getSampleRate())); | |||
| for (CarlaStateSave::ParameterItenerator it = stateSave.parameters.begin(); it.valid(); it.next()) | |||
| for (CarlaStateSave::ParameterItenerator it = stateSave.parameters.begin2(); it.valid(); it.next()) | |||
| { | |||
| CarlaStateSave::Parameter* const stateParameter(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(stateParameter != nullptr); | |||
| @@ -724,7 +724,7 @@ void CarlaPlugin::loadStateSave(const CarlaStateSave& stateSave) | |||
| // Try to set by symbol, otherwise use index | |||
| if (stateParameter->symbol != nullptr && stateParameter->symbol[0] != '\0') | |||
| { | |||
| for (LinkedList<ParamSymbol*>::Itenerator it2 = paramSymbols.begin(); it2.valid(); it2.next()) | |||
| for (LinkedList<ParamSymbol*>::Itenerator it2 = paramSymbols.begin2(); it2.valid(); it2.next()) | |||
| { | |||
| ParamSymbol* const paramSymbol(it2.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(paramSymbol != nullptr); | |||
| @@ -747,7 +747,7 @@ void CarlaPlugin::loadStateSave(const CarlaStateSave& stateSave) | |||
| // Symbol only | |||
| if (stateParameter->symbol != nullptr && stateParameter->symbol[0] != '\0') | |||
| { | |||
| for (LinkedList<ParamSymbol*>::Itenerator it2 = paramSymbols.begin(); it2.valid(); it2.next()) | |||
| for (LinkedList<ParamSymbol*>::Itenerator it2 = paramSymbols.begin2(); it2.valid(); it2.next()) | |||
| { | |||
| ParamSymbol* const paramSymbol(it2.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(paramSymbol != nullptr); | |||
| @@ -796,7 +796,7 @@ void CarlaPlugin::loadStateSave(const CarlaStateSave& stateSave) | |||
| // --------------------------------------------------------------- | |||
| // Part 4c - clear | |||
| for (LinkedList<ParamSymbol*>::Itenerator it = paramSymbols.begin(); it.valid(); it.next()) | |||
| for (LinkedList<ParamSymbol*>::Itenerator it = paramSymbols.begin2(); it.valid(); it.next()) | |||
| { | |||
| ParamSymbol* const paramSymbol(it.getValue(nullptr)); | |||
| delete paramSymbol; | |||
| @@ -807,7 +807,7 @@ void CarlaPlugin::loadStateSave(const CarlaStateSave& stateSave) | |||
| // --------------------------------------------------------------- | |||
| // Part 5 - set custom data | |||
| for (CarlaStateSave::CustomDataItenerator it = stateSave.customData.begin(); it.valid(); it.next()) | |||
| for (CarlaStateSave::CustomDataItenerator it = stateSave.customData.begin2(); it.valid(); it.next()) | |||
| { | |||
| const CarlaStateSave::CustomData* const stateCustomData(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(stateCustomData != nullptr); | |||
| @@ -1267,7 +1267,7 @@ void CarlaPlugin::setCustomData(const char* const type, const char* const key, c | |||
| } | |||
| // Check if we already have this key | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin2(); it.valid(); it.next()) | |||
| { | |||
| CustomData& customData(it.getValue(kCustomDataFallbackNC)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(customData.isValid()); | |||
| @@ -1432,7 +1432,7 @@ void CarlaPlugin::idle() | |||
| const CarlaMutexLocker sl(pData->postRtEvents.mutex); | |||
| for (RtLinkedList<PluginPostRtEvent>::Itenerator it = pData->postRtEvents.data.begin(); it.valid(); it.next()) | |||
| for (RtLinkedList<PluginPostRtEvent>::Itenerator it = pData->postRtEvents.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| const PluginPostRtEvent& event(it.getValue(kPluginPostRtEventFallback)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(event.type != kPluginPostRtEventNull); | |||
| @@ -1830,7 +1830,7 @@ void CarlaPlugin::uiIdle() | |||
| const CarlaMutexLocker sl(pData->postUiEvents.mutex); | |||
| for (LinkedList<PluginPostRtEvent>::Itenerator it = pData->postUiEvents.data.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PluginPostRtEvent>::Itenerator it = pData->postUiEvents.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| const PluginPostRtEvent& event(it.getValue(kPluginPostRtEventFallback)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(event.type != kPluginPostRtEventNull); | |||
| @@ -1434,7 +1434,7 @@ public: | |||
| if (pData->extNotes.mutex.tryLock()) | |||
| { | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin(); it.valid(); it.next()) | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| const ExternalMidiNote& note(it.getValue()); | |||
| @@ -60,6 +60,7 @@ using juce::StringArray; | |||
| CARLA_BACKEND_START_NAMESPACE | |||
| #if 0 | |||
| // ------------------------------------------------------------------- | |||
| // Fallback data | |||
| @@ -2093,7 +2094,7 @@ public: | |||
| if (fDescriptor->cleanup == nullptr) | |||
| { | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -2137,7 +2138,7 @@ public: | |||
| } | |||
| else | |||
| { | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -2169,7 +2170,7 @@ public: | |||
| } | |||
| else | |||
| { | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -2402,7 +2403,7 @@ public: | |||
| osc_send_sample_rate(fOscData, static_cast<float>(pData->engine->getSampleRate())); | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin2(); it.valid(); it.next()) | |||
| { | |||
| const CustomData& customData(it.getValue(kCustomDataFallback)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(customData.isValid()); | |||
| @@ -2887,7 +2888,7 @@ private: | |||
| dlabel = carla_strdup(label); | |||
| } catch(...) { return false; } | |||
| for (LinkedList<const char*>::Itenerator it = sMultiSynthList.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const char*>::Itenerator it = sMultiSynthList.begin2(); it.valid(); it.next()) | |||
| { | |||
| const char* const itLabel(it.getValue()); | |||
| @@ -2905,7 +2906,7 @@ private: | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(label != nullptr && label[0] != '\0',); | |||
| for (LinkedList<const char*>::Itenerator it = sMultiSynthList.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const char*>::Itenerator it = sMultiSynthList.begin2(); it.valid(); it.next()) | |||
| { | |||
| const char* const itLabel(it.getValue()); | |||
| @@ -2924,14 +2925,19 @@ private: | |||
| }; | |||
| LinkedList<const char*> CarlaPluginDSSI::sMultiSynthList; | |||
| #endif | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| CarlaPlugin* CarlaPlugin::newDSSI(const Initializer& init) | |||
| { | |||
| carla_debug("CarlaPlugin::newDSSI({%p, \"%s\", \"%s\", \"%s\", " P_INT64 ", %x})", | |||
| init.engine, init.filename, init.name, init.label, init.uniqueId, init.optons); | |||
| init.engine, init.filename, init.name, init.label, init.uniqueId, init.options); | |||
| init.engine->setLastError("TODO"); | |||
| return nullptr; | |||
| #if 0 | |||
| CarlaPluginDSSI* const plugin(new CarlaPluginDSSI(init.engine, init.id)); | |||
| if (! plugin->init(init.filename, init.name, init.label, init.options)) | |||
| @@ -2941,6 +2947,7 @@ CarlaPlugin* CarlaPlugin::newDSSI(const Initializer& init) | |||
| } | |||
| return plugin; | |||
| #endif | |||
| } | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| @@ -1054,7 +1054,7 @@ public: | |||
| if (pData->extNotes.mutex.tryLock()) | |||
| { | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin(); it.valid(); it.next()) | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| const ExternalMidiNote& note(it.getValue()); | |||
| @@ -628,7 +628,7 @@ CarlaPlugin::ProtectedData::~ProtectedData() noexcept | |||
| iconName = nullptr; | |||
| } | |||
| for (LinkedList<CustomData>::Itenerator it = custom.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CustomData>::Itenerator it = custom.begin2(); it.valid(); it.next()) | |||
| { | |||
| CustomData& customData(it.getValue(kCustomDataFallbackNC)); | |||
| //CARLA_SAFE_ASSERT_CONTINUE(customData.isValid()); | |||
| @@ -709,7 +709,7 @@ public: | |||
| if (pData->extNotes.mutex.tryLock()) | |||
| { | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin(); it.valid(); it.next()) | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| const ExternalMidiNote& note(it.getValue()); | |||
| @@ -68,7 +68,7 @@ public: | |||
| { | |||
| if (fDescriptor->cleanup != nullptr) | |||
| { | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -713,7 +713,7 @@ public: | |||
| // Start parameters in their default values | |||
| fParamBuffers[j] = def; | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -728,7 +728,7 @@ public: | |||
| // Not Audio or Control | |||
| carla_stderr2("ERROR - Got a broken Port (neither Audio or Control)"); | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -879,7 +879,7 @@ public: | |||
| if (fDescriptor->activate != nullptr) | |||
| { | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -897,7 +897,7 @@ public: | |||
| if (fDescriptor->deactivate != nullptr) | |||
| { | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -1171,7 +1171,7 @@ public: | |||
| // Run plugin | |||
| uint instn = 0; | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next(), ++instn) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next(), ++instn) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -1381,7 +1381,7 @@ public: | |||
| if (fDescriptor->cleanup == nullptr) | |||
| { | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -1425,7 +1425,7 @@ public: | |||
| } | |||
| else | |||
| { | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -1457,7 +1457,7 @@ public: | |||
| } | |||
| else | |||
| { | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin(); it.valid(); it.next()) | |||
| for (LinkedList<LADSPA_Handle>::Itenerator it = fHandles.begin2(); it.valid(); it.next()) | |||
| { | |||
| LADSPA_Handle const handle(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(handle != nullptr); | |||
| @@ -684,7 +684,7 @@ public: | |||
| } | |||
| } | |||
| for (LinkedList<const char*>::Itenerator it = fCustomURIDs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const char*>::Itenerator it = fCustomURIDs.begin2(); it.valid(); it.next()) | |||
| { | |||
| const char* const uri(it.getValue()); | |||
| @@ -2962,7 +2962,7 @@ public: | |||
| { | |||
| const uint32_t j = fEventsIn.ctrlIndex; | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin(); it.valid(); it.next()) | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| const ExternalMidiNote& note(it.getValue()); | |||
| @@ -4353,7 +4353,7 @@ public: | |||
| CARLA_SAFE_ASSERT_RETURN(stype != nullptr, LV2_STATE_ERR_BAD_TYPE); | |||
| // Check if we already have this key | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin2(); it.valid(); it.next()) | |||
| { | |||
| CustomData& data(it.getValue()); | |||
| @@ -4402,7 +4402,7 @@ public: | |||
| const char* stype = nullptr; | |||
| const char* stringData = nullptr; | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin2(); it.valid(); it.next()) | |||
| { | |||
| const CustomData& data(it.getValue()); | |||
| @@ -821,7 +821,7 @@ public: | |||
| if (pData->extNotes.mutex.tryLock()) | |||
| { | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin(); it.valid(); it.next()) | |||
| for (RtLinkedList<ExternalMidiNote>::Itenerator it = pData->extNotes.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| const ExternalMidiNote& note(it.getValue()); | |||
| @@ -749,7 +749,7 @@ public: | |||
| if (fDescriptor->ui_set_custom_data != nullptr) | |||
| { | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin(); it.valid(); it.next()) | |||
| for (LinkedList<CustomData>::Itenerator it = pData->custom.begin2(); it.valid(); it.next()) | |||
| { | |||
| const CustomData& cData(it.getValue()); | |||
| @@ -2299,7 +2299,7 @@ public: | |||
| sPluginInitializer.initIfNeeded(); | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = gPluginDescriptors.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = gPluginDescriptors.begin2(); it.valid(); it.next()) | |||
| { | |||
| fDescriptor = it.getValue(); | |||
| @@ -361,7 +361,7 @@ public: | |||
| } | |||
| } | |||
| for (LinkedList<const char*>::Itenerator it = fCustomURIDs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const char*>::Itenerator it = fCustomURIDs.begin2(); it.valid(); it.next()) | |||
| { | |||
| const char* const uri(it.getValue(nullptr)); | |||
| @@ -1214,7 +1214,7 @@ static void do_vst_check(lib_t& libHandle, const bool doInit) | |||
| uniqueIds.append(gVstCurrentUniqueId); | |||
| } | |||
| for (LinkedList<intptr_t>::Itenerator it = uniqueIds.begin(); it.valid(); it.next()) | |||
| for (LinkedList<intptr_t>::Itenerator it = uniqueIds.begin2(); it.valid(); it.next()) | |||
| { | |||
| gVstCurrentUniqueId = it.getValue(0); | |||
| @@ -186,7 +186,7 @@ public: | |||
| { | |||
| const CarlaMutexLocker sl(fMutex); | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin2(); it.valid(); it.next()) | |||
| { | |||
| const RawMidiEvent* const rawMidiEvent(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(rawMidiEvent != nullptr); | |||
| @@ -214,7 +214,7 @@ public: | |||
| { | |||
| const CarlaMutexLocker sl(fMutex); | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin2(); it.valid(); it.next()) | |||
| delete it.getValue(nullptr); | |||
| fData.clear(); | |||
| @@ -236,7 +236,7 @@ public: | |||
| if (fStartTime != 0) | |||
| timePosFrame += static_cast<long double>(fStartTime); | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin2(); it.valid(); it.next()) | |||
| { | |||
| const RawMidiEvent* const rawMidiEvent(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(rawMidiEvent != nullptr); | |||
| @@ -275,7 +275,7 @@ public: | |||
| LinkedList<const RawMidiEvent*>::Itenerator iteneratorBegin() const noexcept | |||
| { | |||
| return fData.begin(); | |||
| return fData.begin2(); | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -298,7 +298,7 @@ public: | |||
| char* dataWrtn = data; | |||
| int wrtn; | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin2(); it.valid(); it.next()) | |||
| { | |||
| const RawMidiEvent* const rawMidiEvent(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(rawMidiEvent != nullptr); | |||
| @@ -435,7 +435,7 @@ private: | |||
| return; | |||
| } | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const RawMidiEvent*>::Itenerator it = fData.begin2(); it.valid(); it.next()) | |||
| { | |||
| const RawMidiEvent* const oldEvent(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(oldEvent != nullptr); | |||
| @@ -52,7 +52,7 @@ public: | |||
| if (! fInitiated) | |||
| return; | |||
| for (LinkedList<const ProgramInfo*>::Itenerator it = fPrograms.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const ProgramInfo*>::Itenerator it = fPrograms.begin2(); it.valid(); it.next()) | |||
| { | |||
| const ProgramInfo* const& pInfo(it.getValue(nullptr)); | |||
| delete pInfo; | |||
| @@ -118,7 +118,7 @@ public: | |||
| const char* getZynProgramFilename(const uint32_t bank, const uint32_t program) const noexcept | |||
| { | |||
| for (LinkedList<const ProgramInfo*>::Itenerator it = fPrograms.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const ProgramInfo*>::Itenerator it = fPrograms.begin2(); it.valid(); it.next()) | |||
| { | |||
| const ProgramInfo* const& pInfo(it.getValue(nullptr)); | |||
| @@ -86,7 +86,7 @@ struct PluginListManager { | |||
| ~PluginListManager() | |||
| { | |||
| #ifdef CARLA_NATIVE_PLUGIN_DSSI | |||
| for (LinkedList<const DSSI_Descriptor*>::Itenerator it = dssiDescs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const DSSI_Descriptor*>::Itenerator it = dssiDescs.begin2(); it.valid(); it.next()) | |||
| { | |||
| const DSSI_Descriptor* const dssiDesc(it.getValue()); | |||
| //delete[] lv2Desc->URI; | |||
| @@ -96,7 +96,7 @@ struct PluginListManager { | |||
| #endif | |||
| #ifdef CARLA_NATIVE_PLUGIN_LV2 | |||
| for (LinkedList<const LV2_Descriptor*>::Itenerator it = lv2Descs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const LV2_Descriptor*>::Itenerator it = lv2Descs.begin2(); it.valid(); it.next()) | |||
| { | |||
| const LV2_Descriptor* const lv2Desc(it.getValue()); | |||
| delete[] lv2Desc->URI; | |||
| @@ -115,7 +115,7 @@ static void writeManifestFile(PluginListManager& plm) | |||
| // ------------------------------------------------------------------- | |||
| // Plugins | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin2(); it.valid(); it.next()) | |||
| { | |||
| const NativePluginDescriptor* const& pluginDesc(it.getValue()); | |||
| const String label(pluginDesc->label); | |||
| @@ -576,7 +576,7 @@ int main() | |||
| writeManifestFile(plm); | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin2(); it.valid(); it.next()) | |||
| { | |||
| const NativePluginDescriptor* const& pluginDesc(it.getValue()); | |||
| writePluginFile(pluginDesc); | |||
| @@ -1410,7 +1410,7 @@ static LV2_Handle lv2_instantiate(const LV2_Descriptor* lv2Descriptor, double sa | |||
| PluginListManager& plm(PluginListManager::getInstance()); | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin2(); it.valid(); it.next()) | |||
| { | |||
| const NativePluginDescriptor* const& tmpDesc(it.getValue()); | |||
| @@ -715,7 +715,7 @@ static intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t | |||
| PluginListManager& plm(PluginListManager::getInstance()); | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<const NativePluginDescriptor*>::Itenerator it = plm.descs.begin2(); it.valid(); it.next()) | |||
| { | |||
| const NativePluginDescriptor* const& tmpDesc(it.getValue()); | |||
| @@ -135,24 +135,25 @@ int main() | |||
| postRtEvents.trySplice(); | |||
| assert(postRtEvents.data.count() == 4); | |||
| assert(postRtEvents.dataPendingRT.count() == 0); | |||
| // return 0; | |||
| for (RtLinkedList<MyData>::Itenerator it = postRtEvents.data.begin(); it.valid(); it.next()) | |||
| for (RtLinkedList<MyData>::Itenerator it = postRtEvents.data.begin2(); it.valid(); it.next()) | |||
| { | |||
| static const MyData fallback = { { '\0' }, 11 }; | |||
| const MyData& my(it.getValue(fallback)); | |||
| const MyData& my(it.getValue()); | |||
| carla_stdout("FOR DATA!!!: %i %s", my.id, my.str); | |||
| if (my.id == 1) | |||
| if (my.id == 2) | |||
| { | |||
| // +1 append at | |||
| // +1 append | |||
| postRtEvents.dataPendingRT.insertAt(m5, it); | |||
| assert(postRtEvents.data.count() == 4); | |||
| assert(postRtEvents.dataPendingRT.count() == 1); | |||
| } | |||
| } | |||
| for (const MyData& my : postRtEvents.data) | |||
| carla_stdout("FOR DATA!!! NEW AUTO Itenerator!!!: %i %s", my.id, my.str); | |||
| postRtEvents.trySplice(); | |||
| assert(postRtEvents.data.count() == 5); | |||
| assert(postRtEvents.dataPendingRT.count() == 0); | |||
| @@ -34,7 +34,7 @@ public: | |||
| ~LibCounter() noexcept | |||
| { | |||
| // might have some leftovers | |||
| for (LinkedList<Lib>::Itenerator it = fLibs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<Lib>::Itenerator it = fLibs.begin2(); it.valid(); it.next()) | |||
| { | |||
| static Lib libFallback = { nullptr, nullptr, 0, false }; | |||
| @@ -73,7 +73,7 @@ public: | |||
| const CarlaMutexLocker cml(fMutex); | |||
| for (LinkedList<Lib>::Itenerator it = fLibs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<Lib>::Itenerator it = fLibs.begin2(); it.valid(); it.next()) | |||
| { | |||
| static Lib libFallback = { nullptr, nullptr, 0, false }; | |||
| @@ -118,7 +118,7 @@ public: | |||
| const CarlaMutexLocker cml(fMutex); | |||
| for (LinkedList<Lib>::Itenerator it = fLibs.begin(); it.valid(); it.next()) | |||
| for (LinkedList<Lib>::Itenerator it = fLibs.begin2(); it.valid(); it.next()) | |||
| { | |||
| static Lib libFallback = { nullptr, nullptr, 0, false }; | |||
| @@ -24,7 +24,7 @@ uint PatchbayGroupList::getGroupId(const char* const groupName) const noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(groupName != nullptr && groupName[0] != '\0', 0); | |||
| for (LinkedList<GroupNameToId>::Itenerator it = list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<GroupNameToId>::Itenerator it = list.begin2(); it.valid(); it.next()) | |||
| { | |||
| const GroupNameToId& groupNameToId(it.getValue(kGroupNameToIdFallback)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(groupNameToId.group != 0); | |||
| @@ -40,7 +40,7 @@ const char* PatchbayGroupList::getGroupName(const uint groupId) const noexcept | |||
| { | |||
| static const char fallback[] = { '\0' }; | |||
| for (LinkedList<GroupNameToId>::Itenerator it = list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<GroupNameToId>::Itenerator it = list.begin2(); it.valid(); it.next()) | |||
| { | |||
| const GroupNameToId& groupNameToId(it.getValue(kGroupNameToIdFallback)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(groupNameToId.group != 0); | |||
| @@ -56,7 +56,7 @@ const char* PatchbayPortList::getFullPortName(const uint groupId, const uint por | |||
| { | |||
| static const char fallback[] = { '\0' }; | |||
| for (LinkedList<PortNameToId>::Itenerator it = list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PortNameToId>::Itenerator it = list.begin2(); it.valid(); it.next()) | |||
| { | |||
| const PortNameToId& portNameToId(it.getValue(kPortNameToIdFallback)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(portNameToId.group != 0); | |||
| @@ -72,7 +72,7 @@ const PortNameToId& PatchbayPortList::getPortNameToId(const char* const fullPort | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(fullPortName != nullptr && fullPortName[0] != '\0', kPortNameToIdFallback); | |||
| for (LinkedList<PortNameToId>::Itenerator it = list.begin(); it.valid(); it.next()) | |||
| for (LinkedList<PortNameToId>::Itenerator it = list.begin2(); it.valid(); it.next()) | |||
| { | |||
| const PortNameToId& portNameToId(it.getValue(kPortNameToIdFallback)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(portNameToId.group != 0); | |||
| @@ -258,13 +258,13 @@ void CarlaStateSave::clear() noexcept | |||
| currentMidiBank = -1; | |||
| currentMidiProgram = -1; | |||
| for (ParameterItenerator it = parameters.begin(); it.valid(); it.next()) | |||
| for (ParameterItenerator it = parameters.begin2(); it.valid(); it.next()) | |||
| { | |||
| Parameter* const stateParameter(it.getValue(nullptr)); | |||
| delete stateParameter; | |||
| } | |||
| for (CustomDataItenerator it = customData.begin(); it.valid(); it.next()) | |||
| for (CustomDataItenerator it = customData.begin2(); it.valid(); it.next()) | |||
| { | |||
| CustomData* const stateCustomData(it.getValue(nullptr)); | |||
| delete stateCustomData; | |||
| @@ -574,7 +574,7 @@ void CarlaStateSave::dumpToMemoryStream(MemoryOutputStream& content) const | |||
| } | |||
| #endif | |||
| for (ParameterItenerator it = parameters.begin(); it.valid(); it.next()) | |||
| for (ParameterItenerator it = parameters.begin2(); it.valid(); it.next()) | |||
| { | |||
| Parameter* const stateParameter(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(stateParameter != nullptr); | |||
| @@ -631,7 +631,7 @@ void CarlaStateSave::dumpToMemoryStream(MemoryOutputStream& content) const | |||
| content << midiProgramXml; | |||
| } | |||
| for (CustomDataItenerator it = customData.begin(); it.valid(); it.next()) | |||
| for (CustomDataItenerator it = customData.begin2(); it.valid(); it.next()) | |||
| { | |||
| CustomData* const stateCustomData(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(stateCustomData != nullptr); | |||
| @@ -134,7 +134,7 @@ protected: | |||
| tmpList[count] = nullptr; | |||
| std::size_t i=0; | |||
| for (LinkedList<const char*>::Itenerator it = list.begin(); it.valid(); it.next(), ++i) | |||
| for (LinkedList<const char*>::Itenerator it = list.begin2(); it.valid(); it.next(), ++i) | |||
| { | |||
| tmpList[i] = carla_strdup_safe(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_BREAK(tmpList[i] != nullptr); | |||
| @@ -162,7 +162,7 @@ public: | |||
| CarlaStringList(const CarlaStringList& list) noexcept | |||
| : LinkedList<const char*>() | |||
| { | |||
| for (Itenerator it = list.begin(); it.valid(); it.next()) | |||
| for (Itenerator it = list.begin2(); it.valid(); it.next()) | |||
| LinkedList<const char*>::append(carla_strdup_safe(it.getValue(nullptr))); | |||
| } | |||
| @@ -175,7 +175,7 @@ public: | |||
| void clear() noexcept | |||
| { | |||
| for (Itenerator it = begin(); it.valid(); it.next()) | |||
| for (Itenerator it = begin2(); it.valid(); it.next()) | |||
| { | |||
| if (const char* const string = it.getValue(nullptr)) | |||
| delete[] string; | |||
| @@ -256,7 +256,7 @@ public: | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(string != nullptr, false); | |||
| for (Itenerator it = begin(); it.valid(); it.next()) | |||
| for (Itenerator it = begin2(); it.valid(); it.next()) | |||
| { | |||
| const char* const stringComp(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(stringComp != nullptr); | |||
| @@ -276,7 +276,7 @@ public: | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(string != nullptr,); | |||
| for (Itenerator it = begin(); it.valid(); it.next()) | |||
| for (Itenerator it = begin2(); it.valid(); it.next()) | |||
| { | |||
| const char* const stringComp(it.getValue(nullptr)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(stringComp != nullptr); | |||
| @@ -315,7 +315,7 @@ public: | |||
| { | |||
| clear(); | |||
| for (Itenerator it = list.begin(); it.valid(); it.next()) | |||
| for (Itenerator it = list.begin2(); it.valid(); it.next()) | |||
| { | |||
| if (const char* const string = carla_strdup_safe(it.getValue(nullptr))) | |||
| LinkedList<const char*>::append(string); | |||
| @@ -141,7 +141,11 @@ public: | |||
| // TODO: remove this, fallback should be mandatory | |||
| T& getValue() const noexcept | |||
| { | |||
| static T& fallback(_getFallback()); | |||
| Data* const data(list_entry(fEntry, Data, siblings)); | |||
| CARLA_SAFE_ASSERT_RETURN(data != nullptr, fallback); | |||
| return data->value; | |||
| } | |||
| @@ -151,10 +155,82 @@ public: | |||
| const ListHead& kQueue; | |||
| bool* const fUsingItenerator; | |||
| static T& _getFallback() | |||
| { | |||
| static T data; | |||
| carla_zeroStruct<T>(data); | |||
| return data; | |||
| } | |||
| friend class AbstractLinkedList; | |||
| }; | |||
| Itenerator begin() const noexcept | |||
| class AutoItenerator { | |||
| public: | |||
| AutoItenerator(const ListHead* entry, bool* usingItenerator) noexcept | |||
| : fEntry(entry), | |||
| fEntry2(entry != nullptr ? entry->next : nullptr), | |||
| fUsingItenerator(usingItenerator) | |||
| { | |||
| CARLA_SAFE_ASSERT(fEntry != nullptr); | |||
| CARLA_SAFE_ASSERT(fEntry2 != nullptr); | |||
| } | |||
| ~AutoItenerator() noexcept | |||
| { | |||
| if (fUsingItenerator != nullptr) | |||
| *fUsingItenerator = false; | |||
| } | |||
| bool operator!=(AutoItenerator& it) const noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(fEntry != nullptr, false); | |||
| CARLA_SAFE_ASSERT_RETURN(it.fEntry != nullptr, false); | |||
| return fEntry != it.fEntry; | |||
| } | |||
| AutoItenerator& operator++() noexcept | |||
| { | |||
| fEntry = fEntry2; | |||
| fEntry2 = (fEntry != nullptr) ? fEntry->next : nullptr; | |||
| return *this; | |||
| } | |||
| T& operator*() noexcept | |||
| { | |||
| static T& fallback(_getFallback()); | |||
| Data* const data(list_entry(fEntry, Data, siblings)); | |||
| CARLA_SAFE_ASSERT_RETURN(data != nullptr, fallback); | |||
| return data->value; | |||
| } | |||
| const T& operator*() const noexcept | |||
| { | |||
| static const T& fallback(_getFallback()); | |||
| const Data* const data(list_entry_const(fEntry, Data, siblings)); | |||
| CARLA_SAFE_ASSERT_RETURN(data != nullptr, fallback); | |||
| return data->value; | |||
| } | |||
| private: | |||
| ListHead* fEntry; | |||
| ListHead* fEntry2; | |||
| bool* const fUsingItenerator; | |||
| static T& _getFallback() | |||
| { | |||
| static T data; | |||
| carla_zeroStruct<T>(data); | |||
| return data; | |||
| } | |||
| }; | |||
| Itenerator begin2() const noexcept | |||
| { | |||
| static const ListHead fallback = { nullptr, nullptr }; | |||
| CARLA_SAFE_ASSERT_RETURN(! fUsingItenerator, Itenerator(fallback, nullptr)); | |||
| @@ -163,6 +239,19 @@ public: | |||
| return Itenerator(fQueue, &fUsingItenerator); | |||
| } | |||
| AutoItenerator begin() const noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(! fUsingItenerator, AutoItenerator(nullptr, nullptr)); | |||
| fUsingItenerator = true; | |||
| return AutoItenerator(fQueue.next, &fUsingItenerator); | |||
| } | |||
| AutoItenerator end() const noexcept | |||
| { | |||
| return AutoItenerator(&fQueue, nullptr); | |||
| } | |||
| void clear() noexcept | |||
| { | |||
| if (fCount == 0) | |||
| @@ -260,11 +349,11 @@ public: | |||
| return fallback; | |||
| } | |||
| const T& getFirst(const T& fallback) const noexcept | |||
| T getFirst(T& fallback, const bool removeObj) noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(fCount > 0, fallback); | |||
| return _get(fQueue.next, fallback); | |||
| return _get(fQueue.next, fallback, removeObj); | |||
| } | |||
| T& getFirst(T& fallback) const noexcept | |||
| @@ -274,18 +363,18 @@ public: | |||
| return _get(fQueue.next, fallback); | |||
| } | |||
| T getFirst(T& fallback, const bool removeObj) noexcept | |||
| const T& getFirst(const T& fallback) const noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(fCount > 0, fallback); | |||
| return _get(fQueue.next, fallback, removeObj); | |||
| return _get(fQueue.next, fallback); | |||
| } | |||
| const T& getLast(const T& fallback) const noexcept | |||
| T getLast(T& fallback, const bool removeObj) noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(fCount > 0, fallback); | |||
| return _get(fQueue.prev, fallback); | |||
| return _get(fQueue.prev, fallback, removeObj); | |||
| } | |||
| T& getLast(T& fallback) const noexcept | |||
| @@ -295,11 +384,11 @@ public: | |||
| return _get(fQueue.prev, fallback); | |||
| } | |||
| T getLast(T& fallback, const bool removeObj) noexcept | |||
| const T& getLast(const T& fallback) const noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(fCount > 0, fallback); | |||
| return _get(fQueue.prev, fallback, removeObj); | |||
| return _get(fQueue.prev, fallback); | |||
| } | |||
| void remove(Itenerator& it) noexcept | |||
| @@ -127,7 +127,7 @@ public: | |||
| bool moveTo(RtLinkedList<T>& list, const bool inTail) noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(fMemPool == list.fMemPool,); | |||
| CARLA_SAFE_ASSERT_RETURN(fMemPool == list.fMemPool, false); | |||
| return AbstractLinkedList<T>::moveTo(list, inTail); | |||
| } | |||