From 91cee1f997508aa23b46911b2cb6050ea6c95bad Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 1 Jun 2022 22:58:58 +0100 Subject: [PATCH] Cleanup for CARLA_DECLARE_NON_COPYABLE macro use, minor jsfx things Signed-off-by: falkTX --- source/backend/CarlaEngine.hpp | 18 +- source/backend/CarlaHost.h | 6 +- source/backend/CarlaHostImpl.hpp | 2 +- source/backend/CarlaPlugin.hpp | 8 +- source/backend/CarlaStandaloneNSM.cpp | 4 +- source/backend/CarlaUtils.h | 2 +- source/backend/engine/CarlaEngineBridge.cpp | 2 +- source/backend/engine/CarlaEngineClient.hpp | 8 +- source/backend/engine/CarlaEngineGraph.hpp | 12 +- source/backend/engine/CarlaEngineInternal.hpp | 20 +- source/backend/engine/CarlaEngineJack.cpp | 2 +- source/backend/engine/CarlaEngineNative.cpp | 4 +- source/backend/engine/CarlaEnginePorts.hpp | 4 +- source/backend/plugin/CarlaPlugin.cpp | 6 +- source/backend/plugin/CarlaPluginBridge.cpp | 14 +- .../backend/plugin/CarlaPluginFluidSynth.cpp | 6 +- source/backend/plugin/CarlaPluginInternal.hpp | 26 +- source/backend/plugin/CarlaPluginJSFX.cpp | 267 +++++++++--------- source/backend/plugin/CarlaPluginJack.cpp | 6 +- source/backend/plugin/CarlaPluginJuce.cpp | 10 +- .../backend/plugin/CarlaPluginLADSPADSSI.cpp | 8 +- source/backend/plugin/CarlaPluginLV2.cpp | 20 +- source/backend/plugin/CarlaPluginNative.cpp | 14 +- source/backend/plugin/CarlaPluginSFZero.cpp | 2 +- source/backend/plugin/CarlaPluginVST2.cpp | 12 +- source/backend/plugin/CarlaPluginVST3.cpp | 56 ++-- source/backend/utils/CachedPlugins.cpp | 18 +- source/discovery/carla-discovery.cpp | 6 +- source/includes/CarlaDefines.h | 17 +- source/includes/CarlaNativePrograms.hpp | 6 +- source/includes/ladspa_rdf.hpp | 8 +- source/includes/lv2_rdf.hpp | 22 +- source/interposer/interposer-jack-x11.cpp | 2 +- source/jackbridge/JackBridge1.cpp | 6 +- source/jackbridge/JackBridgeExport.cpp | 2 +- source/libjack/libjack.cpp | 4 +- source/libjack/libjack.hpp | 12 +- .../modules/lilv/lilv-0.24.0/lilv/lilvmm.hpp | 2 +- .../modules/water/buffers/AudioSampleBuffer.h | 4 +- .../water/containers/ArrayAllocationBase.h | 5 +- source/modules/water/containers/HashMap.h | 4 +- .../water/containers/LinkedListPointer.h | 6 +- source/modules/water/containers/OwnedArray.h | 4 +- .../modules/water/files/DirectoryIterator.h | 6 +- source/modules/water/files/File.cpp | 22 +- source/modules/water/files/File.h | 12 +- source/modules/water/files/FileInputStream.h | 4 +- source/modules/water/files/FileOutputStream.h | 4 +- source/modules/water/files/TemporaryFile.h | 4 +- source/modules/water/memory/ByteOrder.h | 4 +- source/modules/water/memory/HeapBlock.h | 4 +- .../water/memory/ReferenceCountedObject.h | 6 +- source/modules/water/midi/MidiBuffer.h | 4 +- .../modules/water/midi/MidiMessageSequence.h | 2 +- .../modules/water/processors/AudioProcessor.h | 4 +- .../water/processors/AudioProcessorGraph.cpp | 24 +- .../water/processors/AudioProcessorGraph.h | 8 +- .../modules/water/streams/FileInputSource.h | 4 +- source/modules/water/streams/InputStream.h | 4 +- .../modules/water/streams/MemoryInputStream.h | 4 +- .../water/streams/MemoryOutputStream.h | 4 +- source/modules/water/streams/OutputStream.h | 4 +- source/modules/water/threads/ChildProcess.cpp | 6 +- source/modules/water/threads/ChildProcess.h | 4 +- source/modules/water/threads/ScopedLock.h | 8 +- source/modules/water/threads/SpinLock.h | 4 +- source/modules/water/xml/XmlDocument.h | 4 +- source/native-plugins/audio-base.hpp | 6 +- source/native-plugins/audio-file.cpp | 2 +- source/native-plugins/bigmeter.cpp | 4 +- source/native-plugins/external | 2 +- source/plugin/carla-lv2-ui.cpp | 2 +- source/plugin/carla-vst.cpp | 6 +- source/plugin/ui_launcher.cpp | 2 +- source/theme/CarlaStyle.hpp | 2 +- source/theme/CarlaStylePlugin.hpp | 2 +- source/utils/CarlaBinaryUtils.hpp | 4 +- source/utils/CarlaBridgeUtils.hpp | 10 +- source/utils/CarlaDssiUtils.cpp | 20 +- source/utils/CarlaEngineUtils.hpp | 4 +- source/utils/CarlaJsfxUtils.hpp | 166 +++-------- source/utils/CarlaJuceUtils.hpp | 4 +- source/utils/CarlaLogThread.hpp | 2 +- source/utils/CarlaLv2Utils.hpp | 8 +- source/utils/CarlaMutex.hpp | 14 +- source/utils/CarlaOscUtils.hpp | 4 +- source/utils/CarlaPipeUtils.cpp | 4 +- source/utils/CarlaPluginUI.cpp | 4 +- source/utils/CarlaPluginUI.hpp | 4 +- source/utils/CarlaProcessUtils.hpp | 6 +- source/utils/CarlaRingBuffer.hpp | 8 +- source/utils/CarlaScopeUtils.hpp | 6 +- source/utils/CarlaStateUtils.hpp | 8 +- source/utils/CarlaThread.hpp | 4 +- source/utils/LinkedList.hpp | 6 +- source/utils/Lv2AtomRingBuffer.hpp | 4 +- source/utils/RtLinkedList.hpp | 6 +- source/utils/ThreadSafeFFTW.hpp | 4 +- 98 files changed, 548 insertions(+), 601 deletions(-) diff --git a/source/backend/CarlaEngine.hpp b/source/backend/CarlaEngine.hpp index 2cd61202c..839d49277 100644 --- a/source/backend/CarlaEngine.hpp +++ b/source/backend/CarlaEngine.hpp @@ -293,14 +293,14 @@ struct CARLA_API EngineOptions { Wine() noexcept; ~Wine() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(Wine) + CARLA_DECLARE_NON_COPYABLE(Wine) } wine; #endif #ifndef DOXYGEN EngineOptions() noexcept; ~EngineOptions() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(EngineOptions) + CARLA_DECLARE_NON_COPYABLE(EngineOptions) #endif }; @@ -426,7 +426,7 @@ protected: const bool kIsInput; const uint32_t kIndexOffset; - CARLA_DECLARE_NON_COPY_CLASS(CarlaEnginePort) + CARLA_DECLARE_NON_COPYABLE(CarlaEnginePort) #endif }; @@ -473,7 +473,7 @@ public: protected: float* fBuffer; - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngineAudioPort) + CARLA_DECLARE_NON_COPYABLE(CarlaEngineAudioPort) #endif }; @@ -535,7 +535,7 @@ protected: float* fBuffer; float fMinimum, fMaximum; - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngineCVPort) + CARLA_DECLARE_NON_COPYABLE(CarlaEngineCVPort) #endif }; @@ -626,7 +626,7 @@ protected: friend class CarlaPluginInstance; friend class CarlaEngineCVSourcePorts; - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngineEventPort) + CARLA_DECLARE_NON_COPYABLE(CarlaEngineEventPort) #endif }; @@ -682,7 +682,7 @@ protected: */ CarlaEngineCVSourcePorts(); - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngineCVSourcePorts) + CARLA_DECLARE_NON_COPYABLE(CarlaEngineCVSourcePorts) #endif }; @@ -795,7 +795,7 @@ protected: */ CarlaEngineClient(ProtectedData* pData); - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngineClient) + CARLA_DECLARE_NON_COPYABLE(CarlaEngineClient) #endif }; @@ -1387,7 +1387,7 @@ protected: // ------------------------------------------------------------------- - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngine) + CARLA_DECLARE_NON_COPYABLE(CarlaEngine) }; /**@}*/ diff --git a/source/backend/CarlaHost.h b/source/backend/CarlaHost.h index 591d7c44c..e02b92beb 100644 --- a/source/backend/CarlaHost.h +++ b/source/backend/CarlaHost.h @@ -138,7 +138,7 @@ typedef struct _CarlaPluginInfo { */ CARLA_API _CarlaPluginInfo() noexcept; CARLA_API ~_CarlaPluginInfo() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(_CarlaPluginInfo) + CARLA_DECLARE_NON_COPYABLE(_CarlaPluginInfo) #endif } CarlaPluginInfo; @@ -204,7 +204,7 @@ typedef struct _CarlaParameterInfo { */ CARLA_API _CarlaParameterInfo() noexcept; CARLA_API ~_CarlaParameterInfo() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(_CarlaParameterInfo) + CARLA_DECLARE_NON_COPYABLE(_CarlaParameterInfo) #endif } CarlaParameterInfo; @@ -230,7 +230,7 @@ typedef struct _CarlaScalePointInfo { */ CARLA_API _CarlaScalePointInfo() noexcept; CARLA_API ~_CarlaScalePointInfo() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(_CarlaScalePointInfo) + CARLA_DECLARE_NON_COPYABLE(_CarlaScalePointInfo) #endif } CarlaScalePointInfo; diff --git a/source/backend/CarlaHostImpl.hpp b/source/backend/CarlaHostImpl.hpp index 0d2611c77..5f4d8dc48 100644 --- a/source/backend/CarlaHostImpl.hpp +++ b/source/backend/CarlaHostImpl.hpp @@ -87,7 +87,7 @@ struct CarlaHostStandalone : CarlaHostHandleImpl { } CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_STRUCT(CarlaHostStandalone) + CARLA_DECLARE_NON_COPYABLE(CarlaHostStandalone) }; // -------------------------------------------------------------------------------------------------------------------- diff --git a/source/backend/CarlaPlugin.hpp b/source/backend/CarlaPlugin.hpp index 8b398cec1..fe581bcfe 100644 --- a/source/backend/CarlaPlugin.hpp +++ b/source/backend/CarlaPlugin.hpp @@ -586,7 +586,7 @@ public: /*! * Overloaded function, to be called from within RT context only. */ - virtual void setParameterValueRT(uint32_t parameterId, float value, bool sendCallbackLater) noexcept; + virtual void setParameterValueRT(uint32_t parameterId, float value, uint32_t frameOffset, bool sendCallbackLater) noexcept; /*! * Set a plugin's parameter value, including internal parameters. @@ -1040,7 +1040,7 @@ protected: bool fWasEnabled; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(ScopedDisabler) + CARLA_DECLARE_NON_COPYABLE(ScopedDisabler) }; /*! @@ -1059,12 +1059,12 @@ protected: const bool fBlock; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(ScopedSingleProcessLocker) + CARLA_DECLARE_NON_COPYABLE(ScopedSingleProcessLocker) }; friend class CarlaEngine; friend class CarlaEngineBridge; - CARLA_DECLARE_NON_COPY_CLASS(CarlaPlugin) + CARLA_DECLARE_NON_COPYABLE(CarlaPlugin) }; /**@}*/ diff --git a/source/backend/CarlaStandaloneNSM.cpp b/source/backend/CarlaStandaloneNSM.cpp index 01c22b5bf..a36e4caf0 100644 --- a/source/backend/CarlaStandaloneNSM.cpp +++ b/source/backend/CarlaStandaloneNSM.cpp @@ -1,6 +1,6 @@ /* * Carla Standalone - * Copyright (C) 2011-2020 Filipe Coelho + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -635,7 +635,7 @@ private: #undef handlePtr CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaNSM) + CARLA_DECLARE_NON_COPYABLE(CarlaNSM) }; #endif // HAVE_LIBLO diff --git a/source/backend/CarlaUtils.h b/source/backend/CarlaUtils.h index bc55f5427..84afd346b 100644 --- a/source/backend/CarlaUtils.h +++ b/source/backend/CarlaUtils.h @@ -133,7 +133,7 @@ typedef struct _CarlaCachedPluginInfo { * C++ constructor. */ CARLA_API _CarlaCachedPluginInfo() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(_CarlaCachedPluginInfo) + CARLA_DECLARE_NON_COPYABLE(_CarlaCachedPluginInfo) #endif } CarlaCachedPluginInfo; diff --git a/source/backend/engine/CarlaEngineBridge.cpp b/source/backend/engine/CarlaEngineBridge.cpp index 0d32e9779..bcacb3176 100644 --- a/source/backend/engine/CarlaEngineBridge.cpp +++ b/source/backend/engine/CarlaEngineBridge.cpp @@ -88,7 +88,7 @@ protected: private: LatencyChangedCallback* const fLatencyCallback; - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngineBridgeClient) + CARLA_DECLARE_NON_COPYABLE(CarlaEngineBridgeClient) }; // ------------------------------------------------------------------- diff --git a/source/backend/engine/CarlaEngineClient.hpp b/source/backend/engine/CarlaEngineClient.hpp index fb40c671c..7beb46707 100644 --- a/source/backend/engine/CarlaEngineClient.hpp +++ b/source/backend/engine/CarlaEngineClient.hpp @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2020 Filipe Coelho + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -63,7 +63,7 @@ struct CarlaEngineClient::ProtectedData { #ifdef CARLA_PROPER_CPP11_SUPPORT ProtectedData() = delete; - CARLA_DECLARE_NON_COPY_STRUCT(ProtectedData) + CARLA_DECLARE_NON_COPYABLE(ProtectedData) #endif }; @@ -96,7 +96,7 @@ protected: return pData->plugin; } - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngineClientForStandalone) + CARLA_DECLARE_NON_COPYABLE(CarlaEngineClientForStandalone) }; typedef CarlaEngineClientForStandalone CarlaEngineClientForSubclassing; #else @@ -112,7 +112,7 @@ public: delete pData; } - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngineClientForBridge) + CARLA_DECLARE_NON_COPYABLE(CarlaEngineClientForBridge) }; typedef CarlaEngineClientForBridge CarlaEngineClientForSubclassing; #endif diff --git a/source/backend/engine/CarlaEngineGraph.hpp b/source/backend/engine/CarlaEngineGraph.hpp index cf74c372b..fb35de1b2 100644 --- a/source/backend/engine/CarlaEngineGraph.hpp +++ b/source/backend/engine/CarlaEngineGraph.hpp @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2018 Filipe Coelho + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -81,7 +81,7 @@ struct ExternalGraphPorts { uint getPortId(bool isInput, const char portName[], bool* ok = nullptr) const noexcept; ExternalGraphPorts() noexcept; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(ExternalGraphPorts) + CARLA_DECLARE_NON_COPYABLE(ExternalGraphPorts) }; struct ExternalGraph { @@ -108,7 +108,7 @@ struct ExternalGraph { CarlaEngine* const kEngine; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(ExternalGraph) + CARLA_DECLARE_NON_COPYABLE(ExternalGraph) }; // ----------------------------------------------------------------------- @@ -134,7 +134,7 @@ struct RackGraph { ~Buffers() noexcept; void setBufferSize(uint32_t bufferSize, bool createBuffers) noexcept; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(Buffers) + CARLA_DECLARE_NON_COPYABLE(Buffers) } audioBuffers; RackGraph(CarlaEngine* engine, uint32_t inputs, uint32_t outputs) noexcept; @@ -157,7 +157,7 @@ struct RackGraph { void processHelper(CarlaEngine::ProtectedData* data, const float* const* inBuf, float* const* outBuf, uint32_t frames); CarlaEngine* const kEngine; - CARLA_DECLARE_NON_COPY_CLASS(RackGraph) + CARLA_DECLARE_NON_COPYABLE(RackGraph) }; // ----------------------------------------------------------------------- @@ -219,7 +219,7 @@ private: void run() override; CarlaEngine* const kEngine; - CARLA_DECLARE_NON_COPY_CLASS(PatchbayGraph) + CARLA_DECLARE_NON_COPYABLE(PatchbayGraph) }; // ----------------------------------------------------------------------- diff --git a/source/backend/engine/CarlaEngineInternal.hpp b/source/backend/engine/CarlaEngineInternal.hpp index bf8ab1763..112ca9d4f 100644 --- a/source/backend/engine/CarlaEngineInternal.hpp +++ b/source/backend/engine/CarlaEngineInternal.hpp @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2020 Filipe Coelho + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -64,7 +64,7 @@ struct EngineInternalEvents { ~EngineInternalEvents() noexcept; void clear() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(EngineInternalEvents) + CARLA_DECLARE_NON_COPYABLE(EngineInternalEvents) }; #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH @@ -137,7 +137,7 @@ private: CarlaEngine* const kEngine; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_STRUCT(EngineInternalGraph) + CARLA_DECLARE_NON_COPYABLE(EngineInternalGraph) }; #endif // BUILD_BRIDGE_ALTERNATIVE_ARCH @@ -174,7 +174,7 @@ private: Hylia(); ~Hylia(); - CARLA_DECLARE_NON_COPY_STRUCT(Hylia) + CARLA_DECLARE_NON_COPYABLE(Hylia) } hylia; #endif @@ -188,7 +188,7 @@ private: friend class CarlaEngineJack; void fillJackTimeInfo(jack_position_t* pos, uint32_t newFrames) noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(EngineInternalTime) + CARLA_DECLARE_NON_COPYABLE(EngineInternalTime) }; // ----------------------------------------------------------------------- @@ -218,7 +218,7 @@ struct EngineNextAction { ~EngineNextAction() noexcept; void clearAndReset() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(EngineNextAction) + CARLA_DECLARE_NON_COPYABLE(EngineNextAction) }; // ----------------------------------------------------------------------- @@ -323,7 +323,7 @@ struct CarlaEngine::ProtectedData { #ifdef CARLA_PROPER_CPP11_SUPPORT ProtectedData() = delete; - CARLA_DECLARE_NON_COPY_STRUCT(ProtectedData) + CARLA_DECLARE_NON_COPYABLE(ProtectedData) #endif }; @@ -342,7 +342,7 @@ private: int64_t prevTime; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(PendingRtEventsRunner) + CARLA_DECLARE_NON_COPYABLE(PendingRtEventsRunner) }; // ----------------------------------------------------------------------- @@ -357,7 +357,7 @@ private: CarlaEngine::ProtectedData* const pData; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(ScopedActionLock) + CARLA_DECLARE_NON_COPYABLE(ScopedActionLock) }; // ----------------------------------------------------------------------- @@ -373,7 +373,7 @@ private: CarlaEngine::ProtectedData* const pData; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(ScopedThreadStopper) + CARLA_DECLARE_NON_COPYABLE(ScopedThreadStopper) }; // ----------------------------------------------------------------------- diff --git a/source/backend/engine/CarlaEngineJack.cpp b/source/backend/engine/CarlaEngineJack.cpp index aeb7b13f8..46358c6e2 100644 --- a/source/backend/engine/CarlaEngineJack.cpp +++ b/source/backend/engine/CarlaEngineJack.cpp @@ -771,7 +771,7 @@ private: EngineEvent* fBuffer; EngineEvent* fBufferToDeleteLater; - CARLA_DECLARE_NON_COPY_CLASS(CarlaEngineJackCVSourcePorts) + CARLA_DECLARE_NON_COPYABLE(CarlaEngineJackCVSourcePorts) }; #endif diff --git a/source/backend/engine/CarlaEngineNative.cpp b/source/backend/engine/CarlaEngineNative.cpp index 18cf668df..9f3e672aa 100644 --- a/source/backend/engine/CarlaEngineNative.cpp +++ b/source/backend/engine/CarlaEngineNative.cpp @@ -1019,7 +1019,7 @@ protected: { uint32_t rindex = index; if (const CarlaPluginPtr plugin = _getPluginForParameterIndex(rindex)) - plugin->setParameterValueRT(rindex, value, false); + plugin->setParameterValueRT(rindex, value, 0, false); fParameters[index] = value; } @@ -1710,7 +1710,7 @@ private: CarlaJUCE::dispatchMessageManagerMessages(); } - CARLA_DECLARE_NON_COPY_STRUCT(ScopedJuceMessageThreadRunner) + CARLA_DECLARE_NON_COPYABLE(ScopedJuceMessageThreadRunner) }; #endif diff --git a/source/backend/engine/CarlaEnginePorts.hpp b/source/backend/engine/CarlaEnginePorts.hpp index 31ec38289..a1e9189e0 100644 --- a/source/backend/engine/CarlaEnginePorts.hpp +++ b/source/backend/engine/CarlaEnginePorts.hpp @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2020 Filipe Coelho + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -63,7 +63,7 @@ struct CarlaEngineCVSourcePorts::ProtectedData { cvs.clear(); } - CARLA_DECLARE_NON_COPY_STRUCT(ProtectedData) + CARLA_DECLARE_NON_COPYABLE(ProtectedData) }; #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH diff --git a/source/backend/plugin/CarlaPlugin.cpp b/source/backend/plugin/CarlaPlugin.cpp index d92e15d01..58eae8963 100644 --- a/source/backend/plugin/CarlaPlugin.cpp +++ b/source/backend/plugin/CarlaPlugin.cpp @@ -75,7 +75,7 @@ struct ParamSymbol { #ifdef CARLA_PROPER_CPP11_SUPPORT ParamSymbol() = delete; - CARLA_DECLARE_NON_COPY_STRUCT(ParamSymbol) + CARLA_DECLARE_NON_COPYABLE(ParamSymbol) #endif }; @@ -573,7 +573,7 @@ const CarlaStateSave& CarlaPlugin::getStateSave(const bool callPrepareForSave) { pData->stateSave.chunk = CarlaString::asBase64(data, dataSize).dup(); - if (pluginType != PLUGIN_INTERNAL) + if (pluginType != PLUGIN_INTERNAL && pluginType != PLUGIN_JSFX) usingChunk = true; } } @@ -1672,7 +1672,7 @@ void CarlaPlugin::setParameterValue(const uint32_t parameterId, const float valu nullptr); } -void CarlaPlugin::setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept +void CarlaPlugin::setParameterValueRT(const uint32_t parameterId, const float value, uint32_t, const bool sendCallbackLater) noexcept { pData->postponeParameterChangeRtEvent(sendCallbackLater, static_cast(parameterId), value); } diff --git a/source/backend/plugin/CarlaPluginBridge.cpp b/source/backend/plugin/CarlaPluginBridge.cpp index 04ae4bb6c..d4132f132 100644 --- a/source/backend/plugin/CarlaPluginBridge.cpp +++ b/source/backend/plugin/CarlaPluginBridge.cpp @@ -79,7 +79,7 @@ struct BridgeParamInfo { symbol(), unit() {} - CARLA_DECLARE_NON_COPY_STRUCT(BridgeParamInfo) + CARLA_DECLARE_NON_COPYABLE(BridgeParamInfo) }; // --------------------------------------------------------------------------------------------------------------------- @@ -771,7 +771,7 @@ public: CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); } - void setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept override + void setParameterValueRT(const uint32_t parameterId, const float value, const uint32_t frameOffset, const bool sendCallbackLater) noexcept override { CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); @@ -788,7 +788,7 @@ public: fShmNonRtClientControl.waitIfDataIsReachingLimit(); } - CarlaPlugin::setParameterValueRT(parameterId, fixedValue, sendCallbackLater); + CarlaPlugin::setParameterValueRT(parameterId, fixedValue, frameOffset, sendCallbackLater); } void setParameterMidiChannel(const uint32_t parameterId, const uint8_t channel, const bool sendOsc, const bool sendCallback) noexcept override @@ -1503,7 +1503,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); continue; } @@ -1564,7 +1564,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); } #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH @@ -2989,7 +2989,7 @@ private: char* strBuf; CarlaMutex mutex; - CARLA_DECLARE_NON_COPY_CLASS(ReceivingParamText) + CARLA_DECLARE_NON_COPYABLE(ReceivingParamText) } fReceivingParamText; struct Info { @@ -3081,7 +3081,7 @@ private: aIns = aOuts = cvIns = cvOuts = 0; } - CARLA_DECLARE_NON_COPY_STRUCT(Info) + CARLA_DECLARE_NON_COPYABLE(Info) } fInfo; int64_t fUniqueId; diff --git a/source/backend/plugin/CarlaPluginFluidSynth.cpp b/source/backend/plugin/CarlaPluginFluidSynth.cpp index abb71842a..37339530f 100644 --- a/source/backend/plugin/CarlaPluginFluidSynth.cpp +++ b/source/backend/plugin/CarlaPluginFluidSynth.cpp @@ -424,11 +424,11 @@ public: CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); } - void setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept override + void setParameterValueRT(const uint32_t parameterId, const float value, const uint32_t frameOffset, const bool sendCallbackLater) noexcept override { const float fixedValue = setParameterValueInFluidSynth(parameterId, value); - CarlaPlugin::setParameterValueRT(parameterId, fixedValue, sendCallbackLater); + CarlaPlugin::setParameterValueRT(parameterId, fixedValue, frameOffset, sendCallbackLater); } float setParameterValueInFluidSynth(const uint32_t parameterId, const float value) noexcept @@ -1299,7 +1299,7 @@ public: continue; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); } if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE) diff --git a/source/backend/plugin/CarlaPluginInternal.hpp b/source/backend/plugin/CarlaPluginInternal.hpp index 4ffb00af8..78051a8ec 100644 --- a/source/backend/plugin/CarlaPluginInternal.hpp +++ b/source/backend/plugin/CarlaPluginInternal.hpp @@ -1,6 +1,6 @@ /* * Carla Plugin - * Copyright (C) 2011-2019 Filipe Coelho + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -142,7 +142,7 @@ struct PluginAudioData { void clear() noexcept; void initBuffers() const noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(PluginAudioData) + CARLA_DECLARE_NON_COPYABLE(PluginAudioData) }; // ----------------------------------------------------------------------- @@ -163,7 +163,7 @@ struct PluginCVData { void clear() noexcept; void initBuffers() const noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(PluginCVData) + CARLA_DECLARE_NON_COPYABLE(PluginCVData) }; // ----------------------------------------------------------------------- @@ -180,7 +180,7 @@ struct PluginEventData { void clear() noexcept; void initBuffers() const noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(PluginEventData) + CARLA_DECLARE_NON_COPYABLE(PluginEventData) }; // ----------------------------------------------------------------------- @@ -199,7 +199,7 @@ struct PluginParameterData { float getFinalUnnormalizedValue(uint32_t parameterId, float normalizedValue) const noexcept; float getFinalValueWithMidiDelta(uint32_t parameterId, float value, int8_t delta) const noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(PluginParameterData) + CARLA_DECLARE_NON_COPYABLE(PluginParameterData) }; // ----------------------------------------------------------------------- @@ -216,7 +216,7 @@ struct PluginProgramData { void createNew(uint32_t newCount); void clear() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(PluginProgramData) + CARLA_DECLARE_NON_COPYABLE(PluginProgramData) }; // ----------------------------------------------------------------------- @@ -232,7 +232,7 @@ struct PluginMidiProgramData { void clear() noexcept; const MidiProgramData& getCurrent() const noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(PluginMidiProgramData) + CARLA_DECLARE_NON_COPYABLE(PluginMidiProgramData) }; // ----------------------------------------------------------------------- @@ -298,7 +298,7 @@ struct CarlaPlugin::ProtectedData { void appendNonRT(const ExternalMidiNote& note) noexcept; void clear() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(ExternalNotes) + CARLA_DECLARE_NON_COPYABLE(ExternalNotes) } extNotes; @@ -316,7 +316,7 @@ struct CarlaPlugin::ProtectedData { void recreateBuffers(uint32_t newChannels, uint32_t newFrames); #endif - CARLA_DECLARE_NON_COPY_STRUCT(Latency) + CARLA_DECLARE_NON_COPYABLE(Latency) } latency; @@ -368,7 +368,7 @@ struct CarlaPlugin::ProtectedData { CarlaMutex dataPendingMutex; CarlaMutex poolMutex; - CARLA_DECLARE_NON_COPY_CLASS(PostRtEvents) + CARLA_DECLARE_NON_COPYABLE(PostRtEvents) } postRtEvents; @@ -381,7 +381,7 @@ struct CarlaPlugin::ProtectedData { void append(const PluginPostRtEvent& event) noexcept; void clear() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(PostUiEvents) + CARLA_DECLARE_NON_COPYABLE(PostUiEvents) } postUiEvents; @@ -395,7 +395,7 @@ struct CarlaPlugin::ProtectedData { PostProc() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(PostProc) + CARLA_DECLARE_NON_COPYABLE(PostProc) } postProc; #endif @@ -457,7 +457,7 @@ struct CarlaPlugin::ProtectedData { #ifdef CARLA_PROPER_CPP11_SUPPORT ProtectedData() = delete; - CARLA_DECLARE_NON_COPY_STRUCT(ProtectedData); + CARLA_DECLARE_NON_COPYABLE(ProtectedData); #endif CARLA_LEAK_DETECTOR(ProtectedData); }; diff --git a/source/backend/plugin/CarlaPluginJSFX.cpp b/source/backend/plugin/CarlaPluginJSFX.cpp index 6d4919f48..b4f991801 100644 --- a/source/backend/plugin/CarlaPluginJSFX.cpp +++ b/source/backend/plugin/CarlaPluginJSFX.cpp @@ -49,12 +49,19 @@ class CarlaPluginJSFX : public CarlaPlugin public: CarlaPluginJSFX(CarlaEngine* const engine, const uint id) noexcept : CarlaPlugin(engine, id), + fEffect(nullptr), + fEffectState(nullptr), + fUnit(), + fChunkText(), + fTransportValues(), fMapOfSliderToParameter(ysfx_max_sliders, -1) { carla_debug("CarlaPluginJSFX::CarlaPluginJSFX(%p, %i)", engine, id); + + carla_zeroStruct(fTransportValues); } - ~CarlaPluginJSFX() + ~CarlaPluginJSFX() noexcept override { carla_debug("CarlaPluginJSFX::~CarlaPluginJSFX()"); @@ -71,6 +78,9 @@ public: } clearBuffers(); + + ysfx_state_free(fEffectState); + ysfx_free(fEffect); } // ------------------------------------------------------------------- @@ -85,15 +95,15 @@ public: { CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr, CarlaPlugin::getCategory()); - return CarlaJsfxCategories::getFromEffect(fEffect.get()); + return CarlaJsfxCategories::getFromEffect(fEffect); } uint32_t getLatencyInFrames() const noexcept override { CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr, 0); - ysfx_real sampleRate = ysfx_get_sample_rate(fEffect.get()); - ysfx_real latencyInSeconds = ysfx_get_pdc_delay(fEffect.get()); + ysfx_real sampleRate = ysfx_get_sample_rate(fEffect); + ysfx_real latencyInSeconds = ysfx_get_pdc_delay(fEffect); //NOTE: `pdc_bot_ch` and `pdc_top_ch` channel range ignored @@ -120,25 +130,24 @@ public: { CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count, 0); - int32_t rindex = pData->param.data[parameterId].rindex; - return ysfx_slider_get_enum_names(fEffect.get(), (uint32_t)rindex, nullptr, 0);; + const uint32_t rindex = static_cast(pData->param.data[parameterId].rindex); + return ysfx_slider_get_enum_names(fEffect, rindex, nullptr, 0);; } // ------------------------------------------------------------------- // Information (current data) - std::size_t getChunkData(void** dataPtr) noexcept override + std::size_t getChunkData(void** const dataPtr) noexcept override { CARLA_SAFE_ASSERT_RETURN(pData->options & PLUGIN_OPTION_USE_CHUNKS, 0); CARLA_SAFE_ASSERT_RETURN(dataPtr != nullptr, 0); - ysfx_state_u state(ysfx_save_state(fEffect.get())); - CARLA_SAFE_ASSERT_RETURN(state, 0); - - fChunkText = CarlaJsfxState::convertToString(*state); + ysfx_state_free(fEffectState); + fEffectState = ysfx_save_state(fEffect); + CARLA_SAFE_ASSERT_RETURN(fEffectState != nullptr, 0); - *dataPtr = (void*)fChunkText.toRawUTF8(); - return (std::size_t)fChunkText.getNumBytesAsUTF8(); + *dataPtr = fEffectState->data; + return fEffectState->data_size; } // ------------------------------------------------------------------- @@ -165,8 +174,8 @@ public: { CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count, 0.0f); - int32_t rindex = pData->param.data[parameterId].rindex; - return ysfx_slider_get_value(fEffect.get(), (uint32_t)rindex); + const uint32_t rindex = static_cast(pData->param.data[parameterId].rindex); + return static_cast(ysfx_slider_get_value(fEffect, rindex)); } bool getParameterName(const uint32_t parameterId, char* const strBuf) const noexcept override @@ -174,35 +183,15 @@ public: CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr, false); CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count, false); - int32_t rindex = pData->param.data[parameterId].rindex; - const char *name = ysfx_slider_get_name(fEffect.get(), (uint32_t)rindex); - std::snprintf(strBuf, STR_MAX, "%s", name); - return true; - } - - - bool getParameterText(const uint32_t parameterId, char* const strBuf) noexcept override - { - CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr, false); - CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count, false); - - int32_t rindex = pData->param.data[parameterId].rindex; - float value = ysfx_slider_get_value(fEffect.get(), (uint32_t)rindex); + const uint32_t rindex = static_cast(pData->param.data[parameterId].rindex); - int32_t enumIndex = -1; - if (ysfx_slider_is_enum(fEffect.get(), (uint32_t)rindex)) + if (const char* const name = ysfx_slider_get_name(fEffect, rindex)) { - uint32_t enumCount = ysfx_slider_get_enum_names(fEffect.get(), (uint32_t)rindex, nullptr, 0); - if ((int32_t)value >= 0 && (uint32_t)value < enumCount) - enumIndex = (int32_t)value; + std::snprintf(strBuf, STR_MAX, "%s", name); + return true; } - if (enumIndex != -1) - std::snprintf(strBuf, STR_MAX, "%s", ysfx_slider_get_name(fEffect.get(), (uint32_t)enumIndex)); - else - std::snprintf(strBuf, STR_MAX, "%.12g", value); - - return true; + return false; } float getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId) const noexcept override @@ -216,13 +205,18 @@ public: { CARLA_SAFE_ASSERT_RETURN(parameterId < getParameterCount(), false); - int32_t rindex = pData->param.data[parameterId].rindex; + const uint32_t rindex = static_cast(pData->param.data[parameterId].rindex); - uint32_t enumCount = ysfx_slider_get_enum_names(fEffect.get(), (uint32_t)rindex, nullptr, 0); + const uint32_t enumCount = ysfx_slider_get_enum_names(fEffect, rindex, nullptr, 0); CARLA_SAFE_ASSERT_RETURN(scalePointId < enumCount, false); - std::snprintf(strBuf, STR_MAX, "%s", ysfx_slider_get_enum_name(fEffect.get(), (uint32_t)rindex, scalePointId)); - return true; + if (const char* const name = ysfx_slider_get_enum_name(fEffect, rindex, scalePointId)) + { + std::snprintf(strBuf, STR_MAX, "%s", name); + return true; + } + + return false; } bool getLabel(char* const strBuf) const noexcept override @@ -239,32 +233,34 @@ public: CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr,); CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); - int32_t rindex = pData->param.data[parameterId].rindex; - ysfx_slider_set_value(fEffect.get(), rindex, value); + const uint32_t rindex = static_cast(pData->param.data[parameterId].rindex); + ysfx_slider_set_value(fEffect, rindex, value); CarlaPlugin::setParameterValue(parameterId, value, sendGui, sendOsc, sendCallback); } - void setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept override + void setParameterValueRT(const uint32_t parameterId, const float value, const uint32_t frameOffset, const bool sendCallbackLater) noexcept override { CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr,); CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); - int32_t rindex = pData->param.data[parameterId].rindex; - ysfx_slider_set_value(fEffect.get(), rindex, value); + const uint32_t rindex = static_cast(pData->param.data[parameterId].rindex); + ysfx_slider_set_value(fEffect, rindex, value); - CarlaPlugin::setParameterValueRT(parameterId, value, sendCallbackLater); + CarlaPlugin::setParameterValueRT(parameterId, value, frameOffset, sendCallbackLater); } void setChunkData(const void* data, std::size_t dataSize) override { CARLA_SAFE_ASSERT_RETURN(pData->options & PLUGIN_OPTION_USE_CHUNKS,); - water::String dataText(water::CharPointer_UTF8((const char*)data), dataSize); + ysfx_state_t state; + state.sliders = nullptr; + state.slider_count = 0; + state.data = static_cast(const_cast(data)); + state.data_size = dataSize; - ysfx_state_u state(CarlaJsfxState::convertFromString(dataText)); - CARLA_SAFE_ASSERT_RETURN(state,); - CARLA_SAFE_ASSERT_RETURN(ysfx_load_state(fEffect.get(), state.get()),); + CARLA_SAFE_ASSERT(ysfx_load_state(fEffect, &state)); } // ------------------------------------------------------------------- @@ -290,12 +286,12 @@ public: // initialize the block size and sample rate // loading the chunk can invoke @slider which makes computations based on these - ysfx_set_sample_rate(fEffect.get(), pData->engine->getSampleRate()); - ysfx_set_block_size(fEffect.get(), (uint32_t)pData->engine->getBufferSize()); - ysfx_init(fEffect.get()); + ysfx_set_sample_rate(fEffect, pData->engine->getSampleRate()); + ysfx_set_block_size(fEffect, (uint32_t)pData->engine->getBufferSize()); + ysfx_init(fEffect); - const uint32_t aIns = ysfx_get_num_inputs(fEffect.get()); - const uint32_t aOuts = ysfx_get_num_outputs(fEffect.get()); + const uint32_t aIns = ysfx_get_num_inputs(fEffect); + const uint32_t aOuts = ysfx_get_num_outputs(fEffect); // perhaps we obtained a latency value from @init pData->client->setLatency(getLatencyInFrames()); @@ -315,7 +311,7 @@ public: uint32_t mapOfParameterToSlider[ysfx_max_sliders]; for (uint32_t rindex = 0; rindex < ysfx_max_sliders; ++rindex) { - if (ysfx_slider_exists(fEffect.get(), rindex)) + if (ysfx_slider_exists(fEffect, rindex)) { mapOfParameterToSlider[params] = rindex; fMapOfSliderToParameter[rindex] = (int32_t)params; @@ -332,7 +328,7 @@ public: pData->param.createNew(params, false); } - const uint portNameSize(pData->engine->getMaxPortNameSize()); + const uint portNameSize = pData->engine->getMaxPortNameSize(); CarlaString portName; // Audio Ins @@ -346,7 +342,7 @@ public: portName += ":"; } - const char* const inputName = ysfx_get_input_name(fEffect.get(), j); + const char* const inputName = ysfx_get_input_name(fEffect, j); if (inputName && inputName[0]) { portName += inputName; @@ -376,7 +372,7 @@ public: portName += ":"; } - const char* const outputName = ysfx_get_input_name(fEffect.get(), j); + const char* const outputName = ysfx_get_input_name(fEffect, j); if (outputName && outputName[0]) { portName += outputName; @@ -404,21 +400,24 @@ public: pData->param.data[j].rindex = (int32_t)rindex; ysfx_slider_range_t range = {}; - ysfx_slider_get_range(fEffect.get(), rindex, &range); + ysfx_slider_get_range(fEffect, rindex, &range); float min = (float)range.min; float max = (float)range.max; float def = (float)range.def; float step = (float)range.inc; + float stepSmall; + float stepLarge; // only use values as integer if we have a proper range - bool isEnum = ysfx_slider_is_enum(fEffect.get(), rindex) && - min == 0.0f && max >= 0.0f && - max + 1.0f == (float)ysfx_slider_get_enum_names(fEffect.get(), rindex, nullptr, 0); + const bool isEnum = ysfx_slider_is_enum(fEffect, rindex) && + carla_isZero(min) && + max >= 0.0f && + carla_isEqual(max + 1.0f, static_cast(ysfx_slider_get_enum_names(fEffect, rindex, nullptr, 0))); // NOTE: in case of incomplete slider specification without ; // these are usually output-only sliders. - if (min == max) + if (carla_isEqual(min, max)) { // replace with a dummy range min = 0.0f; @@ -433,30 +432,20 @@ public: else if (def > max) def = max; - float stepSmall; - float stepLarge; + pData->param.data[j].hints |= PARAMETER_IS_ENABLED; + if (isEnum) { step = 1.0f; stepSmall = 1.0f; stepLarge = 10.0f; - } - else - { - stepSmall = step/10.0f; - stepLarge = step*10.0f; - } - - pData->param.data[j].hints |= PARAMETER_IS_ENABLED; - - if (isEnum) - { pData->param.data[j].hints |= PARAMETER_IS_INTEGER; pData->param.data[j].hints |= PARAMETER_USES_SCALEPOINTS; - pData->param.data[j].hints |= PARAMETER_USES_CUSTOM_TEXT; } else { + stepSmall = step/10.0f; + stepLarge = step*10.0f; pData->param.data[j].hints |= PARAMETER_CAN_BE_CV_CONTROLLED; } @@ -508,9 +497,9 @@ public: { CARLA_SAFE_ASSERT_RETURN(fEffect,); - ysfx_set_sample_rate(fEffect.get(), pData->engine->getSampleRate()); - ysfx_set_block_size(fEffect.get(), (uint32_t)pData->engine->getBufferSize()); - ysfx_init(fEffect.get()); + ysfx_set_sample_rate(fEffect, pData->engine->getSampleRate()); + ysfx_set_block_size(fEffect, (uint32_t)pData->engine->getBufferSize()); + ysfx_init(fEffect); fTransportValues.tempo = 120; fTransportValues.playback_state = ysfx_playback_paused; @@ -546,7 +535,7 @@ public: fTransportValues.time_signature[1] = (uint32_t)bbt.beatType; } - ysfx_set_time_info(fEffect.get(), &fTransportValues); + ysfx_set_time_info(fEffect, &fTransportValues); // -------------------------------------------------------------------------------------------------------- // Event Input and Processing @@ -573,7 +562,7 @@ public: event.offset = 0; event.size = 3; event.data = midiData; - ysfx_send_midi(fEffect.get(), &event); + ysfx_send_midi(fEffect, &event); } pData->extNotes.data.clear(); @@ -595,17 +584,6 @@ public: if (event.time >= frames) continue; - auto addInputEvent = [this] - (uint32_t offset, const uint8_t *data, uint32_t size) - { - ysfx_midi_event_t event; - event.bus = 0; - event.offset = offset; - event.size = size; - event.data = data; - ysfx_send_midi(fEffect.get(), &event); - }; - switch (event.type) { case kEngineEventTypeNull: @@ -631,7 +609,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); continue; } @@ -692,7 +670,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); } if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE) @@ -702,7 +680,12 @@ public: midiData[1] = uint8_t(ctrlEvent.param); midiData[2] = uint8_t(ctrlEvent.normalizedValue*127.0f); - addInputEvent(event.time, midiData, 3); + ysfx_midi_event_t yevent; + yevent.bus = 0; + yevent.offset = event.time; + yevent.size = 3; + yevent.data = midiData; + ysfx_send_midi(fEffect, &yevent); } #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH @@ -719,11 +702,21 @@ public: midiData[0] = uint8_t(MIDI_STATUS_CONTROL_CHANGE | (event.channel & MIDI_CHANNEL_BIT)); midiData[1] = MIDI_CONTROL_BANK_SELECT; midiData[2] = 0; - addInputEvent(event.time, midiData, 3); + + ysfx_midi_event_t yevent; + yevent.bus = 0; + yevent.offset = event.time; + yevent.size = 3; + yevent.data = midiData; + ysfx_send_midi(fEffect, &yevent); midiData[1] = MIDI_CONTROL_BANK_SELECT__LSB; midiData[2] = uint8_t(ctrlEvent.normalizedValue*127.0f); - addInputEvent(event.time, midiData, 3); + yevent.bus = 0; + yevent.offset = event.time; + yevent.size = 3; + yevent.data = midiData; + ysfx_send_midi(fEffect, &yevent); } break; @@ -737,10 +730,15 @@ public: } else if ((pData->options & PLUGIN_OPTION_SEND_PROGRAM_CHANGES) != 0) { - uint8_t midiData[3]; + uint8_t midiData[2]; midiData[0] = uint8_t(MIDI_STATUS_PROGRAM_CHANGE | (event.channel & MIDI_CHANNEL_BIT)); midiData[1] = uint8_t(ctrlEvent.normalizedValue*127.0f); - addInputEvent(event.time, midiData, 2); + ysfx_midi_event_t yevent; + yevent.bus = 0; + yevent.offset = event.time; + yevent.size = 2; + yevent.data = midiData; + ysfx_send_midi(fEffect, &yevent); } break; @@ -751,8 +749,12 @@ public: midiData[0] = uint8_t(MIDI_STATUS_CONTROL_CHANGE | (event.channel & MIDI_CHANNEL_BIT)); midiData[1] = MIDI_CONTROL_ALL_SOUND_OFF; midiData[2] = 0; - - addInputEvent(event.time, midiData, 3); + ysfx_midi_event_t yevent; + yevent.bus = 0; + yevent.offset = event.time; + yevent.size = 3; + yevent.data = midiData; + ysfx_send_midi(fEffect, &yevent); } break; @@ -772,7 +774,12 @@ public: midiData[1] = MIDI_CONTROL_ALL_NOTES_OFF; midiData[2] = 0; - addInputEvent(event.time, midiData, 3); + ysfx_midi_event_t yevent; + yevent.bus = 0; + yevent.offset = event.time; + yevent.size = 3; + yevent.data = midiData; + ysfx_send_midi(fEffect, &yevent); } break; } // switch (ctrlEvent.type) @@ -806,7 +813,12 @@ public: midiData2[0] = uint8_t(status | (event.channel & MIDI_CHANNEL_BIT)); std::memcpy(midiData2+1, midiData+1, static_cast(midiEvent.size-1)); - addInputEvent(event.time, midiData2, midiEvent.size); + ysfx_midi_event_t yevent; + yevent.bus = midiEvent.port; + yevent.offset = event.time; + yevent.size = midiEvent.size; + yevent.data = midiData; + ysfx_send_midi(fEffect, &yevent); if (status == MIDI_STATUS_NOTE_ON) { @@ -827,9 +839,9 @@ public: // -------------------------------------------------------------------------------------------------------- // Plugin processing - const uint32_t numInputs = ysfx_get_num_inputs(fEffect.get()); - const uint32_t numOutputs = ysfx_get_num_outputs(fEffect.get()); - ysfx_process_float(fEffect.get(), audioIn, audioOut, numInputs, numOutputs, frames); + const uint32_t numInputs = ysfx_get_num_inputs(fEffect); + const uint32_t numOutputs = ysfx_get_num_outputs(fEffect); + ysfx_process_float(fEffect, audioIn, audioOut, numInputs, numOutputs, frames); // End of Plugin processing (no events) @@ -840,7 +852,7 @@ public: { ysfx_midi_event_t event; - while (ysfx_receive_midi(fEffect.get(), &event)) + while (ysfx_receive_midi(fEffect, &event)) { CARLA_SAFE_ASSERT_BREAK(event.offset < frames); CARLA_SAFE_ASSERT_BREAK(event.size > 0); @@ -858,8 +870,8 @@ public: // Control Output { - uint64_t changes = ysfx_fetch_slider_changes(fEffect.get()); - uint64_t automations = ysfx_fetch_slider_automations(fEffect.get()); + uint64_t changes = ysfx_fetch_slider_changes(fEffect); + uint64_t automations = ysfx_fetch_slider_automations(fEffect); if ((changes|automations) != 0) { @@ -875,8 +887,8 @@ public: int32_t parameterIndex = fMapOfSliderToParameter[rindex]; CARLA_SAFE_ASSERT_CONTINUE(parameterIndex != -1); - float newValue = ysfx_slider_get_value(fEffect.get(), (uint32_t)parameterIndex); - setParameterValueRT(parameterIndex, newValue, true); + const float newValue = static_cast(ysfx_slider_get_value(fEffect, (uint32_t)parameterIndex)); + setParameterValueRT((uint32_t)parameterIndex, newValue, 0, true); } } } @@ -944,7 +956,7 @@ public: const File currentPath(splitPaths[i]); const File currentFile = currentPath.getChildFile(CharPointer_UTF8(label)); const CarlaJsfxUnit currentUnit(currentPath, currentFile); - if (currentUnit.getFilePath().existsAsFile()) + if (File(currentUnit.getFilePath()).existsAsFile()) fUnit = currentUnit; } } @@ -961,8 +973,8 @@ public: ysfx_config_u config(ysfx_config_new()); CARLA_SAFE_ASSERT_RETURN(config != nullptr, false); - const water::String rootPath = fUnit.getRootPath().getFullPathName(); - const water::String filePath = fUnit.getFilePath().getFullPathName(); + const water::String rootPath = fUnit.getRootPath(); + const water::String filePath = fUnit.getFilePath(); ysfx_register_builtin_audio_formats(config.get()); ysfx_set_import_root(config.get(), rootPath.toRawUTF8()); @@ -970,14 +982,14 @@ public: ysfx_set_log_reporter(config.get(), &CarlaJsfxLogging::logAll); ysfx_set_user_data(config.get(), (intptr_t)this); - fEffect.reset(ysfx_new(config.get())); + fEffect = ysfx_new(config.get()); CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr, false); // --------------------------------------------------------------- // get info { - if (! ysfx_load_file(fEffect.get(), filePath.toRawUTF8(), 0)) + if (! ysfx_load_file(fEffect, filePath.toRawUTF8(), 0)) { pData->engine->setLastError("Failed to load JSFX"); return false; @@ -989,7 +1001,7 @@ public: | ysfx_compile_no_gfx ; - if (! ysfx_compile(fEffect.get(), compileFlags)) + if (! ysfx_compile(fEffect, compileFlags)) { pData->engine->setLastError("Failed to compile JSFX"); return false; @@ -1002,7 +1014,7 @@ public: } else { - pData->name = carla_strdup(ysfx_get_name(fEffect.get())); + pData->name = carla_strdup(ysfx_get_name(fEffect)); } pData->filename = carla_strdup(filePath.toRawUTF8()); @@ -1045,11 +1057,14 @@ public: } private: - ysfx_u fEffect = nullptr; + ysfx_t* fEffect; + ysfx_state_t* fEffectState; CarlaJsfxUnit fUnit; water::String fChunkText; - ysfx_time_info_t fTransportValues = {}; + ysfx_time_info_t fTransportValues; std::vector fMapOfSliderToParameter; + + CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaPluginJSFX) }; // ------------------------------------------------------------------------------------------------------------------- diff --git a/source/backend/plugin/CarlaPluginJack.cpp b/source/backend/plugin/CarlaPluginJack.cpp index 5c5047aaf..c95892055 100644 --- a/source/backend/plugin/CarlaPluginJack.cpp +++ b/source/backend/plugin/CarlaPluginJack.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin JACK - * Copyright (C) 2016-2020 Filipe Coelho + * Copyright (C) 2016-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -497,7 +497,7 @@ private: return true; } - CARLA_DECLARE_NON_COPY_STRUCT(ProjectData) + CARLA_DECLARE_NON_COPYABLE(ProjectData) } fProject; #endif @@ -1818,7 +1818,7 @@ private: setupLabel(), chunk() {} - CARLA_DECLARE_NON_COPY_STRUCT(Info) + CARLA_DECLARE_NON_COPYABLE(Info) } fInfo; void handleProcessStopped() noexcept diff --git a/source/backend/plugin/CarlaPluginJuce.cpp b/source/backend/plugin/CarlaPluginJuce.cpp index 5a6ee89cc..0b01e3361 100644 --- a/source/backend/plugin/CarlaPluginJuce.cpp +++ b/source/backend/plugin/CarlaPluginJuce.cpp @@ -371,7 +371,7 @@ public: CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); } - void setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept override + void setParameterValueRT(const uint32_t parameterId, const float value, const uint32_t frameOffset, const bool sendCallbackLater) noexcept override { CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr,); @@ -385,7 +385,7 @@ public: parameter->setValue(value); } CARLA_SAFE_EXCEPTION("setValue(RT)"); - CarlaPlugin::setParameterValueRT(parameterId, fixedValue, sendCallbackLater); + CarlaPlugin::setParameterValueRT(parameterId, fixedValue, frameOffset, sendCallbackLater); } void setChunkData(const void* const data, const std::size_t dataSize) override @@ -1083,7 +1083,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); continue; } @@ -1144,7 +1144,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); } if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE) @@ -1189,7 +1189,7 @@ public: } else if ((pData->options & PLUGIN_OPTION_SEND_PROGRAM_CHANGES) != 0) { - uint8_t midiData[3]; + uint8_t midiData[2]; midiData[0] = uint8_t(MIDI_STATUS_PROGRAM_CHANGE | (event.channel & MIDI_CHANNEL_BIT)); midiData[1] = uint8_t(ctrlEvent.normalizedValue*127.0f + 0.5f); fMidiBuffer.addEvent(midiData, 2, static_cast(event.time)); diff --git a/source/backend/plugin/CarlaPluginLADSPADSSI.cpp b/source/backend/plugin/CarlaPluginLADSPADSSI.cpp index afddfc659..b24224fec 100644 --- a/source/backend/plugin/CarlaPluginLADSPADSSI.cpp +++ b/source/backend/plugin/CarlaPluginLADSPADSSI.cpp @@ -732,7 +732,7 @@ public: CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); } - void setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept override + void setParameterValueRT(const uint32_t parameterId, const float value, const uint32_t frameOffset, const bool sendCallbackLater) noexcept override { CARLA_SAFE_ASSERT_RETURN(fParamBuffers != nullptr,); CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); @@ -740,7 +740,7 @@ public: const float fixedValue(pData->param.getFixedValue(parameterId, value)); fParamBuffers[parameterId] = fixedValue; - CarlaPlugin::setParameterValueRT(parameterId, fixedValue, sendCallbackLater); + CarlaPlugin::setParameterValueRT(parameterId, fixedValue, frameOffset, sendCallbackLater); } void setCustomData(const char* const type, const char* const key, const char* const value, const bool sendGui) override @@ -1657,7 +1657,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); continue; } @@ -1717,7 +1717,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); } if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE) diff --git a/source/backend/plugin/CarlaPluginLV2.cpp b/source/backend/plugin/CarlaPluginLV2.cpp index 8217491b9..97c9d2d02 100644 --- a/source/backend/plugin/CarlaPluginLV2.cpp +++ b/source/backend/plugin/CarlaPluginLV2.cpp @@ -263,7 +263,7 @@ struct Lv2EventData { } } - CARLA_DECLARE_NON_COPY_STRUCT(Lv2EventData) + CARLA_DECLARE_NON_COPYABLE(Lv2EventData) }; struct CarlaPluginLV2EventData { @@ -334,7 +334,7 @@ struct CarlaPluginLV2EventData { } } - CARLA_DECLARE_NON_COPY_STRUCT(CarlaPluginLV2EventData) + CARLA_DECLARE_NON_COPYABLE(CarlaPluginLV2EventData) }; // ------------------------------------------------------------------------------------------------------------------- @@ -482,7 +482,7 @@ struct CarlaPluginLV2Options { } } - CARLA_DECLARE_NON_COPY_STRUCT(CarlaPluginLV2Options); + CARLA_DECLARE_NON_COPYABLE(CarlaPluginLV2Options); }; // ------------------------------------------------------------------------------------------------------------------- @@ -1549,14 +1549,14 @@ public: CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); } - void setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept override + void setParameterValueRT(const uint32_t parameterId, const float value, const uint32_t frameOffset, const bool sendCallbackLater) noexcept override { CARLA_SAFE_ASSERT_RETURN(fParamBuffers != nullptr,); CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); const float fixedValue = setParamterValueCommon(parameterId, value); - CarlaPlugin::setParameterValueRT(parameterId, fixedValue, sendCallbackLater); + CarlaPlugin::setParameterValueRT(parameterId, fixedValue, frameOffset, sendCallbackLater); } void setCustomData(const char* const type, const char* const key, const char* const value, const bool sendGui) override @@ -4018,7 +4018,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); continue; } @@ -4084,7 +4084,7 @@ public: else value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); } if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE) @@ -6332,7 +6332,7 @@ public: { if (pData->param.data[i].rindex == rindex) { - setParameterValueRT(i, paramValue, true); + setParameterValueRT(i, paramValue, 0, true); break; } } @@ -7467,7 +7467,7 @@ private: uiresize(nullptr), uiprograms(nullptr) {} - CARLA_DECLARE_NON_COPY_STRUCT(Extensions); + CARLA_DECLARE_NON_COPYABLE(Extensions); } fExt; struct UI { @@ -7511,7 +7511,7 @@ private: CARLA_SAFE_ASSERT(window == nullptr); } - CARLA_DECLARE_NON_COPY_STRUCT(UI); + CARLA_DECLARE_NON_COPYABLE(UI); } fUI; // ------------------------------------------------------------------- diff --git a/source/backend/plugin/CarlaPluginNative.cpp b/source/backend/plugin/CarlaPluginNative.cpp index 4f22cb609..e5f64639d 100644 --- a/source/backend/plugin/CarlaPluginNative.cpp +++ b/source/backend/plugin/CarlaPluginNative.cpp @@ -1,6 +1,6 @@ /* * Carla Native Plugin - * Copyright (C) 2012-2020 Filipe Coelho + * Copyright (C) 2012-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -171,7 +171,7 @@ struct NativePluginMidiOutData { } } - CARLA_DECLARE_NON_COPY_STRUCT(NativePluginMidiOutData) + CARLA_DECLARE_NON_COPYABLE(NativePluginMidiOutData) }; struct NativePluginMidiInData : NativePluginMidiOutData { @@ -236,7 +236,7 @@ struct NativePluginMidiInData : NativePluginMidiOutData { } } - CARLA_DECLARE_NON_COPY_STRUCT(NativePluginMidiInData) + CARLA_DECLARE_NON_COPYABLE(NativePluginMidiInData) }; // ----------------------------------------------------- @@ -764,7 +764,7 @@ public: CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); } - void setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept override + void setParameterValueRT(const uint32_t parameterId, const float value, const uint32_t frameOffset, const bool sendCallbackLater) noexcept override { CARLA_SAFE_ASSERT_RETURN(fDescriptor != nullptr,); CARLA_SAFE_ASSERT_RETURN(fDescriptor->set_parameter_value != nullptr,); @@ -779,7 +779,7 @@ public: if (fHandle2 != nullptr) fDescriptor->set_parameter_value(fHandle2, parameterId, fixedValue); - CarlaPlugin::setParameterValueRT(parameterId, fixedValue, sendCallbackLater); + CarlaPlugin::setParameterValueRT(parameterId, fixedValue, frameOffset, sendCallbackLater); } void setCustomData(const char* const type, const char* const key, const char* const value, const bool sendGui) override @@ -1990,7 +1990,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); continue; } @@ -2050,7 +2050,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); } if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE) diff --git a/source/backend/plugin/CarlaPluginSFZero.cpp b/source/backend/plugin/CarlaPluginSFZero.cpp index a16ad03d1..05b4666ac 100644 --- a/source/backend/plugin/CarlaPluginSFZero.cpp +++ b/source/backend/plugin/CarlaPluginSFZero.cpp @@ -466,7 +466,7 @@ public: continue; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, eventTime, true); } if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE) diff --git a/source/backend/plugin/CarlaPluginVST2.cpp b/source/backend/plugin/CarlaPluginVST2.cpp index 369857f50..cedfb35a7 100644 --- a/source/backend/plugin/CarlaPluginVST2.cpp +++ b/source/backend/plugin/CarlaPluginVST2.cpp @@ -413,7 +413,7 @@ public: CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); } - void setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept override + void setParameterValueRT(const uint32_t parameterId, const float value, const uint32_t frameOffset, const bool sendCallbackLater) noexcept override { CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr,); CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); @@ -421,7 +421,7 @@ public: const float fixedValue(pData->param.getFixedValue(parameterId, value)); fEffect->setParameter(fEffect, static_cast(parameterId), fixedValue); - CarlaPlugin::setParameterValueRT(parameterId, fixedValue, sendCallbackLater); + CarlaPlugin::setParameterValueRT(parameterId, fixedValue, frameOffset, sendCallbackLater); } void setChunkData(const void* const data, const std::size_t dataSize) override @@ -1425,7 +1425,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); continue; } @@ -1486,7 +1486,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); } if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE) @@ -2768,7 +2768,7 @@ private: carla_zeroPointers(data, kPluginMaxMidiEvents*2); } - CARLA_DECLARE_NON_COPY_STRUCT(FixedVstEvents); + CARLA_DECLARE_NON_COPYABLE(FixedVstEvents); } fEvents; struct UI { @@ -2794,7 +2794,7 @@ private: } } - CARLA_DECLARE_NON_COPY_STRUCT(UI); + CARLA_DECLARE_NON_COPYABLE(UI); } fUI; int fUnique2; diff --git a/source/backend/plugin/CarlaPluginVST3.cpp b/source/backend/plugin/CarlaPluginVST3.cpp index 70c631227..02e865d8a 100644 --- a/source/backend/plugin/CarlaPluginVST3.cpp +++ b/source/backend/plugin/CarlaPluginVST3.cpp @@ -65,7 +65,7 @@ void strncpy_utf8(char* const dst, const int16_t* const src, const size_t length if (src[i] >= 0x80) continue; - dst[i] = src[i]; + dst[i] = static_cast(src[i]); } dst[len] = 0; } @@ -300,7 +300,8 @@ public: CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count, 0.0f); const double normalized = v3_cpp_obj(fV3.controller)->get_parameter_normalised(fV3.controller, parameterId); - return v3_cpp_obj(fV3.controller)->normalised_parameter_to_plain(fV3.controller, parameterId, normalized); + return static_cast( + v3_cpp_obj(fV3.controller)->normalised_parameter_to_plain(fV3.controller, parameterId, normalized)); } bool getLabel(char* const strBuf) const noexcept override @@ -332,7 +333,9 @@ public: CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count, false); v3_param_info paramInfo = {}; - CARLA_SAFE_ASSERT_RETURN(v3_cpp_obj(fV3.controller)->get_parameter_info(fV3.controller, parameterId, ¶mInfo) == V3_OK, false); + CARLA_SAFE_ASSERT_RETURN(v3_cpp_obj(fV3.controller)->get_parameter_info(fV3.controller, + static_cast(parameterId), + ¶mInfo) == V3_OK, false); strncpy_utf8(strBuf, paramInfo.title, STR_MAX); return true; @@ -363,7 +366,9 @@ public: CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count, false); v3_param_info paramInfo = {}; - CARLA_SAFE_ASSERT_RETURN(v3_cpp_obj(fV3.controller)->get_parameter_info(fV3.controller, parameterId, ¶mInfo) == V3_OK, false); + CARLA_SAFE_ASSERT_RETURN(v3_cpp_obj(fV3.controller)->get_parameter_info(fV3.controller, + static_cast(parameterId), + ¶mInfo) == V3_OK, false); strncpy_utf8(strBuf, paramInfo.units, STR_MAX); return true; @@ -393,7 +398,7 @@ public: CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); } - void setParameterValueRT(const uint32_t parameterId, const float value, const bool sendCallbackLater) noexcept override + void setParameterValueRT(const uint32_t parameterId, const float value, const uint32_t frameOffset, const bool sendCallbackLater) noexcept override { CARLA_SAFE_ASSERT_RETURN(fV3.controller != nullptr,); CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); @@ -402,7 +407,7 @@ public: // TODO append value to V3 changes queue list - CarlaPlugin::setParameterValueRT(parameterId, fixedValue, sendCallbackLater); + CarlaPlugin::setParameterValueRT(parameterId, fixedValue, frameOffset, sendCallbackLater); } // ------------------------------------------------------------------- @@ -473,7 +478,7 @@ public: if (v3_cpp_obj(fV3.view)->attached(fV3.view, fUI.window->getPtr(), V3_VIEW_PLATFORM_TYPE_NATIVE) == V3_OK) { v3_view_rect rect = {}; - if (v3_cpp_obj(fV3.view)->get_size(fV3.view, 0) == V3_OK) + if (v3_cpp_obj(fV3.view)->get_size(fV3.view, &rect) == V3_OK) { const int32_t width = rect.right - rect.left; const int32_t height = rect.bottom - rect.top; @@ -553,22 +558,24 @@ public: { v3_bus_info busInfo = {}; CARLA_SAFE_ASSERT_BREAK(v3_cpp_obj(fV3.component)->get_bus_info(fV3.component, V3_AUDIO, V3_INPUT, j, &busInfo) == V3_OK); + CARLA_SAFE_ASSERT_BREAK(busInfo.channel_count >= 0); if (busInfo.flags & V3_IS_CONTROL_VOLTAGE) - cvIns += busInfo.channel_count; + cvIns += static_cast(busInfo.channel_count); else - aIns += busInfo.channel_count; + aIns += static_cast(busInfo.channel_count); } for (int32_t j=0; jget_bus_info(fV3.component, V3_AUDIO, V3_OUTPUT, j, &busInfo) == V3_OK); + CARLA_SAFE_ASSERT_BREAK(busInfo.channel_count >= 0); if (busInfo.flags & V3_IS_CONTROL_VOLTAGE) - cvOuts += busInfo.channel_count; + cvOuts += static_cast(busInfo.channel_count); else - aOuts += busInfo.channel_count; + aOuts += static_cast(busInfo.channel_count); } for (int32_t j=0; jparam.data[j].rindex = ij; v3_param_info paramInfo = {}; - CARLA_SAFE_ASSERT_BREAK(v3_cpp_obj(fV3.controller)->get_parameter_info(fV3.controller, j, ¶mInfo) == V3_OK); + CARLA_SAFE_ASSERT_BREAK(v3_cpp_obj(fV3.controller)->get_parameter_info(fV3.controller, ij, ¶mInfo) == V3_OK); if (paramInfo.flags & (V3_PARAM_IS_BYPASS|V3_PARAM_IS_HIDDEN|V3_PARAM_PROGRAM_CHANGE)) continue; float min, max, def, step, stepSmall, stepLarge; - min = v3_cpp_obj(fV3.controller)->normalised_parameter_to_plain(fV3.controller, j, 0.0); - max = v3_cpp_obj(fV3.controller)->normalised_parameter_to_plain(fV3.controller, j, 1.0); - def = v3_cpp_obj(fV3.controller)->normalised_parameter_to_plain(fV3.controller, j, paramInfo.default_normalised_value); + min = static_cast(v3_cpp_obj(fV3.controller)->normalised_parameter_to_plain(fV3.controller, j, 0.0)); + max = static_cast(v3_cpp_obj(fV3.controller)->normalised_parameter_to_plain(fV3.controller, j, 1.0)); + def = static_cast(v3_cpp_obj(fV3.controller)->normalised_parameter_to_plain(fV3.controller, j, paramInfo.default_normalised_value)); if (min >= max) max = min + 0.1f; @@ -1121,7 +1128,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); continue; } @@ -1182,7 +1189,7 @@ public: ctrlEvent.handled = true; value = pData->param.getFinalUnnormalizedValue(k, ctrlEvent.normalizedValue); - setParameterValueRT(k, value, true); + setParameterValueRT(k, value, event.time, true); } if ((pData->options & PLUGIN_OPTION_SEND_CONTROL_CHANGES) != 0 && ctrlEvent.param < MAX_MIDI_VALUE) @@ -1618,7 +1625,7 @@ public: bool init(const CarlaPluginPtr plugin, const char* const filename, const char* name, - const char* const label, + const char* /*const label*/, const uint options) { CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr, false); @@ -1871,7 +1878,7 @@ private: v3_process_context fV3TimeContext; CarlaScopedPointer fV3Application; - inline v3_funknown** getHostContext() const noexcept { return (v3_funknown**)&fV3Application; } + inline v3_funknown** getHostContext() const noexcept { return (v3_funknown**)fV3Application.get(); } // v3_class_info_2 is ABI compatible with v3_class_info union ClassInfo { @@ -1998,11 +2005,11 @@ private: // if we cannot cast from component, try to create edit controller from factory if (controller == nullptr) { - v3_tuid uid = {}; - if (v3_cpp_obj(component)->get_controller_class_id(component, uid) == V3_OK) + v3_tuid cuid = {}; + if (v3_cpp_obj(component)->get_controller_class_id(component, cuid) == V3_OK) { instance = nullptr; - if (v3_cpp_obj(factory1)->create_instance(factory1, uid, v3_edit_controller_iid, &instance) == V3_OK && instance != nullptr) + if (v3_cpp_obj(factory1)->create_instance(factory1, cuid, v3_edit_controller_iid, &instance) == V3_OK && instance != nullptr) controller = static_cast(instance); } @@ -2087,6 +2094,7 @@ private: return false; } + CARLA_DECLARE_NON_COPYABLE(Pointers) } fV3; struct UI { @@ -2112,8 +2120,10 @@ private: } } - CARLA_DECLARE_NON_COPY_STRUCT(UI); + CARLA_DECLARE_NON_COPYABLE(UI) } fUI; + + CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaPluginVST3) }; // -------------------------------------------------------------------------------------------------------------------- diff --git a/source/backend/utils/CachedPlugins.cpp b/source/backend/utils/CachedPlugins.cpp index 7651f232a..266e56c6f 100644 --- a/source/backend/utils/CachedPlugins.cpp +++ b/source/backend/utils/CachedPlugins.cpp @@ -99,11 +99,11 @@ static void findSFZs(const char* const sfzPaths) } // ------------------------------------------------------------------------------------------------------------------- -static water::Array gJSFXs; +static std::vector gJSFXs; static void findJSFXs(const char* const jsfxPaths) { - gJSFXs.clearQuick(); + gJSFXs.clear(); CARLA_SAFE_ASSERT_RETURN(jsfxPaths != nullptr,); @@ -119,12 +119,14 @@ static void findJSFXs(const char* const jsfxPaths) if (path.findChildFiles(results, water::File::findFiles|water::File::ignoreHiddenFiles, true, "*") > 0) { - for (std::vector::iterator it=results.begin(), end=results.end(); it != end; ++it) + gJSFXs.reserve(gJSFXs.size() + results.size()); + + for (std::vector::iterator it2=results.begin(), end2=results.end(); it2 != end2; ++it2) { - const water::File& file(*it); + const water::File& file(*it2); const water::String fileExt = file.getFileExtension(); if (fileExt.isEmpty() || fileExt.equalsIgnoreCase(".jsfx")) - gJSFXs.add(CB::CarlaJsfxUnit(path, file)); + gJSFXs.push_back(CB::CarlaJsfxUnit(path, file)); } } } @@ -669,8 +671,8 @@ static const CarlaCachedPluginInfo* get_cached_plugin_jsfx(const CB::CarlaJsfxUn ysfx_config_u config(ysfx_config_new()); - const water::String rootPath = unit.getRootPath().getFullPathName(); - const water::String filePath = unit.getFilePath().getFullPathName(); + const water::String rootPath = unit.getRootPath(); + const water::String filePath = unit.getFilePath(); ysfx_register_builtin_audio_formats(config.get()); ysfx_set_import_root(config.get(), rootPath.toRawUTF8()); @@ -821,7 +823,7 @@ const CarlaCachedPluginInfo* carla_get_cached_plugin_info(CB::PluginType ptype, case CB::PLUGIN_JSFX: { CARLA_SAFE_ASSERT_BREAK(index < static_cast(gJSFXs.size())); - return get_cached_plugin_jsfx(gJSFXs.getUnchecked(static_cast(index))); + return get_cached_plugin_jsfx(gJSFXs[index]); } default: diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index 81595cf73..739d06c9f 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -1523,7 +1523,7 @@ static void do_vst3_check(lib_t& libHandle, const char* const filename, const bo #endif carla_v3_host_application hostApplication; - carla_v3_host_application* const hostApplicationPtr = &hostApplication; + carla_v3_host_application* hostApplicationPtr = &hostApplication; v3_funknown** const hostContext = (v3_funknown**)&hostApplicationPtr; // fetch initial factory @@ -1737,8 +1737,8 @@ static void do_vst3_check(lib_t& libHandle, const char* const filename, const bo CARLA_SAFE_ASSERT_BREAK(v3_cpp_obj(component)->set_active(component, true) == V3_OK); CARLA_SAFE_ASSERT_BREAK(v3_cpp_obj(processor)->set_processing(processor, true) == V3_OK); - float* bufferAudioIn[std::max(1, audioIns + cvIns)]; - float* bufferAudioOut[std::max(1, audioOuts + cvOuts)]; + float* bufferAudioIn[(uint)std::max(1, audioIns + cvIns)]; + float* bufferAudioOut[(uint)std::max(1, audioOuts + cvOuts)]; if (audioIns + cvIns == 0) { diff --git a/source/includes/CarlaDefines.h b/source/includes/CarlaDefines.h index 214ef958f..2846e78b3 100644 --- a/source/includes/CarlaDefines.h +++ b/source/includes/CarlaDefines.h @@ -217,16 +217,16 @@ #define CARLA_SAFE_EXCEPTION_CONTINUE(msg) CARLA_CATCH_UNWIND catch(...) { carla_safe_exception(msg, __FILE__, __LINE__); continue; } #define CARLA_SAFE_EXCEPTION_RETURN(msg, ret) CARLA_CATCH_UNWIND catch(...) { carla_safe_exception(msg, __FILE__, __LINE__); return ret; } -/* Define CARLA_DECLARE_NON_COPY_CLASS */ +/* Define CARLA_DECLARE_NON_COPYABLE */ #ifdef CARLA_PROPER_CPP11_SUPPORT -# define CARLA_DECLARE_NON_COPY_CLASS(ClassName) \ +# define CARLA_DECLARE_NON_COPYABLE(ClassName) \ private: \ ClassName(ClassName&) = delete; \ ClassName(const ClassName&) = delete; \ ClassName& operator=(ClassName&) = delete; \ ClassName& operator=(const ClassName&) = delete; #else -# define CARLA_DECLARE_NON_COPY_CLASS(ClassName) \ +# define CARLA_DECLARE_NON_COPYABLE(ClassName) \ private: \ ClassName(ClassName&); \ ClassName(const ClassName&); \ @@ -234,17 +234,6 @@ private: \ ClassName& operator=(const ClassName&); #endif -/* Define CARLA_DECLARE_NON_COPY_STRUCT */ -#ifdef CARLA_PROPER_CPP11_SUPPORT -# define CARLA_DECLARE_NON_COPY_STRUCT(StructName) \ - StructName(StructName&) = delete; \ - StructName(const StructName&) = delete; \ - StructName& operator=(StructName&) = delete; \ - StructName& operator=(const StructName&) = delete; -#else -# define CARLA_DECLARE_NON_COPY_STRUCT(StructName) -#endif - /* Define CARLA_PREVENT_HEAP_ALLOCATION */ #ifdef CARLA_PROPER_CPP11_SUPPORT # define CARLA_PREVENT_HEAP_ALLOCATION \ diff --git a/source/includes/CarlaNativePrograms.hpp b/source/includes/CarlaNativePrograms.hpp index afefc3471..7b3407d09 100644 --- a/source/includes/CarlaNativePrograms.hpp +++ b/source/includes/CarlaNativePrograms.hpp @@ -1,6 +1,6 @@ /* * Carla Native Plugin API (C++) - * Copyright (C) 2012-2019 Filipe Coelho + * Copyright (C) 2012-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -65,9 +65,9 @@ struct NativePluginPresetManager { { std::vector results; - if (const int count = File(*it).findChildFiles(results, File::findFiles|File::ignoreHiddenFiles, true, wildcard)) + if (const uint count = File(*it).findChildFiles(results, File::findFiles|File::ignoreHiddenFiles, true, wildcard)) { - for (int i=0; i + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -129,7 +129,7 @@ struct LADSPA_RDF_ScalePoint { } } - CARLA_DECLARE_NON_COPY_STRUCT(LADSPA_RDF_ScalePoint) + CARLA_DECLARE_NON_COPYABLE(LADSPA_RDF_ScalePoint) }; // Port @@ -166,7 +166,7 @@ struct LADSPA_RDF_Port { } } - CARLA_DECLARE_NON_COPY_STRUCT(LADSPA_RDF_Port) + CARLA_DECLARE_NON_COPYABLE(LADSPA_RDF_Port) }; // Plugin Descriptor @@ -206,7 +206,7 @@ struct LADSPA_RDF_Descriptor { } } - CARLA_DECLARE_NON_COPY_STRUCT(LADSPA_RDF_Descriptor) + CARLA_DECLARE_NON_COPYABLE(LADSPA_RDF_Descriptor) }; #endif // LADSPA_RDF_HPP_INCLUDED diff --git a/source/includes/lv2_rdf.hpp b/source/includes/lv2_rdf.hpp index 5abe39f92..211eae62d 100644 --- a/source/includes/lv2_rdf.hpp +++ b/source/includes/lv2_rdf.hpp @@ -1,6 +1,6 @@ /* * Custom types to store LV2 information - * Copyright (C) 2011-2019 Filipe Coelho + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -378,7 +378,7 @@ struct LV2_RDF_PortUnit { } } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_PortUnit) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_PortUnit) }; // Port Scale Point @@ -399,7 +399,7 @@ struct LV2_RDF_PortScalePoint { } } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_PortScalePoint) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_PortScalePoint) }; // Port @@ -465,7 +465,7 @@ struct LV2_RDF_Port { } } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_Port) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Port) }; // Port @@ -493,7 +493,7 @@ struct LV2_RDF_PortGroup { } } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_PortGroup) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_PortGroup) }; // Parameter @@ -568,7 +568,7 @@ struct LV2_RDF_Parameter { other.Unit.Symbol = nullptr; } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_Parameter) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Parameter) }; // Preset @@ -594,7 +594,7 @@ struct LV2_RDF_Preset { } } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_Preset) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Preset) }; // Feature @@ -615,7 +615,7 @@ struct LV2_RDF_Feature { } } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_Feature) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Feature) }; // Port Notification @@ -638,7 +638,7 @@ struct LV2_RDF_UI_PortNotification { } } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_UI_PortNotification) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_UI_PortNotification) }; // UI @@ -711,7 +711,7 @@ struct LV2_RDF_UI { } } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_UI) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_UI) }; // Plugin Descriptor @@ -849,7 +849,7 @@ struct LV2_RDF_Descriptor { } } - CARLA_DECLARE_NON_COPY_STRUCT(LV2_RDF_Descriptor) + CARLA_DECLARE_NON_COPYABLE(LV2_RDF_Descriptor) }; #endif // LV2_RDF_HPP_INCLUDED diff --git a/source/interposer/interposer-jack-x11.cpp b/source/interposer/interposer-jack-x11.cpp index 42b96b3a0..b1b55f2e7 100644 --- a/source/interposer/interposer-jack-x11.cpp +++ b/source/interposer/interposer-jack-x11.cpp @@ -59,7 +59,7 @@ struct ScopedLibOpen { return slo; } - CARLA_DECLARE_NON_COPY_STRUCT(ScopedLibOpen); + CARLA_DECLARE_NON_COPYABLE(ScopedLibOpen); }; // -------------------------------------------------------------------------------------------------------------------- diff --git a/source/jackbridge/JackBridge1.cpp b/source/jackbridge/JackBridge1.cpp index 0a13ae552..44e346149 100644 --- a/source/jackbridge/JackBridge1.cpp +++ b/source/jackbridge/JackBridge1.cpp @@ -1,6 +1,6 @@ /* * JackBridge (Part 1, JACK functions) - * Copyright (C) 2013-2015 Filipe Coelho + * Copyright (C) 2013-2022 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -554,7 +554,7 @@ struct JackBridge { } } - CARLA_DECLARE_NON_COPY_STRUCT(JackBridge); + CARLA_DECLARE_NON_COPYABLE(JackBridge); }; // ----------------------------------------------------------------------------- @@ -773,7 +773,7 @@ struct WineBridge { return getInstance().prop_change_cb(subject, key, change, arg); } - CARLA_DECLARE_NON_COPY_STRUCT(WineBridge); + CARLA_DECLARE_NON_COPYABLE(WineBridge); }; #endif // __WINE__ && ! JACKBRIDGE_DIRECT diff --git a/source/jackbridge/JackBridgeExport.cpp b/source/jackbridge/JackBridgeExport.cpp index 515551c32..4f72fb7bc 100644 --- a/source/jackbridge/JackBridgeExport.cpp +++ b/source/jackbridge/JackBridgeExport.cpp @@ -74,7 +74,7 @@ private: jackbridge_exported_function_type func; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(JackBridgeExported); + CARLA_DECLARE_NON_COPYABLE(JackBridgeExported); }; // ----------------------------------------------------------------------------- diff --git a/source/libjack/libjack.cpp b/source/libjack/libjack.cpp index b1e4199ed..c48349c07 100644 --- a/source/libjack/libjack.cpp +++ b/source/libjack/libjack.cpp @@ -63,7 +63,7 @@ protected: private: Callback* const fCallback; - CARLA_DECLARE_NON_COPY_CLASS(CarlaJackRealtimeThread) + CARLA_DECLARE_NON_COPYABLE(CarlaJackRealtimeThread) }; // -------------------------------------------------------------------------------------------------------------------- @@ -90,7 +90,7 @@ protected: private: Callback* const fCallback; - CARLA_DECLARE_NON_COPY_CLASS(CarlaJackNonRealtimeThread) + CARLA_DECLARE_NON_COPYABLE(CarlaJackNonRealtimeThread) }; // --------------------------------------------------------------------------------------------------------------------- diff --git a/source/libjack/libjack.hpp b/source/libjack/libjack.hpp index be84cea6a..5f1f5d49d 100644 --- a/source/libjack/libjack.hpp +++ b/source/libjack/libjack.hpp @@ -1,6 +1,6 @@ /* * Carla JACK API for external applications - * Copyright (C) 2016-2020 Filipe Coelho + * Copyright (C) 2016-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -89,7 +89,7 @@ struct JackMidiPortBufferOnStack : JackMidiPortBufferBase { isDummy = false; } - CARLA_DECLARE_NON_COPY_STRUCT(JackMidiPortBufferOnStack) + CARLA_DECLARE_NON_COPYABLE(JackMidiPortBufferOnStack) }; struct JackMidiPortBufferDummy : JackMidiPortBufferBase { @@ -99,7 +99,7 @@ struct JackMidiPortBufferDummy : JackMidiPortBufferBase { isDummy = true; } - CARLA_DECLARE_NON_COPY_STRUCT(JackMidiPortBufferDummy) + CARLA_DECLARE_NON_COPYABLE(JackMidiPortBufferDummy) }; struct JackPortState { @@ -174,7 +174,7 @@ struct JackPortState { fullname = nullptr; } - CARLA_DECLARE_NON_COPY_STRUCT(JackPortState) + CARLA_DECLARE_NON_COPYABLE(JackPortState) }; struct JackClientState { @@ -289,7 +289,7 @@ struct JackClientState { portNameMapping.clear(); } - CARLA_DECLARE_NON_COPY_STRUCT(JackClientState) + CARLA_DECLARE_NON_COPYABLE(JackClientState) }; struct JackServerState { @@ -325,7 +325,7 @@ struct JackServerState { carla_zeroStruct(position); } - CARLA_DECLARE_NON_COPY_STRUCT(JackServerState) + CARLA_DECLARE_NON_COPYABLE(JackServerState) }; CARLA_BACKEND_END_NAMESPACE diff --git a/source/modules/lilv/lilv-0.24.0/lilv/lilvmm.hpp b/source/modules/lilv/lilv-0.24.0/lilv/lilvmm.hpp index a88c42fd8..c31f71720 100644 --- a/source/modules/lilv/lilv-0.24.0/lilv/lilvmm.hpp +++ b/source/modules/lilv/lilv-0.24.0/lilv/lilvmm.hpp @@ -356,7 +356,7 @@ struct World { LilvWorld* me; - CARLA_DECLARE_NON_COPY_STRUCT(World) + CARLA_DECLARE_NON_COPYABLE(World) }; } /* namespace Lilv */ diff --git a/source/modules/water/buffers/AudioSampleBuffer.h b/source/modules/water/buffers/AudioSampleBuffer.h index 8ae1e6388..5f2f5fb76 100644 --- a/source/modules/water/buffers/AudioSampleBuffer.h +++ b/source/modules/water/buffers/AudioSampleBuffer.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2018 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -738,7 +738,7 @@ private: return true; } - // CARLA_DECLARE_NON_COPY_CLASS(AudioSampleBuffer) + // CARLA_DECLARE_NON_COPYABLE(AudioSampleBuffer) }; } diff --git a/source/modules/water/containers/ArrayAllocationBase.h b/source/modules/water/containers/ArrayAllocationBase.h index 878ad81fc..e6fb923b7 100644 --- a/source/modules/water/containers/ArrayAllocationBase.h +++ b/source/modules/water/containers/ArrayAllocationBase.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2019 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -134,8 +134,7 @@ public: HeapBlock elements; size_t numAllocated; -private: - CARLA_DECLARE_NON_COPY_CLASS (ArrayAllocationBase) + CARLA_DECLARE_NON_COPYABLE (ArrayAllocationBase) }; } diff --git a/source/modules/water/containers/HashMap.h b/source/modules/water/containers/HashMap.h index 6292feb3b..a0c5efd08 100644 --- a/source/modules/water/containers/HashMap.h +++ b/source/modules/water/containers/HashMap.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2018 Filipe Coelho + Copyright (C) 2018-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -331,7 +331,7 @@ private: ValueType value; HashEntry* nextEntry; - CARLA_DECLARE_NON_COPY_CLASS (HashEntry) + CARLA_DECLARE_NON_COPYABLE (HashEntry) }; public: diff --git a/source/modules/water/containers/LinkedListPointer.h b/source/modules/water/containers/LinkedListPointer.h index ed75fc268..fb6dd587a 100644 --- a/source/modules/water/containers/LinkedListPointer.h +++ b/source/modules/water/containers/LinkedListPointer.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -340,14 +340,14 @@ public: private: LinkedListPointer* endOfList; - CARLA_DECLARE_NON_COPY_CLASS (Appender) + CARLA_DECLARE_NON_COPYABLE (Appender) }; private: //============================================================================== ObjectType* item; - CARLA_DECLARE_NON_COPY_CLASS (LinkedListPointer) + CARLA_DECLARE_NON_COPYABLE (LinkedListPointer) }; } diff --git a/source/modules/water/containers/OwnedArray.h b/source/modules/water/containers/OwnedArray.h index ffa89203f..0b1149285 100644 --- a/source/modules/water/containers/OwnedArray.h +++ b/source/modules/water/containers/OwnedArray.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -807,7 +807,7 @@ private: delete data.elements [--numUsed]; } - CARLA_DECLARE_NON_COPY_CLASS (OwnedArray) + CARLA_DECLARE_NON_COPYABLE (OwnedArray) }; } diff --git a/source/modules/water/files/DirectoryIterator.h b/source/modules/water/files/DirectoryIterator.h index 3f5e84f6f..1897612c4 100644 --- a/source/modules/water/files/DirectoryIterator.h +++ b/source/modules/water/files/DirectoryIterator.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -136,7 +136,7 @@ private: friend class DirectoryIterator; CarlaScopedPointer pimpl; - CARLA_DECLARE_NON_COPY_CLASS (NativeIterator) + CARLA_DECLARE_NON_COPYABLE (NativeIterator) }; StringArray wildCards; @@ -153,7 +153,7 @@ private: static StringArray parseWildcards (const String& pattern); static bool fileMatches (const StringArray& wildCards, const String& filename); - CARLA_DECLARE_NON_COPY_CLASS (DirectoryIterator) + CARLA_DECLARE_NON_COPYABLE (DirectoryIterator) }; } diff --git a/source/modules/water/files/File.cpp b/source/modules/water/files/File.cpp index 82669f953..5784aa484 100644 --- a/source/modules/water/files/File.cpp +++ b/source/modules/water/files/File.cpp @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2018 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -556,12 +556,12 @@ void File::readLines (StringArray& destLines) const } //============================================================================== -int File::findChildFiles (std::vector& results, - const int whatToLookFor, - const bool searchRecursively, - const String& wildCardPattern) const +uint File::findChildFiles (std::vector& results, + const int whatToLookFor, + const bool searchRecursively, + const String& wildCardPattern) const { - int total = 0; + uint total = 0; for (DirectoryIterator di (*this, searchRecursively, wildCardPattern, whatToLookFor); di.next();) { @@ -572,9 +572,9 @@ int File::findChildFiles (std::vector& results, return total; } -int File::getNumberOfChildFiles (const int whatToLookFor, const String& wildCardPattern) const +uint File::getNumberOfChildFiles (const int whatToLookFor, const String& wildCardPattern) const { - int total = 0; + uint total = 0; for (DirectoryIterator di (*this, false, wildCardPattern, whatToLookFor); di.next();) ++total; @@ -1216,7 +1216,7 @@ private: const String directoryWithWildCard; HANDLE handle; - CARLA_DECLARE_NON_COPY_CLASS (Pimpl) + CARLA_DECLARE_NON_COPYABLE (Pimpl) }; #else //===================================================================================================================== @@ -1542,7 +1542,7 @@ private: String parentDir, wildCard; NSDirectoryEnumerator* enumerator; - CARLA_DECLARE_NON_COPY_CLASS (Pimpl) + CARLA_DECLARE_NON_COPYABLE (Pimpl) }; #else static String getLinkedFile (const String& file) @@ -1689,7 +1689,7 @@ private: String parentDir, wildCard; DIR* dir; - CARLA_DECLARE_NON_COPY_CLASS (Pimpl) + CARLA_DECLARE_NON_COPYABLE (Pimpl) }; #endif #endif diff --git a/source/modules/water/files/File.h b/source/modules/water/files/File.h index f92613267..81c31a807 100644 --- a/source/modules/water/files/File.h +++ b/source/modules/water/files/File.h @@ -494,10 +494,10 @@ public: @see getNumberOfChildFiles, DirectoryIterator */ - int findChildFiles (std::vector& results, - int whatToLookFor, - bool searchRecursively, - const String& wildCardPattern = "*") const; + uint findChildFiles (std::vector& results, + int whatToLookFor, + bool searchRecursively, + const String& wildCardPattern = "*") const; /** Searches inside a directory and counts how many files match a wildcard pattern. @@ -515,8 +515,8 @@ public: @returns the number of matches found @see findChildFiles, DirectoryIterator */ - int getNumberOfChildFiles (int whatToLookFor, - const String& wildCardPattern = "*") const; + uint getNumberOfChildFiles (int whatToLookFor, + const String& wildCardPattern = "*") const; /** Returns true if this file is a directory that contains one or more subdirectories. @see isDirectory, findChildFiles diff --git a/source/modules/water/files/FileInputStream.h b/source/modules/water/files/FileInputStream.h index 3b4088fb6..86dc46f45 100644 --- a/source/modules/water/files/FileInputStream.h +++ b/source/modules/water/files/FileInputStream.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -90,7 +90,7 @@ private: void openHandle(); size_t readInternal (void*, size_t); - CARLA_DECLARE_NON_COPY_CLASS (FileInputStream) + CARLA_DECLARE_NON_COPYABLE (FileInputStream) }; } diff --git a/source/modules/water/files/FileOutputStream.h b/source/modules/water/files/FileOutputStream.h index 216912ef7..782612ba6 100644 --- a/source/modules/water/files/FileOutputStream.h +++ b/source/modules/water/files/FileOutputStream.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -116,7 +116,7 @@ private: int64 setPositionInternal (int64); ssize_t writeInternal (const void*, size_t); - CARLA_DECLARE_NON_COPY_CLASS (FileOutputStream) + CARLA_DECLARE_NON_COPYABLE (FileOutputStream) }; } diff --git a/source/modules/water/files/TemporaryFile.h b/source/modules/water/files/TemporaryFile.h index dca522ea5..33d59b92d 100644 --- a/source/modules/water/files/TemporaryFile.h +++ b/source/modules/water/files/TemporaryFile.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -164,7 +164,7 @@ private: //============================================================================== const File temporaryFile, targetFile; - CARLA_DECLARE_NON_COPY_CLASS (TemporaryFile) + CARLA_DECLARE_NON_COPYABLE (TemporaryFile) }; } diff --git a/source/modules/water/memory/ByteOrder.h b/source/modules/water/memory/ByteOrder.h index 6c0a9e43a..17feeed8f 100644 --- a/source/modules/water/memory/ByteOrder.h +++ b/source/modules/water/memory/ByteOrder.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -143,7 +143,7 @@ public: private: ByteOrder() WATER_DELETED_FUNCTION; - CARLA_DECLARE_NON_COPY_CLASS (ByteOrder) + CARLA_DECLARE_NON_COPYABLE (ByteOrder) }; diff --git a/source/modules/water/memory/HeapBlock.h b/source/modules/water/memory/HeapBlock.h index 98656e872..6c38d134e 100644 --- a/source/modules/water/memory/HeapBlock.h +++ b/source/modules/water/memory/HeapBlock.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2018 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -254,7 +254,7 @@ private: //============================================================================== ElementType* data; - CARLA_DECLARE_NON_COPY_CLASS(HeapBlock) + CARLA_DECLARE_NON_COPYABLE(HeapBlock) }; } diff --git a/source/modules/water/memory/ReferenceCountedObject.h b/source/modules/water/memory/ReferenceCountedObject.h index b23ed914d..7c88487c7 100644 --- a/source/modules/water/memory/ReferenceCountedObject.h +++ b/source/modules/water/memory/ReferenceCountedObject.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -126,7 +126,7 @@ private: //============================================================================== Atomic refCount; - CARLA_DECLARE_NON_COPY_CLASS (ReferenceCountedObject) + CARLA_DECLARE_NON_COPYABLE (ReferenceCountedObject) }; @@ -196,7 +196,7 @@ private: //============================================================================== int refCount; - CARLA_DECLARE_NON_COPY_CLASS (SingleThreadedReferenceCountedObject) + CARLA_DECLARE_NON_COPYABLE (SingleThreadedReferenceCountedObject) }; diff --git a/source/modules/water/midi/MidiBuffer.h b/source/modules/water/midi/MidiBuffer.h index 422b9570e..1898ec632 100644 --- a/source/modules/water/midi/MidiBuffer.h +++ b/source/modules/water/midi/MidiBuffer.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -222,7 +222,7 @@ public: const MidiBuffer& buffer; const uint8* data; - CARLA_DECLARE_NON_COPY_CLASS (Iterator) + CARLA_DECLARE_NON_COPYABLE (Iterator) }; /** The raw data holding this buffer. diff --git a/source/modules/water/midi/MidiMessageSequence.h b/source/modules/water/midi/MidiMessageSequence.h index 4954f893f..efb80e836 100644 --- a/source/modules/water/midi/MidiMessageSequence.h +++ b/source/modules/water/midi/MidiMessageSequence.h @@ -90,7 +90,7 @@ public: friend class MidiMessageSequence; MidiEventHolder (const MidiMessage&); - CARLA_DECLARE_NON_COPY_CLASS(MidiEventHolder); + CARLA_DECLARE_NON_COPYABLE(MidiEventHolder); }; //============================================================================== diff --git a/source/modules/water/processors/AudioProcessor.h b/source/modules/water/processors/AudioProcessor.h index 78ad04530..a02d630a4 100644 --- a/source/modules/water/processors/AudioProcessor.h +++ b/source/modules/water/processors/AudioProcessor.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2015 ROLI Ltd. - Copyright (C) 2017-2018 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the GNU General Public License as published by the Free Software Foundation; @@ -323,7 +323,7 @@ private: uint numCVIns, numCVOuts; uint numMIDIIns, numMIDIOuts; - CARLA_DECLARE_NON_COPY_CLASS (AudioProcessor) + CARLA_DECLARE_NON_COPYABLE (AudioProcessor) }; } diff --git a/source/modules/water/processors/AudioProcessorGraph.cpp b/source/modules/water/processors/AudioProcessorGraph.cpp index d348e5ffd..e82d0a92d 100644 --- a/source/modules/water/processors/AudioProcessorGraph.cpp +++ b/source/modules/water/processors/AudioProcessorGraph.cpp @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2015 ROLI Ltd. - Copyright (C) 2017-2020 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the GNU General Public License as published by the Free Software Foundation; @@ -74,7 +74,7 @@ struct ClearChannelOp : public AudioGraphRenderingOp const int channelNum; const bool isCV; - CARLA_DECLARE_NON_COPY_CLASS (ClearChannelOp) + CARLA_DECLARE_NON_COPYABLE (ClearChannelOp) }; //============================================================================== @@ -97,7 +97,7 @@ struct CopyChannelOp : public AudioGraphRenderingOp const int srcChannelNum, dstChannelNum; const bool isCV; - CARLA_DECLARE_NON_COPY_CLASS (CopyChannelOp) + CARLA_DECLARE_NON_COPYABLE (CopyChannelOp) }; //============================================================================== @@ -120,7 +120,7 @@ struct AddChannelOp : public AudioGraphRenderingOp const int srcChannelNum, dstChannelNum; const bool isCV; - CARLA_DECLARE_NON_COPY_CLASS (AddChannelOp) + CARLA_DECLARE_NON_COPYABLE (AddChannelOp) }; //============================================================================== @@ -137,7 +137,7 @@ struct ClearMidiBufferOp : public AudioGraphRenderingOp const int bufferNum; - CARLA_DECLARE_NON_COPY_CLASS (ClearMidiBufferOp) + CARLA_DECLARE_NON_COPYABLE (ClearMidiBufferOp) }; //============================================================================== @@ -156,7 +156,7 @@ struct CopyMidiBufferOp : public AudioGraphRenderingOp const int srcBufferNum, dstBufferNum; - CARLA_DECLARE_NON_COPY_CLASS (CopyMidiBufferOp) + CARLA_DECLARE_NON_COPYABLE (CopyMidiBufferOp) }; //============================================================================== @@ -176,7 +176,7 @@ struct AddMidiBufferOp : public AudioGraphRenderingOp const int srcBufferNum, dstBufferNum; - CARLA_DECLARE_NON_COPY_CLASS (AddMidiBufferOp) + CARLA_DECLARE_NON_COPYABLE (AddMidiBufferOp) }; //============================================================================== @@ -217,7 +217,7 @@ private: int readIndex, writeIndex; const bool isCV; - CARLA_DECLARE_NON_COPY_CLASS (DelayChannelOp) + CARLA_DECLARE_NON_COPYABLE (DelayChannelOp) }; //============================================================================== @@ -306,7 +306,7 @@ private: const uint totalCVOuts; const int midiBufferToUse; - CARLA_DECLARE_NON_COPY_CLASS (ProcessBufferOp) + CARLA_DECLARE_NON_COPYABLE (ProcessBufferOp) }; //============================================================================== @@ -956,7 +956,7 @@ private: } } - CARLA_DECLARE_NON_COPY_CLASS (RenderingOpSequenceCalculator) + CARLA_DECLARE_NON_COPYABLE (RenderingOpSequenceCalculator) }; //============================================================================== @@ -998,7 +998,7 @@ private: const uint32 destNodeId; SortedSet srcNodes; - CARLA_DECLARE_NON_COPY_CLASS (Entry) + CARLA_DECLARE_NON_COPYABLE (Entry) }; OwnedArray entries; @@ -1067,7 +1067,7 @@ private: return result; } - CARLA_DECLARE_NON_COPY_CLASS (ConnectionLookupTable) + CARLA_DECLARE_NON_COPYABLE (ConnectionLookupTable) }; //============================================================================== diff --git a/source/modules/water/processors/AudioProcessorGraph.h b/source/modules/water/processors/AudioProcessorGraph.h index a6528f0f1..425972979 100644 --- a/source/modules/water/processors/AudioProcessorGraph.h +++ b/source/modules/water/processors/AudioProcessorGraph.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2015 ROLI Ltd. - Copyright (C) 2017-2018 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the GNU General Public License as published by the Free Software Foundation; @@ -97,7 +97,7 @@ public: void prepare (double newSampleRate, int newBlockSize, AudioProcessorGraph*); void unprepare(); - CARLA_DECLARE_NON_COPY_CLASS (Node) + CARLA_DECLARE_NON_COPYABLE (Node) }; //============================================================================== @@ -342,7 +342,7 @@ public: AudioSampleBuffer& cvOutBuffer, MidiBuffer& midiMessages); - CARLA_DECLARE_NON_COPY_CLASS (AudioGraphIOProcessor) + CARLA_DECLARE_NON_COPYABLE (AudioGraphIOProcessor) }; //============================================================================== @@ -394,7 +394,7 @@ public: void buildRenderingSequence(); bool isAnInputTo (uint32 possibleInputId, uint32 possibleDestinationId, int recursionCheck) const; - CARLA_DECLARE_NON_COPY_CLASS (AudioProcessorGraph) + CARLA_DECLARE_NON_COPYABLE (AudioProcessorGraph) }; } diff --git a/source/modules/water/streams/FileInputSource.h b/source/modules/water/streams/FileInputSource.h index 1d868af50..00e8a6117 100644 --- a/source/modules/water/streams/FileInputSource.h +++ b/source/modules/water/streams/FileInputSource.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2018 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -53,7 +53,7 @@ private: //============================================================================== const File file; - CARLA_DECLARE_NON_COPY_CLASS (FileInputSource) + CARLA_DECLARE_NON_COPYABLE (FileInputSource) }; } diff --git a/source/modules/water/streams/InputStream.h b/source/modules/water/streams/InputStream.h index 46543def8..1fa3df6f1 100644 --- a/source/modules/water/streams/InputStream.h +++ b/source/modules/water/streams/InputStream.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2018 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -259,7 +259,7 @@ protected: InputStream() noexcept {} private: - CARLA_DECLARE_NON_COPY_CLASS (InputStream) + CARLA_DECLARE_NON_COPYABLE (InputStream) }; } diff --git a/source/modules/water/streams/MemoryInputStream.h b/source/modules/water/streams/MemoryInputStream.h index 8d615f11c..10a807e12 100644 --- a/source/modules/water/streams/MemoryInputStream.h +++ b/source/modules/water/streams/MemoryInputStream.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 - ROLI Ltd. - Copyright (C) 2021 Filipe Coelho + Copyright (C) 2021-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -93,7 +93,7 @@ private: void createInternalCopy(); - CARLA_DECLARE_NON_COPY_CLASS (MemoryInputStream) + CARLA_DECLARE_NON_COPYABLE (MemoryInputStream) }; } diff --git a/source/modules/water/streams/MemoryOutputStream.h b/source/modules/water/streams/MemoryOutputStream.h index 35369f778..2687d1f92 100644 --- a/source/modules/water/streams/MemoryOutputStream.h +++ b/source/modules/water/streams/MemoryOutputStream.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -128,7 +128,7 @@ private: void trimExternalBlockSize(); char* prepareToWrite (size_t); - CARLA_DECLARE_NON_COPY_CLASS (MemoryOutputStream) + CARLA_DECLARE_NON_COPYABLE (MemoryOutputStream) }; /** Copies all the data that has been written to a MemoryOutputStream into another stream. */ diff --git a/source/modules/water/streams/OutputStream.h b/source/modules/water/streams/OutputStream.h index 0a81aa0ce..718bb528e 100644 --- a/source/modules/water/streams/OutputStream.h +++ b/source/modules/water/streams/OutputStream.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -237,7 +237,7 @@ private: //============================================================================== String newLineString; - CARLA_DECLARE_NON_COPY_CLASS (OutputStream) + CARLA_DECLARE_NON_COPYABLE (OutputStream) }; //============================================================================== diff --git a/source/modules/water/threads/ChildProcess.cpp b/source/modules/water/threads/ChildProcess.cpp index 39edc256c..54b0c4e5f 100644 --- a/source/modules/water/threads/ChildProcess.cpp +++ b/source/modules/water/threads/ChildProcess.cpp @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2020 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -117,7 +117,7 @@ public: private: PROCESS_INFORMATION processInfo; - CARLA_DECLARE_NON_COPY_CLASS (ActiveProcess) + CARLA_DECLARE_NON_COPYABLE (ActiveProcess) }; #else class ChildProcess::ActiveProcess @@ -271,7 +271,7 @@ public: int childPID; private: - CARLA_DECLARE_NON_COPY_CLASS (ActiveProcess) + CARLA_DECLARE_NON_COPYABLE (ActiveProcess) }; #endif diff --git a/source/modules/water/threads/ChildProcess.h b/source/modules/water/threads/ChildProcess.h index 079197765..9ae8174a2 100644 --- a/source/modules/water/threads/ChildProcess.h +++ b/source/modules/water/threads/ChildProcess.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -105,7 +105,7 @@ private: class ActiveProcess; CarlaScopedPointer activeProcess; - CARLA_DECLARE_NON_COPY_CLASS (ChildProcess) + CARLA_DECLARE_NON_COPYABLE (ChildProcess) }; } diff --git a/source/modules/water/threads/ScopedLock.h b/source/modules/water/threads/ScopedLock.h index 1a2795731..b8e2e23e3 100644 --- a/source/modules/water/threads/ScopedLock.h +++ b/source/modules/water/threads/ScopedLock.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -82,7 +82,7 @@ private: //============================================================================== const LockType& lock_; - CARLA_DECLARE_NON_COPY_CLASS (GenericScopedLock) + CARLA_DECLARE_NON_COPYABLE (GenericScopedLock) }; @@ -155,7 +155,7 @@ private: //============================================================================== const LockType& lock_; - CARLA_DECLARE_NON_COPY_CLASS (GenericScopedUnlock) + CARLA_DECLARE_NON_COPYABLE (GenericScopedUnlock) }; @@ -230,7 +230,7 @@ private: const LockType& lock_; const bool lockWasSuccessful; - CARLA_DECLARE_NON_COPY_CLASS (GenericScopedTryLock) + CARLA_DECLARE_NON_COPYABLE (GenericScopedTryLock) }; } diff --git a/source/modules/water/threads/SpinLock.h b/source/modules/water/threads/SpinLock.h index a2d72b175..20d55284d 100644 --- a/source/modules/water/threads/SpinLock.h +++ b/source/modules/water/threads/SpinLock.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -102,7 +102,7 @@ private: //============================================================================== mutable Atomic lock; - CARLA_DECLARE_NON_COPY_CLASS (SpinLock) + CARLA_DECLARE_NON_COPYABLE (SpinLock) }; } diff --git a/source/modules/water/xml/XmlDocument.h b/source/modules/water/xml/XmlDocument.h index eb187fde0..2996823b2 100644 --- a/source/modules/water/xml/XmlDocument.h +++ b/source/modules/water/xml/XmlDocument.h @@ -3,7 +3,7 @@ This file is part of the Water library. Copyright (c) 2016 ROLI Ltd. - Copyright (C) 2017-2018 Filipe Coelho + Copyright (C) 2017-2022 Filipe Coelho Permission is granted to use this software under the terms of the ISC license http://www.isc.org/downloads/software-support-policy/isc-license/ @@ -176,7 +176,7 @@ private: String expandExternalEntity (const String&); String getParameterEntity (const String&); - CARLA_DECLARE_NON_COPY_CLASS (XmlDocument) + CARLA_DECLARE_NON_COPYABLE (XmlDocument) }; } diff --git a/source/native-plugins/audio-base.hpp b/source/native-plugins/audio-base.hpp index 243dba79a..6c6912041 100644 --- a/source/native-plugins/audio-base.hpp +++ b/source/native-plugins/audio-base.hpp @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2013-2021 Filipe Coelho + * Copyright (C) 2013-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -220,7 +220,7 @@ struct AudioFilePool { return true; } - CARLA_DECLARE_NON_COPY_STRUCT(AudioFilePool) + CARLA_DECLARE_NON_COPYABLE(AudioFilePool) }; class AudioFileReader @@ -862,7 +862,7 @@ private: #endif } - CARLA_DECLARE_NON_COPY_STRUCT(AudioFileReader) + CARLA_DECLARE_NON_COPYABLE(AudioFileReader) }; #endif // AUDIO_BASE_HPP_INCLUDED diff --git a/source/native-plugins/audio-file.cpp b/source/native-plugins/audio-file.cpp index a6b73520f..e79637be7 100644 --- a/source/native-plugins/audio-file.cpp +++ b/source/native-plugins/audio-file.cpp @@ -751,7 +751,7 @@ private: } } - CARLA_DECLARE_NON_COPY_STRUCT(InlineDisplay) + CARLA_DECLARE_NON_COPYABLE(InlineDisplay) CARLA_PREVENT_HEAP_ALLOCATION } fInlineDisplay; #endif diff --git a/source/native-plugins/bigmeter.cpp b/source/native-plugins/bigmeter.cpp index e65d30fb6..387148e47 100644 --- a/source/native-plugins/bigmeter.cpp +++ b/source/native-plugins/bigmeter.cpp @@ -319,12 +319,12 @@ private: } } - CARLA_DECLARE_NON_COPY_STRUCT(InlineDisplay) + CARLA_DECLARE_NON_COPYABLE(InlineDisplay) CARLA_PREVENT_HEAP_ALLOCATION } fInlineDisplay; PluginClassEND(BigMeterPlugin) - CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(BigMeterPlugin) + CARLA_DECLARE_NON_COPYABLE(BigMeterPlugin) }; // ----------------------------------------------------------------------- diff --git a/source/native-plugins/external b/source/native-plugins/external index 45a2d5b0a..f69a9e9ab 160000 --- a/source/native-plugins/external +++ b/source/native-plugins/external @@ -1 +1 @@ -Subproject commit 45a2d5b0a268180b4304ce27f22abbd3f8d5073c +Subproject commit f69a9e9abdc03e9d124656215839c0fe025a783a diff --git a/source/plugin/carla-lv2-ui.cpp b/source/plugin/carla-lv2-ui.cpp index de933b4bf..2cdec7b33 100644 --- a/source/plugin/carla-lv2-ui.cpp +++ b/source/plugin/carla-lv2-ui.cpp @@ -319,7 +319,7 @@ private: } } - CARLA_DECLARE_NON_COPY_STRUCT(UI); + CARLA_DECLARE_NON_COPYABLE(UI); } fUI; // ---------------------------------------------------------------------------------------------------------------- diff --git a/source/plugin/carla-vst.cpp b/source/plugin/carla-vst.cpp index 07581303f..789711b8c 100644 --- a/source/plugin/carla-vst.cpp +++ b/source/plugin/carla-vst.cpp @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2013-2021 Filipe Coelho + * Copyright (C) 2013-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -408,7 +408,7 @@ public: if (kIsUsingUILauncher) { destoryUILauncher(fUiLauncher); - fUiLauncher = createUILauncher((intptr_t)ptr, fDescriptor, fHandle); + fUiLauncher = createUILauncher((uintptr_t)ptr, fDescriptor, fHandle); } else { @@ -871,7 +871,7 @@ private: carla_zeroStructs(mdata, kMaxMidiEvents); } - CARLA_DECLARE_NON_COPY_STRUCT(FixedVstEvents); + CARLA_DECLARE_NON_COPYABLE(FixedVstEvents); } fMidiOutEvents; char* fStateChunk; diff --git a/source/plugin/ui_launcher.cpp b/source/plugin/ui_launcher.cpp index 8012816df..eadc7655b 100644 --- a/source/plugin/ui_launcher.cpp +++ b/source/plugin/ui_launcher.cpp @@ -115,7 +115,7 @@ private: const NativePluginHandle handle; PluginWindow& pluginWindow; - CARLA_DECLARE_NON_COPY_CLASS(CarlaButtonWidget); + CARLA_DECLARE_NON_COPYABLE(CarlaButtonWidget); }; END_NAMESPACE_DGL diff --git a/source/theme/CarlaStyle.hpp b/source/theme/CarlaStyle.hpp index 4678a2464..300d6dc4a 100644 --- a/source/theme/CarlaStyle.hpp +++ b/source/theme/CarlaStyle.hpp @@ -88,7 +88,7 @@ private: CarlaStylePrivate* const d; friend class CarlaStylePrivate; - CARLA_DECLARE_NON_COPY_CLASS(CarlaStyle); + CARLA_DECLARE_NON_COPYABLE(CarlaStyle); }; #endif // CARLA_STYLE_HPP_INCLUDED diff --git a/source/theme/CarlaStylePlugin.hpp b/source/theme/CarlaStylePlugin.hpp index 0c790a252..c75cf157f 100644 --- a/source/theme/CarlaStylePlugin.hpp +++ b/source/theme/CarlaStylePlugin.hpp @@ -41,7 +41,7 @@ public: QStringList keys() const override; #endif - CARLA_DECLARE_NON_COPY_CLASS(CarlaStylePlugin); + CARLA_DECLARE_NON_COPYABLE(CarlaStylePlugin); }; #endif // CARLA_STYLE_PLUGIN_HPP_INCLUDED diff --git a/source/utils/CarlaBinaryUtils.hpp b/source/utils/CarlaBinaryUtils.hpp index 1ce1131eb..f3fbad2fe 100644 --- a/source/utils/CarlaBinaryUtils.hpp +++ b/source/utils/CarlaBinaryUtils.hpp @@ -1,6 +1,6 @@ /* * Carla binary utils - * Copyright (C) 2014-2020 Filipe Coelho + * Copyright (C) 2014-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -66,7 +66,7 @@ private: bool fLoadedOk; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaMagic) + CARLA_DECLARE_NON_COPYABLE(CarlaMagic) }; #endif diff --git a/source/utils/CarlaBridgeUtils.hpp b/source/utils/CarlaBridgeUtils.hpp index c872f021e..43cef2d79 100644 --- a/source/utils/CarlaBridgeUtils.hpp +++ b/source/utils/CarlaBridgeUtils.hpp @@ -256,7 +256,7 @@ struct BridgeAudioPool { const char* getFilenameSuffix() const noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(BridgeAudioPool) + CARLA_DECLARE_NON_COPYABLE(BridgeAudioPool) }; // ------------------------------------------------------------------------------------------------------------------- @@ -293,10 +293,10 @@ struct BridgeRtClientControl : public CarlaRingBufferControl { WaitHelper(BridgeRtClientControl& c) noexcept; ~WaitHelper() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(WaitHelper) + CARLA_DECLARE_NON_COPYABLE(WaitHelper) }; - CARLA_DECLARE_NON_COPY_STRUCT(BridgeRtClientControl) + CARLA_DECLARE_NON_COPYABLE(BridgeRtClientControl) }; // ------------------------------------------------------------------------------------------------------------------- @@ -325,7 +325,7 @@ struct BridgeNonRtClientControl : public CarlaRingBufferControl // bridge, client PluginBridgeNonRtClientOpcode readOpcode() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(BridgeNonRtClientControl) + CARLA_DECLARE_NON_COPYABLE(BridgeNonRtClientControl) }; // ------------------------------------------------------------------------------------------------------------------- @@ -354,7 +354,7 @@ struct BridgeNonRtServerControl : public CarlaRingBufferControl void waitIfDataIsReachingLimit() noexcept; bool writeOpcode(const PluginBridgeNonRtServerOpcode opcode) noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(BridgeNonRtServerControl) + CARLA_DECLARE_NON_COPYABLE(BridgeNonRtServerControl) }; // ------------------------------------------------------------------------------------------------------------------- diff --git a/source/utils/CarlaDssiUtils.cpp b/source/utils/CarlaDssiUtils.cpp index 2b078e552..77ceffb7d 100644 --- a/source/utils/CarlaDssiUtils.cpp +++ b/source/utils/CarlaDssiUtils.cpp @@ -47,16 +47,20 @@ const char* find_dssi_ui(const char* const filename, const char* const label) no std::vector results; - for (int i=water::File(pluginDir).findChildFiles(results, - water::File::findFiles|water::File::ignoreHiddenFiles, false); --i >= 0;) + if (const uint count = water::File(pluginDir).findChildFiles(results, + water::File::findFiles|water::File::ignoreHiddenFiles, + false)) { - const water::File& gui(results[i]); - const water::String& guiShortName(gui.getFileName()); - - if (guiShortName.startsWith(checkLabel) || guiShortName.startsWith(checkSName)) + for (uint i=0; i + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -225,7 +225,7 @@ private: CarlaEngine::ProtectedData* const pData; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(ScopedEngineEnvironmentLocker) + CARLA_DECLARE_NON_COPYABLE(ScopedEngineEnvironmentLocker) }; // ----------------------------------------------------------------------- diff --git a/source/utils/CarlaJsfxUtils.hpp b/source/utils/CarlaJsfxUtils.hpp index 499801d18..a8cc5f85f 100644 --- a/source/utils/CarlaJsfxUtils.hpp +++ b/source/utils/CarlaJsfxUtils.hpp @@ -22,16 +22,10 @@ #include "CarlaDefines.h" #include "CarlaBackend.h" #include "CarlaUtils.hpp" -#include "CarlaString.hpp" -#include "CarlaBase64Utils.hpp" #include "CarlaJuceUtils.hpp" #include "water/files/File.h" -#include "water/files/FileInputStream.h" -#include "water/xml/XmlElement.h" -#include "water/xml/XmlDocument.h" -#include "water/streams/MemoryInputStream.h" -#include "water/streams/MemoryOutputStream.h" +#include "water/text/String.h" #ifdef YSFX_API # error YSFX_API is not private @@ -44,10 +38,9 @@ CARLA_BACKEND_START_NAMESPACE // -------------------------------------------------------------------------------------------------------------------- -class CarlaJsfxLogging +struct CarlaJsfxLogging { -public: - static void logAll(intptr_t, ysfx_log_level level, const char *message) + static void logAll(intptr_t, const ysfx_log_level level, const char* const message) { switch (level) { @@ -55,46 +48,51 @@ public: carla_stdout("%s: %s", ysfx_log_level_string(level), message); break; case ysfx_log_warning: - case ysfx_log_error: carla_stderr("%s: %s", ysfx_log_level_string(level), message); break; + case ysfx_log_error: + carla_stderr2("%s: %s", ysfx_log_level_string(level), message); + break; } }; - static void logErrorsOnly(intptr_t, ysfx_log_level level, const char *message) + static void logErrorsOnly(intptr_t, const ysfx_log_level level, const char* const message) { switch (level) { case ysfx_log_info: break; case ysfx_log_warning: - case ysfx_log_error: carla_stderr("%s: %s", ysfx_log_level_string(level), message); break; + case ysfx_log_error: + carla_stderr2("%s: %s", ysfx_log_level_string(level), message); + break; } }; }; // -------------------------------------------------------------------------------------------------------------------- -class CarlaJsfxCategories +struct CarlaJsfxCategories { -public: static PluginCategory getFromEffect(ysfx_t* effect) { PluginCategory category = PLUGIN_CATEGORY_OTHER; - water::Array tags; - int tagCount = (int)ysfx_get_tags(effect, nullptr, 0); - tags.resize(tagCount); - ysfx_get_tags(effect, tags.getRawDataPointer(), (uint32_t)tagCount); - - for (int i = 0; i < tagCount && category == PLUGIN_CATEGORY_OTHER; ++i) + if (const uint32_t tagCount = ysfx_get_tags(effect, nullptr, 0)) { - water::CharPointer_UTF8 tag(tags[i]); - PluginCategory current = getFromTag(tag); - if (current != PLUGIN_CATEGORY_NONE) - category = current; + std::vector tags; + tags.resize(tagCount); + ysfx_get_tags(effect, tags.data(), tagCount); + + for (uint32_t i=0; isetAttribute("index", (int32_t)state.sliders[i].index); - slider->setAttribute("value", state.sliders[i].value); - root.addChildElement(slider); - } - - { - const CarlaString base64 = CarlaString::asBase64(state.data, state.data_size); - water::XmlElement *var = new water::XmlElement("Serialization"); - var->addTextElement(base64.buffer()); - root.addChildElement(var); - } - - water::MemoryOutputStream stream; - root.writeToStream(stream, water::StringRef(), true); - return stream.toUTF8(); - } - - static ysfx_state_u convertFromString(const water::String& string) - { - std::unique_ptr root(water::XmlDocument::parse(string)); - - CARLA_SAFE_ASSERT_RETURN(root != nullptr, nullptr); - CARLA_SAFE_ASSERT_RETURN(root->getTagName() == "JSFXState", nullptr); - - std::vector sliders; - std::vector serialization; - - sliders.reserve(ysfx_max_sliders); - - int numChildren = root->getNumChildElements(); - for (int i = 0; i < numChildren; ++i) - { - water::XmlElement* child = root->getChildElement(i); - CARLA_SAFE_ASSERT_CONTINUE(child != nullptr); - - if (child->getTagName() == "Slider") - { - CARLA_SAFE_ASSERT_CONTINUE(child->hasAttribute("index")); - CARLA_SAFE_ASSERT_CONTINUE(child->hasAttribute("value")); - - ysfx_state_slider_t item; - int32_t index = child->getIntAttribute("index"); - CARLA_SAFE_ASSERT_CONTINUE(index >= 0 && index < ysfx_max_sliders); - - item.index = (uint32_t)index; - item.value = child->getDoubleAttribute("value"); - sliders.push_back(item); - } - else if (child->getTagName() == "Serialization") - { - serialization = carla_getChunkFromBase64String(child->getAllSubText().toRawUTF8()); - } - else - { - CARLA_SAFE_ASSERT_CONTINUE(false); - } - } - - ysfx_state_t state; - state.sliders = sliders.data(); - state.slider_count = (uint32_t)sliders.size(); - state.data = serialization.data(); - state.data_size = (uint32_t)serialization.size(); - - return ysfx_state_u(ysfx_state_dup(&state)); - } -}; - // -------------------------------------------------------------------------------------------------------------------- class CarlaJsfxUnit { -public: - CarlaJsfxUnit() = default; - - CarlaJsfxUnit(const water::File& rootPath, const water::File& filePath) - : fRootPath(rootPath), fFileId(filePath.getRelativePathFrom(rootPath)) + static water::String createFileId(const water::File& rootPath, const water::File& filePath) { + water::String fileId(filePath.getRelativePathFrom(rootPath)); #ifdef CARLA_OS_WIN - fFileId.replaceCharacter('\\', '/'); + fileId.replaceCharacter('\\', '/'); #endif + return fileId; } - explicit operator bool() const +public: + CarlaJsfxUnit() noexcept + : fFileId(), + fFilePath(), + fRootPath() {} + + CarlaJsfxUnit(const water::File& rootPath, const water::File& filePath) + : fFileId(createFileId(rootPath, filePath)), + fFilePath(rootPath.getChildFile(fFileId).getFullPathName()), + fRootPath(rootPath.getFullPathName()) {} + + explicit operator bool() const noexcept { return fFileId.isNotEmpty(); } - const water::File& getRootPath() const + const water::String& getFileId() const noexcept { - return fRootPath; + return fFileId; } - const water::String& getFileId() const + const water::String& getFilePath() const noexcept { - return fFileId; + return fFilePath; } - water::File getFilePath() const + const water::String& getRootPath() const noexcept { - return fRootPath.getChildFile(fFileId); + return fRootPath; } private: - water::File fRootPath; water::String fFileId; + water::String fFilePath; + water::String fRootPath; }; // -------------------------------------------------------------------------------------------------------------------- diff --git a/source/utils/CarlaJuceUtils.hpp b/source/utils/CarlaJuceUtils.hpp index d0f678de4..16842f1e5 100644 --- a/source/utils/CarlaJuceUtils.hpp +++ b/source/utils/CarlaJuceUtils.hpp @@ -57,13 +57,13 @@ ::LeakedObjectDetector CARLA_JOIN_MACRO(leakDetector_, ClassName); # define CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ClassName) \ - CARLA_DECLARE_NON_COPY_CLASS(ClassName) \ + CARLA_DECLARE_NON_COPYABLE(ClassName) \ CARLA_LEAK_DETECTOR(ClassName) #else /** Don't use leak detection on release builds. */ # define CARLA_LEAK_DETECTOR(ClassName) # define CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ClassName) \ - CARLA_DECLARE_NON_COPY_CLASS(ClassName) + CARLA_DECLARE_NON_COPYABLE(ClassName) #endif //===================================================================================================================== diff --git a/source/utils/CarlaLogThread.hpp b/source/utils/CarlaLogThread.hpp index ab5717861..7b7e9e32d 100644 --- a/source/utils/CarlaLogThread.hpp +++ b/source/utils/CarlaLogThread.hpp @@ -215,7 +215,7 @@ private: #endif //CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaLogThread) + CARLA_DECLARE_NON_COPYABLE(CarlaLogThread) }; #ifdef CARLA_OS_WIN diff --git a/source/utils/CarlaLv2Utils.hpp b/source/utils/CarlaLv2Utils.hpp index fe6dac311..92848489a 100644 --- a/source/utils/CarlaLv2Utils.hpp +++ b/source/utils/CarlaLv2Utils.hpp @@ -1,6 +1,6 @@ /* * Carla LV2 utils - * Copyright (C) 2011-2020 Filipe Coelho + * Copyright (C) 2011-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -550,7 +550,7 @@ public: } CARLA_PREVENT_VIRTUAL_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_STRUCT(Lv2WorldClass) + CARLA_DECLARE_NON_COPYABLE(Lv2WorldClass) }; // -------------------------------------------------------------------------------------------------------------------- @@ -1512,7 +1512,7 @@ protected: } } - CARLA_DECLARE_NON_COPY_STRUCT(Ports); + CARLA_DECLARE_NON_COPYABLE(Ports); } fPorts; // Rest of host<->plugin support @@ -1669,7 +1669,7 @@ private: // ---------------------------------------------------------------------------------------------------------------- - CARLA_DECLARE_NON_COPY_STRUCT(Lv2PluginBaseClass) + CARLA_DECLARE_NON_COPYABLE(Lv2PluginBaseClass) }; // -------------------------------------------------------------------------------------------------------------------- diff --git a/source/utils/CarlaMutex.hpp b/source/utils/CarlaMutex.hpp index f2f4215ef..a2069a79a 100644 --- a/source/utils/CarlaMutex.hpp +++ b/source/utils/CarlaMutex.hpp @@ -1,6 +1,6 @@ /* * Carla Mutex - * Copyright (C) 2013-2016 Filipe Coelho + * Copyright (C) 2013-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -97,7 +97,7 @@ private: mutable pthread_mutex_t fMutex; mutable volatile bool fTryLockWasCalled; // true if "tryLock()" was called at least once - CARLA_DECLARE_NON_COPY_CLASS(CarlaMutex) + CARLA_DECLARE_NON_COPYABLE(CarlaMutex) }; // ----------------------------------------------------------------------- @@ -185,7 +185,7 @@ private: mutable pthread_mutex_t fMutex; #endif - CARLA_DECLARE_NON_COPY_CLASS(CarlaRecursiveMutex) + CARLA_DECLARE_NON_COPYABLE(CarlaRecursiveMutex) }; // ----------------------------------------------------------------------- @@ -266,7 +266,7 @@ private: volatile bool fTriggered; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaSignal) + CARLA_DECLARE_NON_COPYABLE(CarlaSignal) }; // ----------------------------------------------------------------------- @@ -291,7 +291,7 @@ private: const Mutex& fMutex; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaScopeLocker) + CARLA_DECLARE_NON_COPYABLE(CarlaScopeLocker) }; // ----------------------------------------------------------------------- @@ -335,7 +335,7 @@ private: const bool fLocked; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaScopeTryLocker) + CARLA_DECLARE_NON_COPYABLE(CarlaScopeTryLocker) }; // ----------------------------------------------------------------------- @@ -360,7 +360,7 @@ private: const Mutex& fMutex; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaScopeUnlocker) + CARLA_DECLARE_NON_COPYABLE(CarlaScopeUnlocker) }; // ----------------------------------------------------------------------- diff --git a/source/utils/CarlaOscUtils.hpp b/source/utils/CarlaOscUtils.hpp index 46d3d22fd..8df705793 100644 --- a/source/utils/CarlaOscUtils.hpp +++ b/source/utils/CarlaOscUtils.hpp @@ -1,6 +1,6 @@ /* * Carla OSC utils - * Copyright (C) 2012-2019 Filipe Coelho + * Copyright (C) 2012-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -105,7 +105,7 @@ struct CarlaOscData { #endif CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_STRUCT(CarlaOscData) + CARLA_DECLARE_NON_COPYABLE(CarlaOscData) }; // ----------------------------------------------------------------------- diff --git a/source/utils/CarlaPipeUtils.cpp b/source/utils/CarlaPipeUtils.cpp index 664afa7f7..096b66479 100644 --- a/source/utils/CarlaPipeUtils.cpp +++ b/source/utils/CarlaPipeUtils.cpp @@ -1,6 +1,6 @@ /* * Carla Pipe Utilities - * Copyright (C) 2013-2019 Filipe Coelho + * Copyright (C) 2013-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -632,7 +632,7 @@ struct CarlaPipeCommon::PrivateData { carla_zeroChars(tmpBuf, 0xffff); } - CARLA_DECLARE_NON_COPY_STRUCT(PrivateData) + CARLA_DECLARE_NON_COPYABLE(PrivateData) }; // ----------------------------------------------------------------------- diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index e99c8d9ce..b3b7b337f 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -1165,7 +1165,7 @@ bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* cons ~ScopedDisplay() { if (display!=nullptr) XCloseDisplay(display); } // c++ compat stuff CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(ScopedDisplay) + CARLA_DECLARE_NON_COPYABLE(ScopedDisplay) }; struct ScopedFreeData { union { @@ -1177,7 +1177,7 @@ bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* cons ~ScopedFreeData() { XFree(data); } // c++ compat stuff CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(ScopedFreeData) + CARLA_DECLARE_NON_COPYABLE(ScopedFreeData) }; const ScopedDisplay sd; diff --git a/source/utils/CarlaPluginUI.hpp b/source/utils/CarlaPluginUI.hpp index 0157e65f4..341e45c8e 100644 --- a/source/utils/CarlaPluginUI.hpp +++ b/source/utils/CarlaPluginUI.hpp @@ -1,6 +1,6 @@ /* * Carla Plugin UI - * Copyright (C) 2014-2021 Filipe Coelho + * Copyright (C) 2014-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -74,7 +74,7 @@ protected: fIsResizable(isResizable), fCallback(cb) {} - CARLA_DECLARE_NON_COPY_CLASS(CarlaPluginUI) + CARLA_DECLARE_NON_COPYABLE(CarlaPluginUI) }; // ----------------------------------------------------- diff --git a/source/utils/CarlaProcessUtils.hpp b/source/utils/CarlaProcessUtils.hpp index 1c09c480e..22c74b454 100644 --- a/source/utils/CarlaProcessUtils.hpp +++ b/source/utils/CarlaProcessUtils.hpp @@ -1,6 +1,6 @@ /* * Carla process utils - * Copyright (C) 2019-2021 Filipe Coelho + * Copyright (C) 2019-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -116,7 +116,7 @@ private: static void sig_handler(const int signum); #endif - CARLA_DECLARE_NON_COPY_CLASS(ScopedAbortCatcher) + CARLA_DECLARE_NON_COPYABLE(ScopedAbortCatcher) CARLA_PREVENT_HEAP_ALLOCATION }; @@ -133,7 +133,7 @@ private: struct ::sigaction sigs[16]; #endif - CARLA_DECLARE_NON_COPY_CLASS(CarlaSignalRestorer) + CARLA_DECLARE_NON_COPYABLE(CarlaSignalRestorer) CARLA_PREVENT_HEAP_ALLOCATION }; diff --git a/source/utils/CarlaRingBuffer.hpp b/source/utils/CarlaRingBuffer.hpp index dc3b69574..5605aac34 100644 --- a/source/utils/CarlaRingBuffer.hpp +++ b/source/utils/CarlaRingBuffer.hpp @@ -1,6 +1,6 @@ /* * Carla Ring Buffer - * Copyright (C) 2013-2018 Filipe Coelho + * Copyright (C) 2013-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -443,7 +443,7 @@ private: bool fErrorWriting; CARLA_PREVENT_VIRTUAL_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaRingBufferControl) + CARLA_DECLARE_NON_COPYABLE(CarlaRingBufferControl) }; template @@ -509,7 +509,7 @@ private: HeapBuffer fHeapBuffer; CARLA_PREVENT_VIRTUAL_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaHeapRingBuffer) + CARLA_DECLARE_NON_COPYABLE(CarlaHeapRingBuffer) }; // ----------------------------------------------------------------------- @@ -528,7 +528,7 @@ private: SmallStackBuffer fStackBuffer; CARLA_PREVENT_VIRTUAL_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(CarlaSmallStackRingBuffer) + CARLA_DECLARE_NON_COPYABLE(CarlaSmallStackRingBuffer) }; // ----------------------------------------------------------------------- diff --git a/source/utils/CarlaScopeUtils.hpp b/source/utils/CarlaScopeUtils.hpp index 817f5d2a3..89bfd5047 100644 --- a/source/utils/CarlaScopeUtils.hpp +++ b/source/utils/CarlaScopeUtils.hpp @@ -89,7 +89,7 @@ private: const char* key; const char* origValue; - CARLA_DECLARE_NON_COPY_CLASS(CarlaScopedEnvVar) + CARLA_DECLARE_NON_COPYABLE(CarlaScopedEnvVar) CARLA_PREVENT_HEAP_ALLOCATION }; @@ -149,7 +149,7 @@ private: const char* const oldloc; #endif - CARLA_DECLARE_NON_COPY_CLASS(CarlaScopedLocale) + CARLA_DECLARE_NON_COPYABLE(CarlaScopedLocale) CARLA_PREVENT_HEAP_ALLOCATION }; @@ -391,7 +391,7 @@ private: ValueType& value; const ValueType originalValue; - CARLA_DECLARE_NON_COPY_CLASS(CarlaScopedValueSetter) + CARLA_DECLARE_NON_COPYABLE(CarlaScopedValueSetter) CARLA_PREVENT_HEAP_ALLOCATION }; diff --git a/source/utils/CarlaStateUtils.hpp b/source/utils/CarlaStateUtils.hpp index cbf22a110..13bbd825c 100644 --- a/source/utils/CarlaStateUtils.hpp +++ b/source/utils/CarlaStateUtils.hpp @@ -1,6 +1,6 @@ /* * Carla State utils - * Copyright (C) 2012-2017 Filipe Coelho + * Copyright (C) 2012-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -45,7 +45,7 @@ struct CarlaStateSave { Parameter() noexcept; ~Parameter() noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(Parameter) + CARLA_DECLARE_NON_COPYABLE(Parameter) }; typedef LinkedList ParameterList; @@ -60,7 +60,7 @@ struct CarlaStateSave { ~CustomData() noexcept; bool isValid() const noexcept; - CARLA_DECLARE_NON_COPY_STRUCT(CustomData) + CARLA_DECLARE_NON_COPYABLE(CustomData) }; typedef LinkedList CustomDataList; @@ -102,7 +102,7 @@ struct CarlaStateSave { bool fillFromXmlElement(const water::XmlElement* const xmlElement); void dumpToMemoryStream(water::MemoryOutputStream& stream) const; - CARLA_DECLARE_NON_COPY_STRUCT(CarlaStateSave) + CARLA_DECLARE_NON_COPYABLE(CarlaStateSave) }; static inline diff --git a/source/utils/CarlaThread.hpp b/source/utils/CarlaThread.hpp index 96e9720af..92f4008f3 100644 --- a/source/utils/CarlaThread.hpp +++ b/source/utils/CarlaThread.hpp @@ -1,6 +1,6 @@ /* * Carla Thread - * Copyright (C) 2013-2021 Filipe Coelho + * Copyright (C) 2013-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -326,7 +326,7 @@ private: return nullptr; } - CARLA_DECLARE_NON_COPY_CLASS(CarlaThread) + CARLA_DECLARE_NON_COPYABLE(CarlaThread) }; // ----------------------------------------------------------------------- diff --git a/source/utils/LinkedList.hpp b/source/utils/LinkedList.hpp index da1f7cf79..451cb1f76 100644 --- a/source/utils/LinkedList.hpp +++ b/source/utils/LinkedList.hpp @@ -1,6 +1,6 @@ /* * High-level, templated, C++ doubly-linked list - * Copyright (C) 2013-2020 Filipe Coelho + * Copyright (C) 2013-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -508,7 +508,7 @@ private: template friend class RtLinkedList; CARLA_PREVENT_VIRTUAL_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(AbstractLinkedList) + CARLA_DECLARE_NON_COPYABLE(AbstractLinkedList) }; // ----------------------------------------------------------------------- @@ -532,7 +532,7 @@ protected: } CARLA_PREVENT_VIRTUAL_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(LinkedList) + CARLA_DECLARE_NON_COPYABLE(LinkedList) }; // ----------------------------------------------------------------------- diff --git a/source/utils/Lv2AtomRingBuffer.hpp b/source/utils/Lv2AtomRingBuffer.hpp index 02c40b232..ae0575ece 100644 --- a/source/utils/Lv2AtomRingBuffer.hpp +++ b/source/utils/Lv2AtomRingBuffer.hpp @@ -1,6 +1,6 @@ /* * LV2 Atom Ring Buffer - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -213,7 +213,7 @@ private: friend class Lv2AtomQueue; CARLA_PREVENT_VIRTUAL_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(Lv2AtomRingBuffer) + CARLA_DECLARE_NON_COPYABLE(Lv2AtomRingBuffer) }; // ----------------------------------------------------------------------- diff --git a/source/utils/RtLinkedList.hpp b/source/utils/RtLinkedList.hpp index c1804ab9c..2f45150e8 100644 --- a/source/utils/RtLinkedList.hpp +++ b/source/utils/RtLinkedList.hpp @@ -1,6 +1,6 @@ /* * High-level, real-time safe, templated, C++ doubly-linked list - * Copyright (C) 2013-2018 Filipe Coelho + * Copyright (C) 2013-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -92,7 +92,7 @@ public: mutable RtMemPool_Handle fHandle; CARLA_PREVENT_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(Pool) + CARLA_DECLARE_NON_COPYABLE(Pool) }; // ------------------------------------------------------------------- @@ -208,7 +208,7 @@ private: } CARLA_PREVENT_VIRTUAL_HEAP_ALLOCATION - CARLA_DECLARE_NON_COPY_CLASS(RtLinkedList) + CARLA_DECLARE_NON_COPYABLE(RtLinkedList) }; // ----------------------------------------------------------------------- diff --git a/source/utils/ThreadSafeFFTW.hpp b/source/utils/ThreadSafeFFTW.hpp index e8153c24e..15cd69131 100644 --- a/source/utils/ThreadSafeFFTW.hpp +++ b/source/utils/ThreadSafeFFTW.hpp @@ -1,6 +1,6 @@ /* * Thread-safe fftw - * Copyright (C) 2018-2020 Filipe Coelho + * Copyright (C) 2018-2022 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -87,7 +87,7 @@ private: lib_t libfftw3l; lib_t libfftw3q; - CARLA_DECLARE_NON_COPY_CLASS(ThreadSafeFFTW) + CARLA_DECLARE_NON_COPYABLE(ThreadSafeFFTW) }; #endif