Browse Source

More renames

tags/v0.9.0
falkTX 13 years ago
parent
commit
27c6113fe0
28 changed files with 229 additions and 216 deletions
  1. +0
    -0
      c++/carla-backend/carla_backend.hpp
  2. +2
    -2
      c++/carla-backend/carla_backend_plugin.cpp
  3. +2
    -2
      c++/carla-backend/carla_backend_standalone.cpp
  4. +1
    -1
      c++/carla-backend/carla_backend_standalone.hpp
  5. +1
    -1
      c++/carla-backend/carla_bridge.cpp
  6. +2
    -2
      c++/carla-backend/carla_engine.cpp
  7. +3
    -3
      c++/carla-backend/carla_engine.hpp
  8. +2
    -2
      c++/carla-backend/carla_engine_jack.cpp
  9. +2
    -2
      c++/carla-backend/carla_engine_rtaudio.cpp
  10. +1
    -1
      c++/carla-backend/carla_native.cpp
  11. +2
    -2
      c++/carla-backend/carla_osc.cpp
  12. +1
    -1
      c++/carla-backend/carla_osc.hpp
  13. +3
    -3
      c++/carla-backend/carla_plugin.hpp
  14. +2
    -2
      c++/carla-backend/carla_shared.cpp
  15. +1
    -1
      c++/carla-backend/carla_shared.hpp
  16. +2
    -2
      c++/carla-backend/carla_threads.cpp
  17. +1
    -1
      c++/carla-backend/carla_threads.hpp
  18. +1
    -1
      c++/carla-backend/dssi.cpp
  19. +1
    -1
      c++/carla-backend/fluidsynth.cpp
  20. +1
    -1
      c++/carla-backend/ladspa.cpp
  21. +1
    -1
      c++/carla-backend/linuxsampler.cpp
  22. +2
    -2
      c++/carla-backend/lv2.cpp
  23. +1
    -1
      c++/carla-backend/plugins/zynaddsubfx.cpp
  24. +9
    -10
      c++/carla-backend/qtcreator/carla-backend.pro
  25. +1
    -1
      c++/carla-backend/vst.cpp
  26. +0
    -0
      c++/carla-includes/carla_midi.hpp
  27. +168
    -166
      c++/carla-utils/carla_lv2_utils.hpp
  28. +16
    -4
      c++/carla-utils/carla_vst_utils.hpp

c++/carla-backend/carla_backend.h → c++/carla-backend/carla_backend.hpp View File


+ 2
- 2
c++/carla-backend/carla_backend_plugin.cpp View File

@@ -15,8 +15,8 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_engine.h"
#include "carla_plugin.h"
#include "carla_engine.hpp"
#include "carla_plugin.hpp"

#include "DistrhoPlugin.h"



+ 2
- 2
c++/carla-backend/carla_backend_standalone.cpp View File

@@ -15,8 +15,8 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_backend_standalone.h"
#include "carla_plugin.h"
#include "carla_backend_standalone.hpp"
#include "carla_plugin.hpp"
#include "plugins/carla_native.h"

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


c++/carla-backend/carla_backend_standalone.h → c++/carla-backend/carla_backend_standalone.hpp View File

@@ -20,7 +20,7 @@

#include <cstdint>

#include "carla_backend.h"
#include "carla_backend.hpp"

