diff --git a/c++/carla-backend/dssi.cpp b/c++/carla-backend/dssi.cpp index 83adf42..bdf7910 100644 --- a/c++/carla-backend/dssi.cpp +++ b/c++/carla-backend/dssi.cpp @@ -19,7 +19,8 @@ #ifdef WANT_DSSI -#include "carla_dssi.h" +#include "carla_ladspa_utils.h" +#include "dssi/dssi.h" CARLA_BACKEND_START_NAMESPACE diff --git a/c++/carla-backend/fluidsynth.cpp b/c++/carla-backend/fluidsynth.cpp index a7c47f1..d33f875 100644 --- a/c++/carla-backend/fluidsynth.cpp +++ b/c++/carla-backend/fluidsynth.cpp @@ -16,14 +16,16 @@ */ #ifdef BUILD_BRIDGE -# error Should not use fluidsynth for bridges! +# error Should not use fluidsynth for bridges! #endif #include "carla_plugin.h" #ifdef WANT_FLUIDSYNTH -#include "carla_fluidsynth.h" +#include + +#define FLUIDSYNTH_VERSION_NEW_API (FLUIDSYNTH_VERSION_MAJOR >= 1 && FLUIDSYNTH_VERSION_MINOR >= 1 && FLUIDSYNTH_VERSION_MICRO >= 4) CARLA_BACKEND_START_NAMESPACE diff --git a/c++/carla-backend/ladspa.cpp b/c++/carla-backend/ladspa.cpp index efcc1fe..c694b84 100644 --- a/c++/carla-backend/ladspa.cpp +++ b/c++/carla-backend/ladspa.cpp @@ -1,5 +1,5 @@ /* - * Carla Backend + * Carla Backend, LADSPA plugin code * Copyright (C) 2011-2012 Filipe Coelho * * This program is free software; you can redistribute it and/or modify @@ -19,7 +19,7 @@ #ifdef WANT_LADSPA -#include "carla_ladspa.h" +#include "carla_ladspa_utils.h" CARLA_BACKEND_START_NAMESPACE diff --git a/c++/carla-backend/linuxsampler.cpp b/c++/carla-backend/linuxsampler.cpp index 5ef5d6c..6dfe54f 100644 --- a/c++/carla-backend/linuxsampler.cpp +++ b/c++/carla-backend/linuxsampler.cpp @@ -18,14 +18,14 @@ // TODO - setMidiProgram() #ifdef BUILD_BRIDGE -# error Should not use linuxsampler for bridges! +# error Should not use linuxsampler for bridges! #endif #include "carla_plugin.h" #ifdef WANT_LINUXSAMPLER -#include "carla_linuxsampler.h" +#include "carla_linuxsampler_utils.h" #include diff --git a/c++/carla-backend/plugins/carla_nativemm.h b/c++/carla-backend/plugins/carla_nativemm.h index 791f63e..c063e3c 100644 --- a/c++/carla-backend/plugins/carla_nativemm.h +++ b/c++/carla-backend/plugins/carla_nativemm.h @@ -19,7 +19,7 @@ #define CARLA_NATIVE_MM_H #include "carla_native.h" -#include "carla_includes.h" +#include "carla_utils.h" class PluginDescriptorClass { public: diff --git a/c++/carla-backend/qtcreator/carla-backend.pro b/c++/carla-backend/qtcreator/carla-backend.pro index c9859bd..41ccadb 100644 --- a/c++/carla-backend/qtcreator/carla-backend.pro +++ b/c++/carla-backend/qtcreator/carla-backend.pro @@ -54,12 +54,10 @@ HEADERS = \ ../../carla-includes/carla_utils.h \ ../../carla-includes/carla_lib_utils.h \ ../../carla-includes/carla_osc_utils.h \ - ../../carla-includes/carla_ladspa.h \ - ../../carla-includes/carla_dssi.h \ + ../../carla-includes/carla_ladspa_utils.h \ ../../carla-includes/carla_lv2.h \ - ../../carla-includes/carla_vst.h \ - ../../carla-includes/carla_fluidsynth.h \ - ../../carla-includes/carla_linuxsampler.h \ + ../../carla-includes/carla_vst_utils.h \ + ../../carla-includes/carla_linuxsampler_utils.h \ ../../carla-includes/ladspa_rdf.h \ ../../carla-includes/lv2_rdf.h diff --git a/c++/carla-backend/vst.cpp b/c++/carla-backend/vst.cpp index 6ba69a0..eb3c053 100644 --- a/c++/carla-backend/vst.cpp +++ b/c++/carla-backend/vst.cpp @@ -19,10 +19,10 @@ #ifdef WANT_VST -#include "carla_vst.h" +#include "carla_vst_utils.h" #ifdef Q_WS_X11 -# include +# include #endif CARLA_BACKEND_START_NAMESPACE diff --git a/c++/carla-includes/carla_dssi.h b/c++/carla-includes/carla_dssi.h deleted file mode 100644 index d2c2eb0..0000000 --- a/c++/carla-includes/carla_dssi.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Carla common DSSI code - * Copyright (C) 2012 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 published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the COPYING file - */ - -#ifndef CARLA_DSSI_INCLUDES_H -#define CARLA_DSSI_INCLUDES_H - -#include "carla_ladspa.h" -#include "dssi/dssi.h" - -#endif // CARLA_DSSI_INCLUDES_H diff --git a/c++/carla-includes/carla_fluidsynth.h b/c++/carla-includes/carla_fluidsynth.h deleted file mode 100644 index 52c6129..0000000 --- a/c++/carla-includes/carla_fluidsynth.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Carla common FluidSynth code - * Copyright (C) 2012 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 published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * For a full copy of the GNU General Public License see the COPYING file - */ - -#ifndef CARLA_FLUIDSYNTH_INCLUDES_H -#define CARLA_FLUIDSYNTH_INCLUDES_H - -#include - -#if (FLUIDSYNTH_VERSION_MAJOR >= 1 && FLUIDSYNTH_VERSION_MINOR >= 1 && FLUIDSYNTH_VERSION_MICRO >= 4) -# define FLUIDSYNTH_VERSION_NEW_API -#endif - -#endif // CARLA_FLUIDSYNTH_INCLUDES_H diff --git a/c++/carla-includes/carla_ladspa.h b/c++/carla-includes/carla_ladspa_utils.h similarity index 53% rename from c++/carla-includes/carla_ladspa.h rename to c++/carla-includes/carla_ladspa_utils.h index 3fc6393..2057f61 100644 --- a/c++/carla-includes/carla_ladspa.h +++ b/c++/carla-includes/carla_ladspa_utils.h @@ -1,5 +1,5 @@ /* - * Carla common LADSPA code + * Carla LADSPA utils * Copyright (C) 2011-2012 Filipe Coelho * * This program is free software; you can redistribute it and/or modify @@ -15,8 +15,10 @@ * For a full copy of the GNU General Public License see the COPYING file */ -#ifndef CARLA_LADSPA_INCLUDES_H -#define CARLA_LADSPA_INCLUDES_H +#ifndef CARLA_LADSPA_UTILS_H +#define CARLA_LADSPA_UTILS_H + +#include "carla_utils.h" #include "ladspa/ladspa.h" #include "ladspa_rdf.h" @@ -28,55 +30,58 @@ // Copy RDF object static inline -const LADSPA_RDF_Descriptor* ladspa_rdf_dup(const LADSPA_RDF_Descriptor* const rdf_descriptor) +const LADSPA_RDF_Descriptor* ladspa_rdf_dup(const LADSPA_RDF_Descriptor* const oldDescriptor) { - CARLA_ASSERT(rdf_descriptor); + CARLA_ASSERT(oldDescriptor); + + if (! oldDescriptor) + return nullptr; - LADSPA_RDF_Descriptor* const new_descriptor = new LADSPA_RDF_Descriptor; + LADSPA_RDF_Descriptor* const newDescriptor = new LADSPA_RDF_Descriptor(); - new_descriptor->Type = rdf_descriptor->Type; - new_descriptor->UniqueID = rdf_descriptor->UniqueID; - new_descriptor->PortCount = rdf_descriptor->PortCount; + newDescriptor->Type = oldDescriptor->Type; + newDescriptor->UniqueID = oldDescriptor->UniqueID; + newDescriptor->PortCount = oldDescriptor->PortCount; - if (rdf_descriptor->Title) - new_descriptor->Title = strdup(rdf_descriptor->Title); + if (oldDescriptor->Title) + newDescriptor->Title = strdup(oldDescriptor->Title); - if (rdf_descriptor->Creator) - new_descriptor->Creator = strdup(rdf_descriptor->Creator); + if (oldDescriptor->Creator) + newDescriptor->Creator = strdup(oldDescriptor->Creator); - if (new_descriptor->PortCount > 0) + if (newDescriptor->PortCount > 0) { - new_descriptor->Ports = new LADSPA_RDF_Port[new_descriptor->PortCount]; + newDescriptor->Ports = new LADSPA_RDF_Port[newDescriptor->PortCount]; - for (unsigned long i=0; i < new_descriptor->PortCount; i++) + for (unsigned long i=0; i < newDescriptor->PortCount; i++) { - LADSPA_RDF_Port* const Port = &new_descriptor->Ports[i]; - Port->Type = rdf_descriptor->Ports[i].Type; - Port->Hints = rdf_descriptor->Ports[i].Hints; - Port->Default = rdf_descriptor->Ports[i].Default; - Port->Unit = rdf_descriptor->Ports[i].Unit; - Port->ScalePointCount = rdf_descriptor->Ports[i].ScalePointCount; + LADSPA_RDF_Port* const newPort = &newDescriptor->Ports[i]; + newPort->Type = oldDescriptor->Ports[i].Type; + newPort->Hints = oldDescriptor->Ports[i].Hints; + newPort->Default = oldDescriptor->Ports[i].Default; + newPort->Unit = oldDescriptor->Ports[i].Unit; + newPort->ScalePointCount = oldDescriptor->Ports[i].ScalePointCount; - if (rdf_descriptor->Ports[i].Label) - Port->Label = strdup(rdf_descriptor->Ports[i].Label); + if (oldDescriptor->Ports[i].Label) + newPort->Label = strdup(oldDescriptor->Ports[i].Label); - if (Port->ScalePointCount > 0) + if (newPort->ScalePointCount > 0) { - Port->ScalePoints = new LADSPA_RDF_ScalePoint[Port->ScalePointCount]; + newPort->ScalePoints = new LADSPA_RDF_ScalePoint[newPort->ScalePointCount]; - for (unsigned long j=0; j < Port->ScalePointCount; j++) + for (unsigned long j=0; j < newPort->ScalePointCount; j++) { - LADSPA_RDF_ScalePoint* const ScalePoint = &Port->ScalePoints[j]; - ScalePoint->Value = rdf_descriptor->Ports[i].ScalePoints[j].Value; + LADSPA_RDF_ScalePoint* const newScalePoint = &newPort->ScalePoints[j]; + newScalePoint->Value = oldDescriptor->Ports[i].ScalePoints[j].Value; - if (rdf_descriptor->Ports[i].ScalePoints[j].Label) - ScalePoint->Label = strdup(rdf_descriptor->Ports[i].ScalePoints[j].Label); + if (oldDescriptor->Ports[i].ScalePoints[j].Label) + newScalePoint->Label = strdup(oldDescriptor->Ports[i].ScalePoints[j].Label); } } } } - return new_descriptor; + return newDescriptor; } // ------------------------------------------------------------------------------------------------ @@ -96,30 +101,33 @@ bool is_ladspa_port_good(const LADSPA_PortDescriptor port1, const LADSPA_PortDes } static inline -bool is_ladspa_rdf_descriptor_valid(const LADSPA_RDF_Descriptor* const rdf_descriptor, const LADSPA_Descriptor* const descriptor) +bool is_ladspa_rdf_descriptor_valid(const LADSPA_RDF_Descriptor* const rdfDescriptor, const LADSPA_Descriptor* const descriptor) { + CARLA_ASSERT(rdfDescriptor); CARLA_ASSERT(descriptor); - if (! rdf_descriptor) + if (! rdfDescriptor) + return false; + if (! descriptor) return false; - if (rdf_descriptor->UniqueID != descriptor->UniqueID) + if (rdfDescriptor->UniqueID != descriptor->UniqueID) { - qWarning("WARNING - Plugin has wrong UniqueID: %li != %li", rdf_descriptor->UniqueID, descriptor->UniqueID); + qWarning("WARNING - Plugin has wrong UniqueID: %li != %li", rdfDescriptor->UniqueID, descriptor->UniqueID); return false; } - if (rdf_descriptor->PortCount > descriptor->PortCount) + if (rdfDescriptor->PortCount > descriptor->PortCount) { - qWarning("WARNING - Plugin has RDF data, but invalid PortCount: %li > %li", rdf_descriptor->PortCount, descriptor->PortCount); + qWarning("WARNING - Plugin has RDF data, but invalid PortCount: %li > %li", rdfDescriptor->PortCount, descriptor->PortCount); return false; } - for (unsigned long i=0; i < rdf_descriptor->PortCount; i++) + for (unsigned long i=0; i < rdfDescriptor->PortCount; i++) { - if (! is_ladspa_port_good(rdf_descriptor->Ports[i].Type, descriptor->PortDescriptors[i])) + if (! is_ladspa_port_good(rdfDescriptor->Ports[i].Type, descriptor->PortDescriptors[i])) { - qWarning("WARNING - Plugin has RDF data, but invalid PortTypes: %i != %i", rdf_descriptor->Ports[i].Type, descriptor->PortDescriptors[i]); + qWarning("WARNING - Plugin has RDF data, but invalid PortTypes: %i != %i", rdfDescriptor->Ports[i].Type, descriptor->PortDescriptors[i]); return false; } } @@ -156,25 +164,25 @@ LADSPA_Data get_default_ladspa_port_value(const LADSPA_PortRangeHintDescriptor h break; case LADSPA_HINT_DEFAULT_LOW: if (LADSPA_IS_HINT_LOGARITHMIC(hintDescriptor)) - def = exp((log(min)*0.75f) + (log(max)*0.25f)); + def = std::exp((std::log(min)*0.75f) + (std::log(max)*0.25f)); else def = (min*0.75f) + (max*0.25f); break; case LADSPA_HINT_DEFAULT_MIDDLE: if (LADSPA_IS_HINT_LOGARITHMIC(hintDescriptor)) - def = sqrt(min*max); + def = std::sqrt(min*max); else def = (min+max)/2; break; case LADSPA_HINT_DEFAULT_HIGH: if (LADSPA_IS_HINT_LOGARITHMIC(hintDescriptor)) - def = exp((log(min)*0.25) + (log(max)*0.75)); + def = std::exp((std::log(min)*0.25f) + (std::log(max)*0.75f)); else - def = (min*0.25) + (max*0.75); + def = (min*0.25f) + (max*0.75f); break; default: - if (min < 0.0 && max > 0.0) - def = 0.0; + if (min < 0.0f && max > 0.0f) + def = 0.0f; else def = min; break; @@ -183,8 +191,8 @@ LADSPA_Data get_default_ladspa_port_value(const LADSPA_PortRangeHintDescriptor h else { // no default value - if (min < 0.0 && max > 0.0) - def = 0.0; + if (min < 0.0f && max > 0.0f) + def = 0.0f; else def = min; } @@ -192,4 +200,6 @@ LADSPA_Data get_default_ladspa_port_value(const LADSPA_PortRangeHintDescriptor h return def; } -#endif // CARLA_LADSPA_INCLUDES_H +// ------------------------------------------------------------------------------------------------ + +#endif // CARLA_LADSPA_UTILS_H diff --git a/c++/carla-includes/carla_lib_utils.h b/c++/carla-includes/carla_lib_utils.h index 7a4a810..9043374 100644 --- a/c++/carla-includes/carla_lib_utils.h +++ b/c++/carla-includes/carla_lib_utils.h @@ -18,11 +18,9 @@ #ifndef CARLA_LIBRARY_UTILS_H #define CARLA_LIBRARY_UTILS_H -#include "carla_defines.h" +#include "carla_utils.h" -#ifdef Q_OS_WIN -# include -#else +#ifndef Q_OS_WIN # include #endif diff --git a/c++/carla-includes/carla_linuxsampler.h b/c++/carla-includes/carla_linuxsampler_utils.h similarity index 81% rename from c++/carla-includes/carla_linuxsampler.h rename to c++/carla-includes/carla_linuxsampler_utils.h index 985a95d..77cc7e8 100644 --- a/c++/carla-includes/carla_linuxsampler.h +++ b/c++/carla-includes/carla_linuxsampler_utils.h @@ -1,5 +1,5 @@ /* - * Carla common LinuxSampler code + * Carla LinuxSampler utils * Copyright (C) 2012 Filipe Coelho * * This program is free software; you can redistribute it and/or modify @@ -15,8 +15,8 @@ * For a full copy of the GNU General Public License see the COPYING file */ -#ifndef CARLA_LINUXSAMPLER_INCLUDES_H -#define CARLA_LINUXSAMPLER_INCLUDES_H +#ifndef CARLA_LINUXSAMPLER_UTILS_H +#define CARLA_LINUXSAMPLER_UTILS_H #include #include @@ -26,6 +26,8 @@ namespace LinuxSampler { +// ----------------------------------------------------------------------- + class EngineFactory { public: @@ -44,9 +46,15 @@ protected: #include "carla_plugin.h" +// ----------------------------------------------------------------------- +// LinuxSampler static values + static const float VOLUME_MAX = 3.16227766f; // +10 dB static const float VOLUME_MIN = 0.0f; // -inf dB +// ----------------------------------------------------------------------- +// LinuxSampler AudioOutputDevice Plugin + class AudioOutputDevicePlugin : public AudioOutputDevice { public: @@ -55,6 +63,8 @@ public: m_engine(engine), m_plugin(plugin) { + CARLA_ASSERT(engine); + CARLA_ASSERT(plugin); } // ------------------------------------------------------------------- @@ -94,6 +104,7 @@ public: } // ------------------------------------------------------------------- + // Give public access to the RenderAudio call int Render(uint samples) { @@ -105,6 +116,9 @@ private: CarlaBackend::CarlaPlugin* const m_plugin; }; +// ----------------------------------------------------------------------- +// LinuxSampler MidiInputDevice Plugin + class MidiInputDevicePlugin : public MidiInputDevice { public: @@ -135,6 +149,7 @@ public: } // ------------------------------------------------------------------- + // Properly delete port (deconstructor is protected) void DeleteMidiPort(MidiInputPort* const port) { @@ -143,6 +158,7 @@ public: // ------------------------------------------------------------------- // MIDI Port implementation for this plugin MIDI input driver + // (Constructor and deconstructor are protected) class MidiInputPortPlugin : public MidiInputPort { @@ -155,8 +171,10 @@ public: }; }; +// ----------------------------------------------------------------------- + #endif // ! BUILD_NATIVE } // namespace LinuxSampler -#endif // CARLA_LINUXSAMPLER_INCLUDES_H +#endif // CARLA_LINUXSAMPLER_UTILS_H diff --git a/c++/carla-includes/carla_utils.h b/c++/carla-includes/carla_utils.h index 779bf88..ebbecea 100644 --- a/c++/carla-includes/carla_utils.h +++ b/c++/carla-includes/carla_utils.h @@ -31,6 +31,19 @@ # include #endif +// carla_assert* +static inline +void carla_assert(const char* const assertion, const char* const file, const int line) +{ + qCritical("Carla assertion failure: \"%s\" in file %s, line %i", assertion, file, line); +} + +static inline +void carla_assert_int(const char* const assertion, const char* const file, const int line, const int value) +{ + qCritical("Carla assertion failure: \"%s\" in file %s, line %i, value %i", assertion, file, line, value); +} + // carla_*sleep #ifdef Q_OS_WIN # define carla_sleep(t) Sleep(t * 1000) @@ -49,19 +62,6 @@ # define carla_setenv(key, value) setenv(key, value, 1) #endif -// carla_assert* -static inline -void carla_assert(const char* const assertion, const char* const file, const int line) -{ - qCritical("Carla assertion failure: \"%s\" in file %s, line %i", assertion, file, line); -} - -static inline -void carla_assert_int(const char* const assertion, const char* const file, const int line, const int value) -{ - qCritical("Carla assertion failure: \"%s\" in file %s, line %i, value %i", assertion, file, line, value); -} - // carla_setprocname (not available on all platforms) static inline void carla_setprocname(const char* const name) @@ -79,19 +79,19 @@ void carla_setprocname(const char* const name) } // math functions -inline +static inline float carla_absF(const float& value) { return (value < 0.0f) ? -value : value; } -inline +static inline float carla_minF(const float& x, const float& y) { return (x < y ? x : y); } -inline +static inline float carla_maxF(const float& x, const float& y) { return (x > y ? x : y); @@ -114,7 +114,9 @@ const char* bool2str(const bool yesNo) static inline void pass() {} +// ------------------------------------------------- // carla_string class + class carla_string { public: @@ -131,16 +133,11 @@ public: buffer = ::strdup(strBuf ? strBuf : ""); } - carla_string(const char* const strBuf) + explicit carla_string(const char* const strBuf) { buffer = ::strdup(strBuf ? strBuf : ""); } - explicit carla_string(const carla_string& str) - { - buffer = ::strdup(str.buffer); - } - explicit carla_string(const int value) { const size_t strBufSize = ::abs(value/10) + 3; @@ -193,6 +190,14 @@ public: buffer = ::strdup(strBuf); } + // --------------------------------------------- + // non-explicit constructor + + carla_string(const carla_string& str) + { + buffer = ::strdup(str.buffer); + } + // --------------------------------------------- // deconstructor diff --git a/c++/carla-includes/carla_vst.h b/c++/carla-includes/carla_vst_utils.h similarity index 98% rename from c++/carla-includes/carla_vst.h rename to c++/carla-includes/carla_vst_utils.h index 1046b02..ec1893c 100644 --- a/c++/carla-includes/carla_vst.h +++ b/c++/carla-includes/carla_vst_utils.h @@ -1,5 +1,5 @@ /* - * Carla common VST code + * Carla VST utils * Copyright (C) 2011-2012 Filipe Coelho * * This program is free software; you can redistribute it and/or modify @@ -15,8 +15,8 @@ * For a full copy of the GNU General Public License see the COPYING file */ -#ifndef CARLA_VST_INCLUDES_H -#define CARLA_VST_INCLUDES_H +#ifndef CARLA_VST_UTILS_H +#define CARLA_VST_UTILS_H // disable deprecated VST features (not) #define VST_FORCE_DEPRECATED 0 @@ -102,7 +102,7 @@ #define kVstVersion 2400 #define VSTCALLBACK struct ERect { - short top, left, bottom, right; + int16_t top, left, bottom, right; }; struct VstTimeInfo_R { double samplePos, sampleRate, nanoSeconds, ppqPos, tempo, barStartPos, cycleStartPos, cycleEndPos; @@ -431,4 +431,4 @@ const char* vstMasterOpcode2str(const int32_t opcode) } } -#endif // CARLA_VST_INCLUDES_H +#endif // CARLA_VST_UTILS_H diff --git a/c++/carla-includes/ladspa_rdf.h b/c++/carla-includes/ladspa_rdf.h index b462747..1a7eb90 100644 --- a/c++/carla-includes/ladspa_rdf.h +++ b/c++/carla-includes/ladspa_rdf.h @@ -18,6 +18,8 @@ #ifndef LADSPA_RDF_INCLUDED #define LADSPA_RDF_INCLUDED +#include + // Base Types typedef float LADSPA_Data; typedef int LADSPA_Property; @@ -62,38 +64,38 @@ typedef unsigned long long LADSPA_PluginType; #define LADSPA_PORT_HAS_LABEL(x) ((x) & LADSPA_PORT_LABEL) // Plugin Types -#define LADSPA_CLASS_UTILITY 0x000000001 -#define LADSPA_CLASS_GENERATOR 0x000000002 -#define LADSPA_CLASS_SIMULATOR 0x000000004 -#define LADSPA_CLASS_OSCILLATOR 0x000000008 -#define LADSPA_CLASS_TIME 0x000000010 -#define LADSPA_CLASS_DELAY 0x000000020 -#define LADSPA_CLASS_PHASER 0x000000040 -#define LADSPA_CLASS_FLANGER 0x000000080 -#define LADSPA_CLASS_CHORUS 0x000000100 -#define LADSPA_CLASS_REVERB 0x000000200 -#define LADSPA_CLASS_FREQUENCY 0x000000400 -#define LADSPA_CLASS_FREQUENCY_METER 0x000000800 -#define LADSPA_CLASS_FILTER 0x000001000 -#define LADSPA_CLASS_LOWPASS 0x000002000 -#define LADSPA_CLASS_HIGHPASS 0x000004000 -#define LADSPA_CLASS_BANDPASS 0x000008000 -#define LADSPA_CLASS_COMB 0x000010000 -#define LADSPA_CLASS_ALLPASS 0x000020000 -#define LADSPA_CLASS_EQ 0x000040000 -#define LADSPA_CLASS_PARAEQ 0x000080000 -#define LADSPA_CLASS_MULTIEQ 0x000100000 -#define LADSPA_CLASS_AMPLITUDE 0x000200000 -#define LADSPA_CLASS_PITCH 0x000400000 -#define LADSPA_CLASS_AMPLIFIER 0x000800000 -#define LADSPA_CLASS_WAVESHAPER 0x001000000 -#define LADSPA_CLASS_MODULATOR 0x002000000 -#define LADSPA_CLASS_DISTORTION 0x004000000 -#define LADSPA_CLASS_DYNAMICS 0x008000000 -#define LADSPA_CLASS_COMPRESSOR 0x010000000 -#define LADSPA_CLASS_EXPANDER 0x020000000 -#define LADSPA_CLASS_LIMITER 0x040000000 -#define LADSPA_CLASS_GATE 0x080000000 +#define LADSPA_CLASS_UTILITY 0x000000001LL +#define LADSPA_CLASS_GENERATOR 0x000000002LL +#define LADSPA_CLASS_SIMULATOR 0x000000004LL +#define LADSPA_CLASS_OSCILLATOR 0x000000008LL +#define LADSPA_CLASS_TIME 0x000000010LL +#define LADSPA_CLASS_DELAY 0x000000020LL +#define LADSPA_CLASS_PHASER 0x000000040LL +#define LADSPA_CLASS_FLANGER 0x000000080LL +#define LADSPA_CLASS_CHORUS 0x000000100LL +#define LADSPA_CLASS_REVERB 0x000000200LL +#define LADSPA_CLASS_FREQUENCY 0x000000400LL +#define LADSPA_CLASS_FREQUENCY_METER 0x000000800LL +#define LADSPA_CLASS_FILTER 0x000001000LL +#define LADSPA_CLASS_LOWPASS 0x000002000LL +#define LADSPA_CLASS_HIGHPASS 0x000004000LL +#define LADSPA_CLASS_BANDPASS 0x000008000LL +#define LADSPA_CLASS_COMB 0x000010000LL +#define LADSPA_CLASS_ALLPASS 0x000020000LL +#define LADSPA_CLASS_EQ 0x000040000LL +#define LADSPA_CLASS_PARAEQ 0x000080000LL +#define LADSPA_CLASS_MULTIEQ 0x000100000LL +#define LADSPA_CLASS_AMPLITUDE 0x000200000LL +#define LADSPA_CLASS_PITCH 0x000400000LL +#define LADSPA_CLASS_AMPLIFIER 0x000800000LL +#define LADSPA_CLASS_WAVESHAPER 0x001000000LL +#define LADSPA_CLASS_MODULATOR 0x002000000LL +#define LADSPA_CLASS_DISTORTION 0x004000000LL +#define LADSPA_CLASS_DYNAMICS 0x008000000LL +#define LADSPA_CLASS_COMPRESSOR 0x010000000LL +#define LADSPA_CLASS_EXPANDER 0x020000000LL +#define LADSPA_CLASS_LIMITER 0x040000000LL +#define LADSPA_CLASS_GATE 0x080000000LL #define LADSPA_CLASS_SPECTRAL 0x100000000LL #define LADSPA_CLASS_NOTCH 0x200000000LL @@ -127,7 +129,7 @@ struct LADSPA_RDF_ScalePoint { ~LADSPA_RDF_ScalePoint() { if (Label) - free((void*)Label); + ::free((void*)Label); } }; @@ -154,7 +156,7 @@ struct LADSPA_RDF_Port { ~LADSPA_RDF_Port() { if (Label) - free((void*)Label); + ::free((void*)Label); if (ScalePoints) delete[] ScalePoints; @@ -182,10 +184,10 @@ struct LADSPA_RDF_Descriptor { ~LADSPA_RDF_Descriptor() { if (Title) - free((void*)Title); + ::free((void*)Title); if (Creator) - free((void*)Creator); + ::free((void*)Creator); if (Ports) delete[] Ports; diff --git a/c++/carla-includes/lv2_rdf.h b/c++/carla-includes/lv2_rdf.h index 07db2dd..28048a8 100644 --- a/c++/carla-includes/lv2_rdf.h +++ b/c++/carla-includes/lv2_rdf.h @@ -21,6 +21,7 @@ // TODO - presets #include +#include // Base Types typedef float LV2_Data; @@ -189,11 +190,11 @@ typedef unsigned long long LV2_PluginType; #define LV2_IS_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND(x) ((x) == LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND) #define LV2_IS_PORT_DESIGNATION_TIME_POSITION(x) ((x) == LV2_PORT_DESIGNATION_TIME_POSITION) #define LV2_IS_PORT_DESIGNATION_TIME_SPEED(x) ((x) == LV2_PORT_DESIGNATION_TIME_SPEED) -#define LV2_IS_PORT_DESIGNATION_TIME(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR || (x) == LV2_PORT_DESIGNATION_TIME_BAR_BEAT || \ - (x) == LV2_PORT_DESIGNATION_TIME_BEAT || (x) == LV2_PORT_DESIGNATION_TIME_BEAT_UNIT || \ - (x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR || (x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE || \ - (x) == LV2_PORT_DESIGNATION_TIME_FRAME || (x) == LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND || \ - (x) == LV2_PORT_DESIGNATION_TIME_POSITION || (x) == LV2_PORT_DESIGNATION_TIME_SPEED) +#define LV2_IS_PORT_DESIGNATION_TIME(x) ((x) == LV2_PORT_DESIGNATION_TIME_BAR || (x) == LV2_PORT_DESIGNATION_TIME_BAR_BEAT || \ + (x) == LV2_PORT_DESIGNATION_TIME_BEAT || (x) == LV2_PORT_DESIGNATION_TIME_BEAT_UNIT || \ + (x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_BAR || (x) == LV2_PORT_DESIGNATION_TIME_BEATS_PER_MINUTE || \ + (x) == LV2_PORT_DESIGNATION_TIME_FRAME || (x) == LV2_PORT_DESIGNATION_TIME_FRAMES_PER_SECOND || \ + (x) == LV2_PORT_DESIGNATION_TIME_POSITION || (x) == LV2_PORT_DESIGNATION_TIME_SPEED) // Preset State Types (TODO: Null is not a type, this is just a placeholder) #define LV2_PRESET_STATE_NULL 0x0 @@ -332,13 +333,13 @@ struct LV2_RDF_PortUnit { ~LV2_RDF_PortUnit() { if (Name) - free((void*)Name); + ::free((void*)Name); if (Render) - free((void*)Render); + ::free((void*)Render); if (Symbol) - free((void*)Symbol); + ::free((void*)Symbol); } }; @@ -354,7 +355,7 @@ struct LV2_RDF_PortScalePoint { ~LV2_RDF_PortScalePoint() { if (Label) - free((void*)Label); + ::free((void*)Label); } }; @@ -385,10 +386,10 @@ struct LV2_RDF_Port { ~LV2_RDF_Port() { if (Name) - free((void*)Name); + ::free((void*)Name); if (Symbol) - free((void*)Symbol); + ::free((void*)Symbol); if (ScalePoints) delete[] ScalePoints; @@ -407,7 +408,7 @@ struct LV2_RDF_PresetPort { ~LV2_RDF_PresetPort() { if (Symbol) - free((void*)Symbol); + ::free((void*)Symbol); } }; @@ -426,7 +427,7 @@ struct LV2_RDF_PresetState { ~LV2_RDF_PresetState() { if (Key) - free((void*)Key); + ::free((void*)Key); } }; @@ -452,10 +453,10 @@ struct LV2_RDF_Preset { ~LV2_RDF_Preset() { if (URI) - free((void*)URI); + ::free((void*)URI); if (Label) - free((void*)Label); + ::free((void*)Label); if (Ports) delete[] Ports; @@ -477,7 +478,7 @@ struct LV2_RDF_Feature { ~LV2_RDF_Feature() { if (URI) - free((void*)URI); + ::free((void*)URI); } }; @@ -507,13 +508,13 @@ struct LV2_RDF_UI { ~LV2_RDF_UI() { if (URI) - free((void*)URI); + ::free((void*)URI); if (Binary) - free((void*)Binary); + ::free((void*)Binary); if (Bundle) - free((void*)Bundle); + ::free((void*)Bundle); if (Features) delete[] Features; @@ -572,22 +573,22 @@ struct LV2_RDF_Descriptor { ~LV2_RDF_Descriptor() { if (URI) - free((void*)URI); + ::free((void*)URI); if (Name) - free((void*)Name); + ::free((void*)Name); if (Author) - free((void*)Author); + ::free((void*)Author); if (License) - free((void*)License); + ::free((void*)License); if (Binary) - free((void*)Binary); + ::free((void*)Binary); if (Bundle) - free((void*)Bundle); + ::free((void*)Bundle); if (Ports) delete[] Ports; @@ -606,4 +607,4 @@ struct LV2_RDF_Descriptor { } }; -#endif /* LV2_RDF_INCLUDED */ +#endif // LV2_RDF_INCLUDED