/*!
* @defgroup CarlaBackendStandalone Carla Backend Standalone

+ 1
- 1
c++/carla-backend/carla_bridge.cpp View File

@@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_plugin.h"
#include "carla_plugin.hpp"

#include <QtCore/QDir>
#include <QtCore/QFile>


+ 2
- 2
c++/carla-backend/carla_engine.cpp View File

@@ -15,8 +15,8 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_engine.h"
#include "carla_plugin.h"
#include "carla_engine.hpp"
#include "carla_plugin.hpp"

CARLA_BACKEND_START_NAMESPACE



c++/carla-backend/carla_engine.h → c++/carla-backend/carla_engine.hpp View File

@@ -18,9 +18,9 @@
#ifndef CARLA_ENGINE_H
#define CARLA_ENGINE_H

#include "carla_osc.h"
#include "carla_shared.h"
#include "carla_threads.h"
#include "carla_osc.hpp"
#include "carla_shared.hpp"
#include "carla_threads.hpp"

#ifdef CARLA_ENGINE_JACK
#include "carla_jackbridge.h"

+ 2
- 2
c++/carla-backend/carla_engine_jack.cpp View File

@@ -17,8 +17,8 @@

#ifdef CARLA_ENGINE_JACK

#include "carla_engine.h"
#include "carla_plugin.h"
#include "carla_engine.hpp"
#include "carla_plugin.hpp"

CARLA_BACKEND_START_NAMESPACE



+ 2
- 2
c++/carla-backend/carla_engine_rtaudio.cpp View File

@@ -17,8 +17,8 @@

#ifdef CARLA_ENGINE_RTAUDIO

#include "carla_engine.h"
#include "carla_plugin.h"
#include "carla_engine.hpp"
#include "carla_plugin.hpp"

CARLA_BACKEND_START_NAMESPACE



+ 1
- 1
c++/carla-backend/carla_native.cpp View File

@@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_plugin.h"
#include "carla_plugin.hpp"
#include "plugins/carla_native.h"

// Internal C plugins


+ 2
- 2
c++/carla-backend/carla_osc.cpp View File

@@ -15,8 +15,8 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_osc.h"
#include "carla_plugin.h"
#include "carla_osc.hpp"
#include "carla_plugin.hpp"

CARLA_BACKEND_START_NAMESPACE



c++/carla-backend/carla_osc.h → c++/carla-backend/carla_osc.hpp View File

@@ -18,7 +18,7 @@
#ifndef CARLA_OSC_H
#define CARLA_OSC_H

#include "carla_backend.h"
#include "carla_backend.hpp"
#include "carla_osc_utils.hpp"

#define CARLA_OSC_HANDLE_ARGS1 CarlaPlugin* const plugin

c++/carla-backend/carla_plugin.h → c++/carla-backend/carla_plugin.hpp View File

@@ -18,9 +18,9 @@
#ifndef CARLA_PLUGIN_H
#define CARLA_PLUGIN_H

#include "carla_engine.h"
#include "carla_midi.h"
#include "carla_shared.h"
#include "carla_engine.hpp"
#include "carla_shared.hpp"
#include "carla_midi.hpp"

#include "carla_lib_utils.hpp"


+ 2
- 2
c++/carla-backend/carla_shared.cpp View File

@@ -15,8 +15,8 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_shared.h"
#include "carla_engine.h"
#include "carla_shared.hpp"
#include "carla_engine.hpp"

#ifndef BUILD_BRIDGE
# include "plugins/carla_native.h"


c++/carla-backend/carla_shared.h → c++/carla-backend/carla_shared.hpp View File

@@ -18,7 +18,7 @@
#ifndef CARLA_SHARED_H
#define CARLA_SHARED_H

#include "carla_backend.h"
#include "carla_backend.hpp"

CARLA_BACKEND_START_NAMESPACE


+ 2
- 2
c++/carla-backend/carla_threads.cpp View File

@@ -15,8 +15,8 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_threads.h"
#include "carla_plugin.h"
#include "carla_threads.hpp"
#include "carla_plugin.hpp"

#include <QtCore/QDebug>
#include <QtCore/QProcess>


c++/carla-backend/carla_threads.h → c++/carla-backend/carla_threads.hpp View File

@@ -18,7 +18,7 @@
#ifndef CARLA_THREADS_H
#define CARLA_THREADS_H

#include "carla_backend.h"
#include "carla_backend.hpp"

#include <QtCore/QMutex>
#include <QtCore/QThread>

+ 1
- 1
c++/carla-backend/dssi.cpp View File

@@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_plugin.h"
#include "carla_plugin.hpp"

#ifdef WANT_DSSI



+ 1
- 1
c++/carla-backend/fluidsynth.cpp View File

@@ -19,7 +19,7 @@
# error Should not use fluidsynth for bridges!
#endif

#include "carla_plugin.h"
#include "carla_plugin.hpp"

#ifdef WANT_FLUIDSYNTH



+ 1
- 1
c++/carla-backend/ladspa.cpp View File

@@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_plugin.h"
#include "carla_plugin.hpp"

#ifdef WANT_LADSPA



+ 1
- 1
c++/carla-backend/linuxsampler.cpp View File

@@ -21,7 +21,7 @@
# error Should not use linuxsampler for bridges!
#endif

#include "carla_plugin.h"
#include "carla_plugin.hpp"

#ifdef WANT_LINUXSAMPLER



+ 2
- 2
c++/carla-backend/lv2.cpp View File

@@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_plugin.h"
#include "carla_plugin.hpp"

#ifdef WANT_LV2

@@ -333,7 +333,7 @@ public:
ft.options[4] = lv2Options.oNull;
}

Lv2World.init();
lv2World.init();
}

~Lv2Plugin()


+ 1
- 1
c++/carla-backend/plugins/zynaddsubfx.cpp View File

@@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_midi.h"
#include "carla_midi.hpp"
#include "carla_nativemm.h"

#include "zynaddsubfx/Misc/Master.h"


+ 9
- 10
c++/carla-backend/qtcreator/carla-backend.pro View File

@@ -39,17 +39,17 @@ SOURCES += \
../plugins/zynaddsubfx-src.cpp

HEADERS = \
../carla_backend.h \
../carla_backend_standalone.h \
../carla_engine.h \
../carla_osc.h \
../carla_plugin.h \
../carla_shared.h \
../carla_threads.h \
../carla_backend.hpp \
../carla_backend_standalone.hpp \
../carla_engine.hpp \
../carla_osc.hpp \
../carla_plugin.hpp \
../carla_shared.hpp \
../carla_threads.hpp \
../plugins/carla_native.h \
../plugins/carla_nativemm.h \
../../carla-includes/carla_defines.hpp \
../../carla-includes/carla_midi.h \
../../carla-includes/carla_midi.hpp \
../../carla-includes/ladspa_rdf.hpp \
../../carla-includes/lv2_rdf.hpp \
../../carla-utils/carla_utils.hpp \
@@ -57,8 +57,7 @@ HEADERS = \
../../carla-utils/carla_osc_utils.hpp \
../../carla-utils/carla_ladspa_utils.hpp \
../../carla-utils/carla_lv2_utils.hpp \
../../carla-utils/carla_vst_utils.hpp \
../../carla-utils/carla_linuxsampler_utils.hpp
../../carla-utils/carla_vst_utils.hpp

INCLUDEPATH = .. \
../../carla-jackbridge \


+ 1
- 1
c++/carla-backend/vst.cpp View File

@@ -15,7 +15,7 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#include "carla_plugin.h"
#include "carla_plugin.hpp"

#ifdef WANT_VST



c++/carla-includes/carla_midi.h → c++/carla-includes/carla_midi.hpp View File


+ 168
- 166
c++/carla-utils/carla_lv2_utils.hpp View File

@@ -78,6 +78,8 @@

#define LV2_UI__makeResident LV2_UI_PREFIX "makeResident"

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

struct LV2_Atom_MidiEvent {
LV2_Atom_Event event;
uint8_t data[3];
@@ -338,132 +340,132 @@ private:
bool needInit;
};

static Lv2WorldClass Lv2World;
static Lv2WorldClass lv2World;

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

// Create new RDF object
static inline
const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri)
{
CARLA_ASSERT(URI);
CARLA_ASSERT(uri);

Lilv::Plugins lilvPlugins = Lv2World.get_all_plugins();
Lilv::Plugins lilvPlugins = lv2World.get_all_plugins();

LILV_FOREACH(plugins, i, lilvPlugins)
{
Lilv::Plugin lilvPlugin(lilvPlugins.get(i));

if (strcmp(lilvPlugin.get_uri().as_string(), URI))
if (strcmp(lilvPlugin.get_uri().as_string(), uri))
continue;

LV2_RDF_Descriptor* const rdf_descriptor = new LV2_RDF_Descriptor;
LV2_RDF_Descriptor* const rdfDescriptor = new LV2_RDF_Descriptor;

// --------------------------------------------------
// Set Plugin Type
{
Lilv::Nodes typeNodes(lilvPlugin.get_value(Lv2World.rdf_type));
Lilv::Nodes typeNodes(lilvPlugin.get_value(lv2World.rdf_type));

if (typeNodes.size() > 0)
{
if (typeNodes.contains(Lv2World.class_allpass))
rdf_descriptor->Type |= LV2_CLASS_ALLPASS;
if (typeNodes.contains(Lv2World.class_amplifier))
rdf_descriptor->Type |= LV2_CLASS_AMPLIFIER;
if (typeNodes.contains(Lv2World.class_analyzer))
rdf_descriptor->Type |= LV2_CLASS_ANALYSER;
if (typeNodes.contains(Lv2World.class_bandpass))
rdf_descriptor->Type |= LV2_CLASS_BANDPASS;
if (typeNodes.contains(Lv2World.class_chorus))
rdf_descriptor->Type |= LV2_CLASS_CHORUS;
if (typeNodes.contains(Lv2World.class_comb))
rdf_descriptor->Type |= LV2_CLASS_COMB;
if (typeNodes.contains(Lv2World.class_compressor))
rdf_descriptor->Type |= LV2_CLASS_COMPRESSOR;
if (typeNodes.contains(Lv2World.class_constant))
rdf_descriptor->Type |= LV2_CLASS_CONSTANT;
if (typeNodes.contains(Lv2World.class_converter))
rdf_descriptor->Type |= LV2_CLASS_CONVERTER;
if (typeNodes.contains(Lv2World.class_delay))
rdf_descriptor->Type |= LV2_CLASS_DELAY;
if (typeNodes.contains(Lv2World.class_distortion))
rdf_descriptor->Type |= LV2_CLASS_DISTORTION;
if (typeNodes.contains(Lv2World.class_dynamics))
rdf_descriptor->Type |= LV2_CLASS_DYNAMICS;
if (typeNodes.contains(Lv2World.class_eq))
rdf_descriptor->Type |= LV2_CLASS_EQ;
if (typeNodes.contains(Lv2World.class_expander))
rdf_descriptor->Type |= LV2_CLASS_EXPANDER;
if (typeNodes.contains(Lv2World.class_filter))
rdf_descriptor->Type |= LV2_CLASS_FILTER;
if (typeNodes.contains(Lv2World.class_flanger))
rdf_descriptor->Type |= LV2_CLASS_FLANGER;
if (typeNodes.contains(Lv2World.class_function))
rdf_descriptor->Type |= LV2_CLASS_FUNCTION;
if (typeNodes.contains(Lv2World.class_gate))
rdf_descriptor->Type |= LV2_CLASS_GATE;
if (typeNodes.contains(Lv2World.class_generator))
rdf_descriptor->Type |= LV2_CLASS_GENERATOR;
if (typeNodes.contains(Lv2World.class_highpass))
rdf_descriptor->Type |= LV2_CLASS_HIGHPASS;
if (typeNodes.contains(Lv2World.class_instrument))
rdf_descriptor->Type |= LV2_CLASS_INSTRUMENT;
if (typeNodes.contains(Lv2World.class_limiter))
rdf_descriptor->Type |= LV2_CLASS_LIMITER;
if (typeNodes.contains(Lv2World.class_lowpass))
rdf_descriptor->Type |= LV2_CLASS_LOWPASS;
if (typeNodes.contains(Lv2World.class_mixer))
rdf_descriptor->Type |= LV2_CLASS_MIXER;
if (typeNodes.contains(Lv2World.class_modulator))
rdf_descriptor->Type |= LV2_CLASS_MODULATOR;
if (typeNodes.contains(Lv2World.class_multiEQ))
rdf_descriptor->Type |= LV2_CLASS_MULTI_EQ;
if (typeNodes.contains(Lv2World.class_oscillator))
rdf_descriptor->Type |= LV2_CLASS_OSCILLATOR;
if (typeNodes.contains(Lv2World.class_paraEQ))
rdf_descriptor->Type |= LV2_CLASS_PARA_EQ;
if (typeNodes.contains(Lv2World.class_phaser))
rdf_descriptor->Type |= LV2_CLASS_PHASER;
if (typeNodes.contains(Lv2World.class_pitch))
rdf_descriptor->Type |= LV2_CLASS_PITCH;
if (typeNodes.contains(Lv2World.class_reverb))
rdf_descriptor->Type |= LV2_CLASS_REVERB;
if (typeNodes.contains(Lv2World.class_simulator))
rdf_descriptor->Type |= LV2_CLASS_SIMULATOR;
if (typeNodes.contains(Lv2World.class_spatial))
rdf_descriptor->Type |= LV2_CLASS_SPATIAL;
if (typeNodes.contains(Lv2World.class_spectral))
rdf_descriptor->Type |= LV2_CLASS_SPECTRAL;
if (typeNodes.contains(Lv2World.class_utility))
rdf_descriptor->Type |= LV2_CLASS_UTILITY;
if (typeNodes.contains(Lv2World.class_waveshaper))
rdf_descriptor->Type |= LV2_CLASS_WAVESHAPER;
if (typeNodes.contains(lv2World.class_allpass))
rdfDescriptor->Type |= LV2_CLASS_ALLPASS;
if (typeNodes.contains(lv2World.class_amplifier))
rdfDescriptor->Type |= LV2_CLASS_AMPLIFIER;
if (typeNodes.contains(lv2World.class_analyzer))
rdfDescriptor->Type |= LV2_CLASS_ANALYSER;
if (typeNodes.contains(lv2World.class_bandpass))
rdfDescriptor->Type |= LV2_CLASS_BANDPASS;
if (typeNodes.contains(lv2World.class_chorus))
rdfDescriptor->Type |= LV2_CLASS_CHORUS;
if (typeNodes.contains(lv2World.class_comb))
rdfDescriptor->Type |= LV2_CLASS_COMB;
if (typeNodes.contains(lv2World.class_compressor))
rdfDescriptor->Type |= LV2_CLASS_COMPRESSOR;
if (typeNodes.contains(lv2World.class_constant))
rdfDescriptor->Type |= LV2_CLASS_CONSTANT;
if (typeNodes.contains(lv2World.class_converter))
rdfDescriptor->Type |= LV2_CLASS_CONVERTER;
if (typeNodes.contains(lv2World.class_delay))
rdfDescriptor->Type |= LV2_CLASS_DELAY;
if (typeNodes.contains(lv2World.class_distortion))
rdfDescriptor->Type |= LV2_CLASS_DISTORTION;
if (typeNodes.contains(lv2World.class_dynamics))
rdfDescriptor->Type |= LV2_CLASS_DYNAMICS;
if (typeNodes.contains(lv2World.class_eq))
rdfDescriptor->Type |= LV2_CLASS_EQ;
if (typeNodes.contains(lv2World.class_expander))
rdfDescriptor->Type |= LV2_CLASS_EXPANDER;
if (typeNodes.contains(lv2World.class_filter))
rdfDescriptor->Type |= LV2_CLASS_FILTER;
if (typeNodes.contains(lv2World.class_flanger))
rdfDescriptor->Type |= LV2_CLASS_FLANGER;
if (typeNodes.contains(lv2World.class_function))
rdfDescriptor->Type |= LV2_CLASS_FUNCTION;
if (typeNodes.contains(lv2World.class_gate))
rdfDescriptor->Type |= LV2_CLASS_GATE;
if (typeNodes.contains(lv2World.class_generator))
rdfDescriptor->Type |= LV2_CLASS_GENERATOR;
if (typeNodes.contains(lv2World.class_highpass))
rdfDescriptor->Type |= LV2_CLASS_HIGHPASS;
if (typeNodes.contains(lv2World.class_instrument))
rdfDescriptor->Type |= LV2_CLASS_INSTRUMENT;
if (typeNodes.contains(lv2World.class_limiter))
rdfDescriptor->Type |= LV2_CLASS_LIMITER;
if (typeNodes.contains(lv2World.class_lowpass))
rdfDescriptor->Type |= LV2_CLASS_LOWPASS;
if (typeNodes.contains(lv2World.class_mixer))
rdfDescriptor->Type |= LV2_CLASS_MIXER;
if (typeNodes.contains(lv2World.class_modulator))
rdfDescriptor->Type |= LV2_CLASS_MODULATOR;
if (typeNodes.contains(lv2World.class_multiEQ))
rdfDescriptor->Type |= LV2_CLASS_MULTI_EQ;
if (typeNodes.contains(lv2World.class_oscillator))
rdfDescriptor->Type |= LV2_CLASS_OSCILLATOR;
if (typeNodes.contains(lv2World.class_paraEQ))
rdfDescriptor->Type |= LV2_CLASS_PARA_EQ;
if (typeNodes.contains(lv2World.class_phaser))
rdfDescriptor->Type |= LV2_CLASS_PHASER;
if (typeNodes.contains(lv2World.class_pitch))
rdfDescriptor->Type |= LV2_CLASS_PITCH;
if (typeNodes.contains(lv2World.class_reverb))
rdfDescriptor->Type |= LV2_CLASS_REVERB;
if (typeNodes.contains(lv2World.class_simulator))
rdfDescriptor->Type |= LV2_CLASS_SIMULATOR;
if (typeNodes.contains(lv2World.class_spatial))
rdfDescriptor->Type |= LV2_CLASS_SPATIAL;
if (typeNodes.contains(lv2World.class_spectral))
rdfDescriptor->Type |= LV2_CLASS_SPECTRAL;
if (typeNodes.contains(lv2World.class_utility))
rdfDescriptor->Type |= LV2_CLASS_UTILITY;
if (typeNodes.contains(lv2World.class_waveshaper))
rdfDescriptor->Type |= LV2_CLASS_WAVESHAPER;
}
}

// --------------------------------------------------
// Set Plugin Information
{
rdf_descriptor->URI = strdup(URI);
rdf_descriptor->Binary = strdup(lilv_uri_to_path(lilvPlugin.get_library_uri().as_string()));
rdf_descriptor->Bundle = strdup(lilv_uri_to_path(lilvPlugin.get_bundle_uri().as_string()));
rdfDescriptor->URI = strdup(uri);
rdfDescriptor->Binary = strdup(lilv_uri_to_path(lilvPlugin.get_library_uri().as_string()));
rdfDescriptor->Bundle = strdup(lilv_uri_to_path(lilvPlugin.get_bundle_uri().as_string()));

if (lilvPlugin.get_name())
rdf_descriptor->Name = strdup(lilvPlugin.get_name().as_string());
rdfDescriptor->Name = strdup(lilvPlugin.get_name().as_string());

if (lilvPlugin.get_author_name())
rdf_descriptor->Author = strdup(lilvPlugin.get_author_name().as_string());
rdfDescriptor->Author = strdup(lilvPlugin.get_author_name().as_string());

Lilv::Nodes licenseNodes(lilvPlugin.get_value(Lv2World.doap_license));
Lilv::Nodes licenseNodes(lilvPlugin.get_value(lv2World.doap_license));

if (licenseNodes.size() > 0)
rdf_descriptor->License = strdup(licenseNodes.get_first().as_string());
rdfDescriptor->License = strdup(licenseNodes.get_first().as_string());
}

// --------------------------------------------------
// Set Plugin UniqueID
{
Lilv::Nodes replaceNodes(lilvPlugin.get_value(Lv2World.dct_replaces));
Lilv::Nodes replaceNodes(lilvPlugin.get_value(lv2World.dct_replaces));

if (replaceNodes.size() > 0)
{
@@ -481,7 +483,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
long uniqueId = replaceId.toLong(&ok);

if (ok && uniqueId > 0)
rdf_descriptor->UniqueID = uniqueId;
rdfDescriptor->UniqueID = uniqueId;
}
}
}
@@ -492,13 +494,13 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)

if (lilvPlugin.get_num_ports() > 0)
{
rdf_descriptor->PortCount = lilvPlugin.get_num_ports();
rdf_descriptor->Ports = new LV2_RDF_Port[rdf_descriptor->PortCount];
rdfDescriptor->PortCount = lilvPlugin.get_num_ports();
rdfDescriptor->Ports = new LV2_RDF_Port[rdfDescriptor->PortCount];

for (uint32_t j = 0; j < rdf_descriptor->PortCount; j++)
for (uint32_t j = 0; j < rdfDescriptor->PortCount; j++)
{
Lilv::Port lilvPort(lilvPlugin.get_port_by_index(j));
LV2_RDF_Port* const rdf_port = &rdf_descriptor->Ports[j];
LV2_RDF_Port* const rdf_port = &rdfDescriptor->Ports[j];

// --------------------------------------
// Set Port Information (first)
@@ -511,101 +513,101 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
// Set Port Mode and Type
{
// Mode
if (lilvPort.is_a(Lv2World.port_input))
if (lilvPort.is_a(lv2World.port_input))
rdf_port->Type |= LV2_PORT_INPUT;

else if (lilvPort.is_a(Lv2World.port_output))
else if (lilvPort.is_a(lv2World.port_output))
rdf_port->Type |= LV2_PORT_OUTPUT;

else
qWarning("lv2_rdf_new(\"%s\") - port '%s' is not input or output", URI, rdf_port->Name);
qWarning("lv2_rdf_new(\"%s\") - port '%s' is not input or output", uri, rdf_port->Name);

// Type
if (lilvPort.is_a(Lv2World.port_control))
if (lilvPort.is_a(lv2World.port_control))
rdf_port->Type |= LV2_PORT_CONTROL;

else if (lilvPort.is_a(Lv2World.port_audio))
else if (lilvPort.is_a(lv2World.port_audio))
rdf_port->Type |= LV2_PORT_AUDIO;

else if (lilvPort.is_a(Lv2World.port_cv))
else if (lilvPort.is_a(lv2World.port_cv))
rdf_port->Type |= LV2_PORT_CV;

else if (lilvPort.is_a(Lv2World.port_atom))
else if (lilvPort.is_a(lv2World.port_atom))
{
rdf_port->Type |= LV2_PORT_ATOM;

Lilv::Nodes bufferTypeNodes(lilvPort.get_value(Lv2World.atom_bufferType));
Lilv::Nodes bufferTypeNodes(lilvPort.get_value(lv2World.atom_bufferType));

if (bufferTypeNodes.contains(Lv2World.atom_Sequence))
if (bufferTypeNodes.contains(lv2World.atom_Sequence))
rdf_port->Type |= LV2_PORT_ATOM_SEQUENCE;

Lilv::Nodes supportNodes(lilvPort.get_value(Lv2World.atom_supports));
Lilv::Nodes supportNodes(lilvPort.get_value(lv2World.atom_supports));

if (supportNodes.contains(Lv2World.midi_event))
if (supportNodes.contains(lv2World.midi_event))
rdf_port->Type |= LV2_PORT_SUPPORTS_MIDI_EVENT;
if (supportNodes.contains(Lv2World.patch_message))
if (supportNodes.contains(lv2World.patch_message))
rdf_port->Type |= LV2_PORT_SUPPORTS_PATCH_MESSAGE;
}

else if (lilvPort.is_a(Lv2World.port_event))
else if (lilvPort.is_a(lv2World.port_event))
{
rdf_port->Type |= LV2_PORT_EVENT;

if (lilvPort.supports_event(Lv2World.midi_event))
if (lilvPort.supports_event(lv2World.midi_event))
rdf_port->Type |= LV2_PORT_SUPPORTS_MIDI_EVENT;
}

else if (lilvPort.is_a(Lv2World.port_midi))
else if (lilvPort.is_a(lv2World.port_midi))
{
rdf_port->Type |= LV2_PORT_MIDI_LL;
rdf_port->Type |= LV2_PORT_SUPPORTS_MIDI_EVENT;
}

else
qWarning("lv2_rdf_new(\"%s\") - port '%s' is of unkown type", URI, rdf_port->Name);
qWarning("lv2_rdf_new(\"%s\") - port '%s' is of unkown type", uri, rdf_port->Name);
}

// --------------------------------------
// Set Port Properties
{
if (lilvPort.has_property(Lv2World.pprop_optional))
if (lilvPort.has_property(lv2World.pprop_optional))
rdf_port->Properties = LV2_PORT_OPTIONAL;
if (lilvPort.has_property(Lv2World.pprop_enumeration))
if (lilvPort.has_property(lv2World.pprop_enumeration))
rdf_port->Properties = LV2_PORT_ENUMERATION;
if (lilvPort.has_property(Lv2World.pprop_integer))
if (lilvPort.has_property(lv2World.pprop_integer))
rdf_port->Properties = LV2_PORT_INTEGER;
if (lilvPort.has_property(Lv2World.pprop_sampleRate))
if (lilvPort.has_property(lv2World.pprop_sampleRate))
rdf_port->Properties = LV2_PORT_SAMPLE_RATE;
if (lilvPort.has_property(Lv2World.pprop_toggled))
if (lilvPort.has_property(lv2World.pprop_toggled))
rdf_port->Properties = LV2_PORT_TOGGLED;

if (lilvPort.has_property(Lv2World.pprop_artifacts))
if (lilvPort.has_property(lv2World.pprop_artifacts))
rdf_port->Properties = LV2_PORT_CAUSES_ARTIFACTS;
if (lilvPort.has_property(Lv2World.pprop_continuousCV))
if (lilvPort.has_property(lv2World.pprop_continuousCV))
rdf_port->Properties = LV2_PORT_CONTINUOUS_CV;
if (lilvPort.has_property(Lv2World.pprop_discreteCV))
if (lilvPort.has_property(lv2World.pprop_discreteCV))
rdf_port->Properties = LV2_PORT_DISCRETE_CV;
if (lilvPort.has_property(Lv2World.pprop_expensive))
if (lilvPort.has_property(lv2World.pprop_expensive))
rdf_port->Properties = LV2_PORT_EXPENSIVE;
if (lilvPort.has_property(Lv2World.pprop_strictBounds))
if (lilvPort.has_property(lv2World.pprop_strictBounds))
rdf_port->Properties = LV2_PORT_STRICT_BOUNDS;
if (lilvPort.has_property(Lv2World.pprop_logarithmic))
if (lilvPort.has_property(lv2World.pprop_logarithmic))
rdf_port->Properties = LV2_PORT_LOGARITHMIC;
if (lilvPort.has_property(Lv2World.pprop_notAutomatic))
if (lilvPort.has_property(lv2World.pprop_notAutomatic))
rdf_port->Properties = LV2_PORT_NOT_AUTOMATIC;
if (lilvPort.has_property(Lv2World.pprop_notOnGUI))
if (lilvPort.has_property(lv2World.pprop_notOnGUI))
rdf_port->Properties = LV2_PORT_NOT_ON_GUI;
if (lilvPort.has_property(Lv2World.pprop_trigger))
if (lilvPort.has_property(lv2World.pprop_trigger))
rdf_port->Properties = LV2_PORT_TRIGGER;

if (lilvPort.has_property(Lv2World.reportsLatency))
if (lilvPort.has_property(lv2World.reportsLatency))
rdf_port->Designation = LV2_PORT_DESIGNATION_LATENCY;
}

// --------------------------------------
// Set Port Designation
{
Lilv::Nodes designationNodes(lilvPort.get_value(Lv2World.designation));
Lilv::Nodes designationNodes(lilvPort.get_value(lv2World.designation));

if (designationNodes.size() > 0)
{
@@ -642,14 +644,14 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
else if (strncmp(designation, LV2_PORT_GROUPS_PREFIX, strlen(LV2_PORT_GROUPS_PREFIX)) == 0)
pass();
else
qWarning("lv2_rdf_new(\"%s\") - got unknown Port Designation '%s'", URI, designation);
qWarning("lv2_rdf_new(\"%s\") - got unknown Port Designation '%s'", uri, designation);
}
}

// --------------------------------------
// Set Port MIDI Map
{
Lilv::Nodes midiMapNodes(lilvPort.get_value(Lv2World.mm_defaultControl));
Lilv::Nodes midiMapNodes(lilvPort.get_value(lv2World.mm_defaultControl));

if (midiMapNodes.size() > 0)
{
@@ -657,8 +659,8 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)

if (midiMapNode.is_blank())
{
Lilv::Nodes midiMapTypeNodes(Lv2World.find_nodes(midiMapNode, Lv2World.mm_controlType, nullptr));
Lilv::Nodes midiMapNumberNodes(Lv2World.find_nodes(midiMapNode, Lv2World.mm_controlNumber, nullptr));
Lilv::Nodes midiMapTypeNodes(lv2World.find_nodes(midiMapNode, lv2World.mm_controlType, nullptr));
Lilv::Nodes midiMapNumberNodes(lv2World.find_nodes(midiMapNode, lv2World.mm_controlNumber, nullptr));

if (midiMapTypeNodes.size() == 1 && midiMapNumberNodes.size() == 1)
{
@@ -669,7 +671,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
else if (strcmp(midiMapType, LV2_MIDI_Map__NRPN) == 0)
rdf_port->MidiMap.Type = LV2_PORT_MIDI_MAP_NRPN;
else
qWarning("lv2_rdf_new(\"%s\") - got unknown Port Midi Map type '%s'", URI, midiMapType);
qWarning("lv2_rdf_new(\"%s\") - got unknown Port Midi Map type '%s'", uri, midiMapType);

rdf_port->MidiMap.Number = midiMapNumberNodes.get_first().as_int();
}
@@ -680,7 +682,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
// --------------------------------------
// Set Port Points
{
Lilv::Nodes valueNodes(lilvPort.get_value(Lv2World.value_default));
Lilv::Nodes valueNodes(lilvPort.get_value(lv2World.value_default));

if (valueNodes.size() > 0)
{
@@ -688,7 +690,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
rdf_port->Points.Default = valueNodes.get_first().as_float();
}

valueNodes = lilvPort.get_value(Lv2World.value_minimum);
valueNodes = lilvPort.get_value(lv2World.value_minimum);

if (valueNodes.size() > 0)
{
@@ -696,7 +698,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
rdf_port->Points.Minimum = valueNodes.get_first().as_float();
}

valueNodes = lilvPort.get_value(Lv2World.value_maximum);
valueNodes = lilvPort.get_value(lv2World.value_maximum);

if (valueNodes.size() > 0)
{
@@ -708,7 +710,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
// --------------------------------------
// Set Port Unit
{
Lilv::Nodes unitTypeNodes(lilvPort.get_value(Lv2World.unit_unit));
Lilv::Nodes unitTypeNodes(lilvPort.get_value(lv2World.unit_unit));

if (unitTypeNodes.size() > 0)
{
@@ -765,10 +767,10 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
else if (strcmp(unitType, LV2_UNITS__semitone12TET) == 0)
rdf_port->Unit.Type = LV2_UNIT_SEMITONE;
else
qWarning("lv2_rdf_new(\"%s\") - got unknown Unit type '%s'", URI, unitType);
qWarning("lv2_rdf_new(\"%s\") - got unknown Unit type '%s'", uri, unitType);
}

Lilv::Nodes unitNameNodes(lilvPort.get_value(Lv2World.unit_name));
Lilv::Nodes unitNameNodes(lilvPort.get_value(lv2World.unit_name));

if (unitNameNodes.size() > 0)
{
@@ -776,7 +778,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
rdf_port->Unit.Name = strdup(unitNameNodes.get_first().as_string());
}

Lilv::Nodes unitRenderNodes(lilvPort.get_value(Lv2World.unit_render));
Lilv::Nodes unitRenderNodes(lilvPort.get_value(lv2World.unit_render));

if (unitRenderNodes.size() > 0)
{
@@ -784,7 +786,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
rdf_port->Unit.Render = strdup(unitRenderNodes.get_first().as_string());
}

Lilv::Nodes unitSymbolNodes(lilvPort.get_value(Lv2World.unit_symbol));
Lilv::Nodes unitSymbolNodes(lilvPort.get_value(lv2World.unit_symbol));

if (unitSymbolNodes.size() > 0)
{
@@ -820,7 +822,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
// --------------------------------------------------
// Set Plugin Presets (TODO)
{
Lilv::Nodes presetNodes(lilvPlugin.get_related(Lv2World.preset_preset));
Lilv::Nodes presetNodes(lilvPlugin.get_related(lv2World.preset_preset));

if (presetNodes.size() > 0)
{
@@ -841,14 +843,14 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
presetListURIs.sort();

// create presets with unique URIs
rdf_descriptor->PresetCount = presetListURIs.count();
rdf_descriptor->Presets = new LV2_RDF_Preset[rdf_descriptor->PresetCount];
rdfDescriptor->PresetCount = presetListURIs.count();
rdfDescriptor->Presets = new LV2_RDF_Preset[rdfDescriptor->PresetCount];

// set preset data
LILV_FOREACH(nodes, j, presetNodes)
{
Lilv::Node presetNode(presetNodes.get(j));
Lv2World.load_resource(presetNode);
lv2World.load_resource(presetNode);

LV2_URI presetURI = presetNode.as_uri();
int32_t index = presetListURIs.indexOf(QString(presetURI));
@@ -856,14 +858,14 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
if (index < 0)
continue;

LV2_RDF_Preset* const rdf_preset = &rdf_descriptor->Presets[index];
LV2_RDF_Preset* const rdf_preset = &rdfDescriptor->Presets[index];

// --------------------------------------
// Set Preset Information
{
rdf_preset->URI = strdup(presetURI);

Lilv::Nodes presetLabelNodes(Lv2World.find_nodes(presetNode, Lv2World.rdfs_label, nullptr));
Lilv::Nodes presetLabelNodes(lv2World.find_nodes(presetNode, lv2World.rdfs_label, nullptr));

if (presetLabelNodes.size() > 0)
rdf_preset->Label = strdup(presetLabelNodes.get_first().as_string());
@@ -872,7 +874,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
// --------------------------------------
// Set Preset Ports
{
Lilv::Nodes presetPortNodes(Lv2World.find_nodes(presetNode, Lv2World.port, nullptr));
Lilv::Nodes presetPortNodes(lv2World.find_nodes(presetNode, lv2World.port, nullptr));

if (presetPortNodes.size() > 0)
{
@@ -884,8 +886,8 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
{
Lilv::Node presetPortNode(presetPortNodes.get(k));

Lilv::Nodes presetPortSymbolNodes(Lv2World.find_nodes(presetPortNode, Lv2World.symbol, nullptr));
Lilv::Nodes presetPortValueNodes(Lv2World.find_nodes(presetPortNode, Lv2World.preset_value, nullptr));
Lilv::Nodes presetPortSymbolNodes(lv2World.find_nodes(presetPortNode, lv2World.symbol, nullptr));
Lilv::Nodes presetPortValueNodes(lv2World.find_nodes(presetPortNode, lv2World.preset_value, nullptr));

if (presetPortSymbolNodes.size() == 1 && presetPortValueNodes.size() == 1)
{
@@ -900,7 +902,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
// --------------------------------------
// Set Preset States
{
Lilv::Nodes presetStateNodes(Lv2World.find_nodes(presetNode, Lv2World.state_state, nullptr));
Lilv::Nodes presetStateNodes(lv2World.find_nodes(presetNode, lv2World.state_state, nullptr));

if (presetStateNodes.size() > 0)
{
@@ -936,15 +938,15 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
{
Lilv::Nodes lilvFeatureNodesR(lilvPlugin.get_required_features());

rdf_descriptor->FeatureCount = lilvFeatureNodes.size();
rdf_descriptor->Features = new LV2_RDF_Feature[rdf_descriptor->FeatureCount];
rdfDescriptor->FeatureCount = lilvFeatureNodes.size();
rdfDescriptor->Features = new LV2_RDF_Feature[rdfDescriptor->FeatureCount];

uint32_t h = 0;
LILV_FOREACH(nodes, j, lilvFeatureNodes)
{
Lilv::Node lilvFeatureNode(lilvFeatureNodes.get(j));

LV2_RDF_Feature* const rdf_feature = &rdf_descriptor->Features[h++];
LV2_RDF_Feature* const rdf_feature = &rdfDescriptor->Features[h++];
rdf_feature->Type = lilvFeatureNodesR.contains(lilvFeatureNode) ? LV2_FEATURE_REQUIRED : LV2_FEATURE_OPTIONAL;
rdf_feature->URI = strdup(lilvFeatureNode.as_uri());
}
@@ -958,15 +960,15 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)

if (lilvExtensionDataNodes.size() > 0)
{
rdf_descriptor->ExtensionCount = lilvExtensionDataNodes.size();
rdf_descriptor->Extensions = new LV2_URI[rdf_descriptor->ExtensionCount];
rdfDescriptor->ExtensionCount = lilvExtensionDataNodes.size();
rdfDescriptor->Extensions = new LV2_URI[rdfDescriptor->ExtensionCount];

uint32_t h = 0;
LILV_FOREACH(nodes, j, lilvExtensionDataNodes)
{
Lilv::Node lilvExtensionDataNode(lilvExtensionDataNodes.get(j));

LV2_URI* const rdf_extension = &rdf_descriptor->Extensions[h++];
LV2_URI* const rdf_extension = &rdfDescriptor->Extensions[h++];
*rdf_extension = strdup(lilvExtensionDataNode.as_uri());
}
}
@@ -979,36 +981,36 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)

if (lilvUIs.size() > 0)
{
rdf_descriptor->UICount = lilvUIs.size();
rdf_descriptor->UIs = new LV2_RDF_UI[rdf_descriptor->UICount];
rdfDescriptor->UICount = lilvUIs.size();
rdfDescriptor->UIs = new LV2_RDF_UI[rdfDescriptor->UICount];

uint32_t h = 0;
LILV_FOREACH(uis, j, lilvUIs)
{
Lilv::UI lilvUI(lilvUIs.get(j));
LV2_RDF_UI* const rdf_ui = &rdf_descriptor->UIs[h++];
LV2_RDF_UI* const rdf_ui = &rdfDescriptor->UIs[h++];

// --------------------------------------
// Set UI Type
{
if (lilvUI.is_a(Lv2World.ui_gtk2))
if (lilvUI.is_a(lv2World.ui_gtk2))
rdf_ui->Type = LV2_UI_GTK2;
else if (lilvUI.is_a(Lv2World.ui_gtk3))
else if (lilvUI.is_a(lv2World.ui_gtk3))
rdf_ui->Type = LV2_UI_GTK3;
else if (lilvUI.is_a(Lv2World.ui_qt4))
else if (lilvUI.is_a(lv2World.ui_qt4))
rdf_ui->Type = LV2_UI_QT4;
else if (lilvUI.is_a(Lv2World.ui_cocoa))
else if (lilvUI.is_a(lv2World.ui_cocoa))
rdf_ui->Type = LV2_UI_COCOA;
else if (lilvUI.is_a(Lv2World.ui_windows))
else if (lilvUI.is_a(lv2World.ui_windows))
rdf_ui->Type = LV2_UI_WINDOWS;
else if (lilvUI.is_a(Lv2World.ui_x11))
else if (lilvUI.is_a(lv2World.ui_x11))
rdf_ui->Type = LV2_UI_X11;
else if (lilvUI.is_a(Lv2World.ui_external))
else if (lilvUI.is_a(lv2World.ui_external))
rdf_ui->Type = LV2_UI_EXTERNAL;
else if (lilvUI.is_a(Lv2World.ui_externalOld))
else if (lilvUI.is_a(lv2World.ui_externalOld))
rdf_ui->Type = LV2_UI_OLD_EXTERNAL;
else
qWarning("lv2_rdf_new(\"%s\") - got unknown UI type for '%s'", URI, lilvUI.get_uri().as_uri());
qWarning("lv2_rdf_new(\"%s\") - got unknown UI type for '%s'", uri, lilvUI.get_uri().as_uri());
}

// --------------------------------------
@@ -1067,7 +1069,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI URI)
}
}

return rdf_descriptor;
return rdfDescriptor;
}

return nullptr;


+ 16
- 4
c++/carla-utils/carla_vst_utils.hpp View File

@@ -15,14 +15,16 @@
* For a full copy of the GNU General Public License see the COPYING file
*/

#ifndef CARLA_VST_UTILS_H
#define CARLA_VST_UTILS_H
#ifndef CARLA_VST_UTILS_HPP
#define CARLA_VST_UTILS_HPP

// disable deprecated VST features (not)
// Disable deprecated VST features (NOT)
#define VST_FORCE_DEPRECATED 0

#include <cstdint>

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

#if VESTIGE_HEADER
#include "vestige/aeffectx.h"
#define audioMasterGetOutputSpeakerArrangement audioMasterGetSpeakerArrangement
@@ -113,6 +115,10 @@ struct VstTimeInfo_R {
typedef VstTimeInfo VstTimeInfo_R;
#endif

#include "carla_defines.hpp"

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

typedef AEffect* (*VST_Function)(audioMasterCallback);

static inline
@@ -121,6 +127,8 @@ bool vstPluginCanDo(AEffect* const effect, const char* const feature)
return (effect->dispatcher(effect, effCanDo, 0, 0, (void*)feature, 0.0f) == 1);
}

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

static inline
const char* vstEffectOpcode2str(const int32_t opcode)
{
@@ -307,6 +315,8 @@ const char* vstEffectOpcode2str(const int32_t opcode)
}
}

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

static inline
const char* vstMasterOpcode2str(const int32_t opcode)
{
@@ -431,4 +441,6 @@ const char* vstMasterOpcode2str(const int32_t opcode)
}
}

#endif // CARLA_VST_UTILS_H
// ------------------------------------------------------------------------------------------------

#endif // CARLA_VST_UTILS_HPP

Loading…
Cancel
Save