diff --git a/source/backend/native/zynaddsubfx.cpp b/source/backend/native/zynaddsubfx.cpp index 569a75f16..487d95834 100644 --- a/source/backend/native/zynaddsubfx.cpp +++ b/source/backend/native/zynaddsubfx.cpp @@ -428,6 +428,7 @@ private: { fUiClosed = 0; fUi = new MasterUI(kMaster, &fUiClosed); + fUi->npartcounter->callback(_npartcounterCallback, this); fUi->showUI(); } } @@ -475,6 +476,18 @@ private: #endif } +#ifdef WANT_ZYNADDSUBFX_UI + void handlePartCounterCallback(Fl_Widget* widget) + { + carla_stdout("handlePartCounterCallback(%p)", widget); + } + + static void _npartcounterCallback(Fl_Widget* widget, void* ptr) + { + ((ZynThread*)ptr)->handlePartCounterCallback(widget); + } +#endif + private: Master* const kMaster; const HostDescriptor* const kHost; diff --git a/source/discovery/Makefile b/source/discovery/Makefile index 7667c5f14..456bce54d 100644 --- a/source/discovery/Makefile +++ b/source/discovery/Makefile @@ -34,8 +34,7 @@ POSIX_LINK_FLAGS = $(LINK_FLAGS) -ldl WIN_BUILD_FLAGS = $(BUILD_CXX_FLAGS) WIN_32BIT_FLAGS = $(32BIT_FLAGS) WIN_64BIT_FLAGS = $(64BIT_FLAGS) -WIN_LINK_FLAGS = $(LINK_FLAGS) -static -mwindows -# -lole32 -luuid -lws2_32 +WIN_LINK_FLAGS = $(LINK_FLAGS) -static -mwindows -lole32 -luuid -lws2_32 ifeq ($(CARLA_PLUGIN_SUPPORT),true) LIBS = ../libs/lilv.a diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index 7338a76cd..2e3e48eb9 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -53,14 +53,14 @@ CARLA_BACKEND_USE_NAMESPACE // -------------------------------------------------------------------------- // Our LV2 World class object -Lv2WorldClass lv2World; +Lv2WorldClass gLv2World; #endif // -------------------------------------------------------------------------- // Dummy values to test plugins with -const uint32_t bufferSize = 512; -const double sampleRate = 44100.0; +const uint32_t kBufferSize = 512; +const double kSampleRate = 44100.0; // -------------------------------------------------------------------------- // Don't print ELF/EXE related errors since discovery can find multi-architecture binaries @@ -161,7 +161,7 @@ intptr_t VSTCALLBACK vstHostCallback(AEffect* const effect, const int32_t opcode case audioMasterGetTime: static VstTimeInfo_R timeInfo; carla_zeroStruct(timeInfo); - timeInfo.sampleRate = sampleRate; + timeInfo.sampleRate = kSampleRate; // Tempo timeInfo.tempo = 120.0; @@ -190,11 +190,11 @@ intptr_t VSTCALLBACK vstHostCallback(AEffect* const effect, const int32_t opcode #endif case audioMasterGetSampleRate: - ret = sampleRate; + ret = kSampleRate; break; case audioMasterGetBlockSize: - ret = bufferSize; + ret = kBufferSize; break; #if ! VST_FORCE_DEPRECATED @@ -427,7 +427,7 @@ void do_ladspa_check(void* const libHandle, const bool init) // ----------------------------------------------------------------------- // start crash-free plugin test - const LADSPA_Handle handle = descriptor->instantiate(descriptor, sampleRate); + const LADSPA_Handle handle = descriptor->instantiate(descriptor, kSampleRate); if (! handle) { @@ -435,7 +435,7 @@ void do_ladspa_check(void* const libHandle, const bool init) continue; } - LADSPA_Data bufferAudio[bufferSize][audioTotal]; + LADSPA_Data bufferAudio[kBufferSize][audioTotal]; LADSPA_Data bufferParams[parametersTotal]; LADSPA_Data min, max, def; @@ -447,7 +447,7 @@ void do_ladspa_check(void* const libHandle, const bool init) if (LADSPA_IS_PORT_AUDIO(portDescriptor)) { - carla_zeroFloat(bufferAudio[iA], bufferSize); + carla_zeroFloat(bufferAudio[iA], kBufferSize); descriptor->connect_port(handle, j, bufferAudio[iA++]); } else if (LADSPA_IS_PORT_CONTROL(portDescriptor)) @@ -480,9 +480,9 @@ void do_ladspa_check(void* const libHandle, const bool init) if (LADSPA_IS_HINT_SAMPLE_RATE(portRangeHints.HintDescriptor)) { - min *= sampleRate; - max *= sampleRate; - def *= sampleRate; + min *= kSampleRate; + max *= kSampleRate; + def *= kSampleRate; } if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && (std::strcmp(portName, "latency") == 0 || std::strcmp(portName, "_latency") == 0)) @@ -506,7 +506,7 @@ void do_ladspa_check(void* const libHandle, const bool init) if (descriptor->activate) descriptor->activate(handle); - descriptor->run(handle, bufferSize); + descriptor->run(handle, kBufferSize); if (descriptor->deactivate) descriptor->deactivate(handle); @@ -635,7 +635,7 @@ void do_dssi_check(void* const libHandle, const bool init) // ----------------------------------------------------------------------- // start crash-free plugin test - const LADSPA_Handle handle = ldescriptor->instantiate(ldescriptor, sampleRate); + const LADSPA_Handle handle = ldescriptor->instantiate(ldescriptor, kSampleRate); if (! handle) { @@ -649,7 +649,7 @@ void do_dssi_check(void* const libHandle, const bool init) continue; } - LADSPA_Data bufferAudio[bufferSize][audioTotal]; + LADSPA_Data bufferAudio[kBufferSize][audioTotal]; LADSPA_Data bufferParams[parametersTotal]; LADSPA_Data min, max, def; @@ -661,7 +661,7 @@ void do_dssi_check(void* const libHandle, const bool init) if (LADSPA_IS_PORT_AUDIO(portDescriptor)) { - carla_zeroFloat(bufferAudio[iA], bufferSize); + carla_zeroFloat(bufferAudio[iA], kBufferSize); ldescriptor->connect_port(handle, j, bufferAudio[iA++]); } else if (LADSPA_IS_PORT_CONTROL(portDescriptor)) @@ -694,9 +694,9 @@ void do_dssi_check(void* const libHandle, const bool init) if (LADSPA_IS_HINT_SAMPLE_RATE(portRangeHints.HintDescriptor)) { - min *= sampleRate; - max *= sampleRate; - def *= sampleRate; + min *= kSampleRate; + max *= kSampleRate; + def *= kSampleRate; } if (LADSPA_IS_PORT_OUTPUT(portDescriptor) && (std::strcmp(portName, "latency") == 0 || std::strcmp(portName, "_latency") == 0)) @@ -741,20 +741,20 @@ void do_dssi_check(void* const libHandle, const bool init) midiEvents[1].type = SND_SEQ_EVENT_NOTEOFF; midiEvents[1].data.note.note = 64; midiEvents[1].data.note.velocity = 0; - midiEvents[1].time.tick = bufferSize/2; + midiEvents[1].time.tick = kBufferSize/2; if (descriptor->run_multiple_synths && ! descriptor->run_synth) { LADSPA_Handle handlePtr[1] = { handle }; snd_seq_event_t* midiEventsPtr[1] = { midiEvents }; unsigned long midiEventCountPtr[1] = { midiEventCount }; - descriptor->run_multiple_synths(1, handlePtr, bufferSize, midiEventsPtr, midiEventCountPtr); + descriptor->run_multiple_synths(1, handlePtr, kBufferSize, midiEventsPtr, midiEventCountPtr); } else - descriptor->run_synth(handle, bufferSize, midiEvents, midiEventCount); + descriptor->run_synth(handle, kBufferSize, midiEvents, midiEventCount); } else - ldescriptor->run(handle, bufferSize); + ldescriptor->run(handle, kBufferSize); if (ldescriptor->deactivate) ldescriptor->deactivate(handle); @@ -803,11 +803,11 @@ void do_lv2_check(const char* const bundle, const bool init) qBundle += QChar(OS_SEP); // Load bundle - Lilv::Node lilvBundle(lv2World.new_uri(qBundle.toUtf8().constData())); - lv2World.load_bundle(lilvBundle); + Lilv::Node lilvBundle(gLv2World.new_uri(qBundle.toUtf8().constData())); + gLv2World.load_bundle(lilvBundle); // Load plugins in this bundle - const Lilv::Plugins lilvPlugins = lv2World.get_all_plugins(); + const Lilv::Plugins lilvPlugins(gLv2World.get_all_plugins()); // Get all plugin URIs in this bundle QStringList URIs; @@ -1119,10 +1119,10 @@ void do_vst_check(void* const libHandle, const bool init) if (init) { #if ! VST_FORCE_DEPRECATED - effect->dispatcher(effect, effSetBlockSizeAndSampleRate, 0, bufferSize, nullptr, sampleRate); + effect->dispatcher(effect, effSetBlockSizeAndSampleRate, 0, kBufferSize, nullptr, kSampleRate); #endif - effect->dispatcher(effect, effSetBlockSize, 0, bufferSize, nullptr, 0.0f); - effect->dispatcher(effect, effSetSampleRate, 0, 0, nullptr, sampleRate); + effect->dispatcher(effect, effSetBlockSize, 0, kBufferSize, nullptr, 0.0f); + effect->dispatcher(effect, effSetSampleRate, 0, 0, nullptr, kSampleRate); effect->dispatcher(effect, effSetProcessPrecision, 0, kVstProcessPrecision32, nullptr, 0.0f); effect->dispatcher(effect, effStopProcess, 0, 0, nullptr, 0.0f); @@ -1141,15 +1141,15 @@ void do_vst_check(void* const libHandle, const bool init) float* bufferAudioIn[audioIns]; for (int j=0; j < audioIns; j++) { - bufferAudioIn[j] = new float [bufferSize]; - carla_zeroFloat(bufferAudioIn[j], bufferSize); + bufferAudioIn[j] = new float[kBufferSize]; + carla_zeroFloat(bufferAudioIn[j], kBufferSize); } float* bufferAudioOut[audioOuts]; for (int j=0; j < audioOuts; j++) { - bufferAudioOut[j] = new float [bufferSize]; - carla_zeroFloat(bufferAudioOut[j], bufferSize); + bufferAudioOut[j] = new float[kBufferSize]; + carla_zeroFloat(bufferAudioOut[j], kBufferSize); } struct VstEventsFixed { @@ -1157,10 +1157,12 @@ void do_vst_check(void* const libHandle, const bool init) intptr_t reserved; VstEvent* data[2]; +#ifndef QTCREATOR_TEST VstEventsFixed() : numEvents(0), reserved(0), data{0} {} +#endif } events; VstMidiEvent midiEvents[2]; @@ -1176,7 +1178,7 @@ void do_vst_check(void* const libHandle, const bool init) midiEvents[1].byteSize = sizeof(VstMidiEvent); midiEvents[1].midiData[0] = MIDI_STATUS_NOTE_OFF; midiEvents[1].midiData[1] = 64; - midiEvents[1].deltaFrames = bufferSize/2; + midiEvents[1].deltaFrames = kBufferSize/2; events.numEvents = 2; events.data[0] = (VstEvent*)&midiEvents[0]; @@ -1191,9 +1193,9 @@ void do_vst_check(void* const libHandle, const bool init) #if ! VST_FORCE_DEPRECATED if ((effect->flags & effFlagsCanReplacing) > 0 && effect->processReplacing && effect->processReplacing != effect->process) - effect->processReplacing(effect, bufferAudioIn, bufferAudioOut, bufferSize); - else if (effect->process) - effect->process(effect, bufferAudioIn, bufferAudioOut, bufferSize); + effect->processReplacing(effect, bufferAudioIn, bufferAudioOut, kBufferSize); + else if (effect->process != nullptr) + effect->process(effect, bufferAudioIn, bufferAudioOut, kBufferSize); else DISCOVERY_OUT("error", "Plugin doesn't have a process function"); #else @@ -1466,50 +1468,20 @@ int main(int argc, char* argv[]) const char* const stype = argv[1]; const char* const filename = argv[2]; + const PluginType type = getPluginTypeFromString(stype); - bool openLib; - PluginType type; + bool openLib = false; void* handle = nullptr; - if (std::strcmp(stype, "LADSPA") == 0) - { - openLib = true; - type = PLUGIN_LADSPA; - } - else if (std::strcmp(stype, "DSSI") == 0) - { - openLib = true; - type = PLUGIN_DSSI; - } - else if (std::strcmp(stype, "LV2") == 0) - { - openLib = false; - type = PLUGIN_LV2; - } - else if (std::strcmp(stype, "VST") == 0) + switch (type) { + case PLUGIN_LADSPA: + case PLUGIN_DSSI: + case PLUGIN_VST: + case PLUGIN_VST3: openLib = true; - type = PLUGIN_VST; - } - else if (std::strcmp(stype, "GIG") == 0) - { - openLib = false; - type = PLUGIN_GIG; - } - else if (std::strcmp(stype, "SF2") == 0) - { - openLib = false; - type = PLUGIN_SF2; - } - else if (std::strcmp(stype, "SFZ") == 0) - { - openLib = false; - type = PLUGIN_SFZ; - } - else - { - DISCOVERY_OUT("error", "Invalid plugin type"); - return 1; + default: + break; } if (openLib) @@ -1523,6 +1495,7 @@ int main(int argc, char* argv[]) } } + // never do init for dssi-vst, takes too long and it's crashy bool doInit = ! QString(filename).endsWith("dssi-vst.so", Qt::CaseInsensitive); if (doInit && getenv("CARLA_DISCOVERY_NO_PROCESSING_CHECKS")) @@ -1559,6 +1532,7 @@ int main(int argc, char* argv[]) do_lv2_check(filename, doInit); break; case PLUGIN_VST: + case PLUGIN_VST3: do_vst_check(handle, doInit); break; case PLUGIN_GIG: diff --git a/source/discovery/carla-discovery.pro b/source/discovery/carla-discovery.pro index ac79c2271..dc181a13a 100644 --- a/source/discovery/carla-discovery.pro +++ b/source/discovery/carla-discovery.pro @@ -1,48 +1,54 @@ # QtCreator project file -QT = core +TARGET = carla-discovery-qtcreator +TEMPLATE = app +VERSION = 0.5.0 -CONFIG = debug link_pkgconfig qt warn_on +# ------------------------------------------------------- -DEFINES = DEBUG -DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST -DEFINES += WANT_FLUIDSYNTH WANT_LINUXSAMPLER +CONFIG = debug +CONFIG += link_pkgconfig shared warn_on -PKGCONFIG = fluidsynth linuxsampler +DEFINES = DEBUG +DEFINES += QTCREATOR_TEST -TARGET = carla-discovery-qtcreator -TEMPLATE = app -VERSION = 0.5.0 +DEFINES += WANT_LADSPA +DEFINES += WANT_DSSI +DEFINES += WANT_LV2 +DEFINES += WANT_VST +DEFINES += WANT_FLUIDSYNTH +DEFINES += WANT_LINUXSAMPLER + +PKGCONFIG = QtCore +PKGCONFIG += fluidsynth +PKGCONFIG += linuxsampler SOURCES = \ carla-discovery.cpp -HEADERS = \ - ../includes/carla_defines.hpp \ - ../includes/carla_midi.h \ +# ------------------------------------------------------- + +HEADERS = \ + ../backend/CarlaBackend.hpp + +HEADERS += \ + ../includes/CarlaDefines.hpp \ + ../includes/CarlaMIDI.h \ ../includes/ladspa_rdf.hpp \ ../includes/lv2_rdf.hpp \ - ../backend/carla_backend.hpp \ - ../utils/carla_utils.hpp \ - ../utils/carla_juce_utils.hpp \ - ../utils/carla_lib_utils.hpp \ - ../utils/carla_ladspa_utils.hpp \ - ../utils/carla_lv2_utils.hpp \ - ../utils/carla_vst_utils.hpp + ../utils/CarlaUtils.hpp \ + ../utils/CarlaJuceUtils.hpp \ + ../utils/CarlaLibUtils.hpp \ + ../utils/CarlaLadspaUtils.hpp \ + ../utils/CarlaLv2Utils.hpp \ + ../utils/CarlaVstUtils.hpp INCLUDEPATH = \ ../backend \ ../includes \ ../utils -LIBS = \ - ../libs/lilv.a - -unix { -LIBS += -ldl -} -mingw { -LIBS += -static -mwindows -} +LIBS = -ldl +LIBS += ../libs/lilv.a QMAKE_CXXFLAGS *= -std=c++0x diff --git a/source/tests/ANSI.cpp b/source/tests/ANSI.cpp index a212e3c84..a2e57f4ff 100644 --- a/source/tests/ANSI.cpp +++ b/source/tests/ANSI.cpp @@ -15,7 +15,16 @@ * For a full copy of the GNU General Public License see the GPL.txt file */ -#include "CarlaBase64Utils.hpp" +//#include "CarlaBackendUtils.hpp" +//#include "CarlaLadspaUtils.hpp" +//#include "CarlaLibUtils.hpp" +//#include "CarlaLv2Utils.hpp" +//#include "CarlaOscUtils.hpp" +//#include "CarlaStateUtils.hpp" +//#include "CarlaString.hpp" +//#include "CarlaThread.hpp" +//#include "CarlaVstUtils.hpp" +//#include "RtList.hpp" int main() { diff --git a/source/tests/Makefile b/source/tests/Makefile index baf816828..a15e57c12 100644 --- a/source/tests/Makefile +++ b/source/tests/Makefile @@ -11,7 +11,7 @@ include ../Makefile.mk BUILD_CXX_FLAGS += -I../backend -I../includes -I../libs -I../utils -Wall -Wextra # BUILD_CXX_FLAGS += -isystem ../libs/juce # BUILD_CXX_FLAGS += -DWANT_JACK -DWANT_LADSPA -DWANT_DSSI -# BUILD_CXX_FLAGS += -isystem /usr/include/qt4 +BUILD_CXX_FLAGS += -isystem /usr/include/qt4 # BUILD_CXX_FLAGS += -isystem ../backend/engine/rtaudio-4.0.11 # BUILD_CXX_FLAGS += -I/opt/mingw32/include @@ -48,7 +48,7 @@ Utils: Utils.cpp $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ RUN: $(TARGETS) - valgrind ./Base64 +# valgrind ./Base64 # ./ANSI # ./CarlaString && ./RtList && ./Thread # ./Print diff --git a/source/utils/CarlaLv2Utils.hpp b/source/utils/CarlaLv2Utils.hpp index de1553f34..ba3616a96 100644 --- a/source/utils/CarlaLv2Utils.hpp +++ b/source/utils/CarlaLv2Utils.hpp @@ -382,7 +382,7 @@ private: // ----------------------------------------------------- // Our LV2 World class object -extern Lv2WorldClass lv2World; +extern Lv2WorldClass gLv2World; // ----------------------------------------------------- // Create new RDF object (using lilv) @@ -398,7 +398,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) return nullptr; } - const LilvPlugin* const cPlugin(lv2World.getPlugin(uri)); + const LilvPlugin* const cPlugin(gLv2World.getPlugin(uri)); if (! cPlugin) { @@ -408,88 +408,88 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) LV2_RDF_Descriptor* const rdfDescriptor = new LV2_RDF_Descriptor; - Lilv::Plugin lilvPlugin(lv2World.getPlugin(uri)); + Lilv::Plugin lilvPlugin(gLv2World.getPlugin(uri)); // -------------------------------------------------- // Set Plugin Type { - Lilv::Nodes typeNodes(lilvPlugin.get_value(lv2World.rdf_type)); + Lilv::Nodes typeNodes(lilvPlugin.get_value(gLv2World.rdf_type)); if (typeNodes.size() > 0) { - if (typeNodes.contains(lv2World.class_allpass)) + if (typeNodes.contains(gLv2World.class_allpass)) rdfDescriptor->Type[0] |= LV2_PLUGIN_ALLPASS; - if (typeNodes.contains(lv2World.class_amplifier)) + if (typeNodes.contains(gLv2World.class_amplifier)) rdfDescriptor->Type[0] |= LV2_PLUGIN_AMPLIFIER; - if (typeNodes.contains(lv2World.class_analyzer)) + if (typeNodes.contains(gLv2World.class_analyzer)) rdfDescriptor->Type[1] |= LV2_PLUGIN_ANALYSER; - if (typeNodes.contains(lv2World.class_bandpass)) + if (typeNodes.contains(gLv2World.class_bandpass)) rdfDescriptor->Type[0] |= LV2_PLUGIN_BANDPASS; - if (typeNodes.contains(lv2World.class_chorus)) + if (typeNodes.contains(gLv2World.class_chorus)) rdfDescriptor->Type[1] |= LV2_PLUGIN_CHORUS; - if (typeNodes.contains(lv2World.class_comb)) + if (typeNodes.contains(gLv2World.class_comb)) rdfDescriptor->Type[1] |= LV2_PLUGIN_COMB; - if (typeNodes.contains(lv2World.class_compressor)) + if (typeNodes.contains(gLv2World.class_compressor)) rdfDescriptor->Type[0] |= LV2_PLUGIN_COMPRESSOR; - if (typeNodes.contains(lv2World.class_constant)) + if (typeNodes.contains(gLv2World.class_constant)) rdfDescriptor->Type[1] |= LV2_PLUGIN_CONSTANT; - if (typeNodes.contains(lv2World.class_converter)) + if (typeNodes.contains(gLv2World.class_converter)) rdfDescriptor->Type[1] |= LV2_PLUGIN_CONVERTER; - if (typeNodes.contains(lv2World.class_delay)) + if (typeNodes.contains(gLv2World.class_delay)) rdfDescriptor->Type[0] |= LV2_PLUGIN_DELAY; - if (typeNodes.contains(lv2World.class_distortion)) + if (typeNodes.contains(gLv2World.class_distortion)) rdfDescriptor->Type[0] |= LV2_PLUGIN_DISTORTION; - if (typeNodes.contains(lv2World.class_dynamics)) + if (typeNodes.contains(gLv2World.class_dynamics)) rdfDescriptor->Type[0] |= LV2_PLUGIN_DYNAMICS; - if (typeNodes.contains(lv2World.class_eq)) + if (typeNodes.contains(gLv2World.class_eq)) rdfDescriptor->Type[0] |= LV2_PLUGIN_EQ; - if (typeNodes.contains(lv2World.class_envelope)) + if (typeNodes.contains(gLv2World.class_envelope)) rdfDescriptor->Type[0] |= LV2_PLUGIN_ENVELOPE; - if (typeNodes.contains(lv2World.class_expander)) + if (typeNodes.contains(gLv2World.class_expander)) rdfDescriptor->Type[0] |= LV2_PLUGIN_EXPANDER; - if (typeNodes.contains(lv2World.class_filter)) + if (typeNodes.contains(gLv2World.class_filter)) rdfDescriptor->Type[0] |= LV2_PLUGIN_FILTER; - if (typeNodes.contains(lv2World.class_flanger)) + if (typeNodes.contains(gLv2World.class_flanger)) rdfDescriptor->Type[1] |= LV2_PLUGIN_FLANGER; - if (typeNodes.contains(lv2World.class_function)) + if (typeNodes.contains(gLv2World.class_function)) rdfDescriptor->Type[1] |= LV2_PLUGIN_FUNCTION; - if (typeNodes.contains(lv2World.class_gate)) + if (typeNodes.contains(gLv2World.class_gate)) rdfDescriptor->Type[0] |= LV2_PLUGIN_GATE; - if (typeNodes.contains(lv2World.class_generator)) + if (typeNodes.contains(gLv2World.class_generator)) rdfDescriptor->Type[1] |= LV2_PLUGIN_GENERATOR; - if (typeNodes.contains(lv2World.class_highpass)) + if (typeNodes.contains(gLv2World.class_highpass)) rdfDescriptor->Type[0] |= LV2_PLUGIN_HIGHPASS; - if (typeNodes.contains(lv2World.class_instrument)) + if (typeNodes.contains(gLv2World.class_instrument)) rdfDescriptor->Type[1] |= LV2_PLUGIN_INSTRUMENT; - if (typeNodes.contains(lv2World.class_limiter)) + if (typeNodes.contains(gLv2World.class_limiter)) rdfDescriptor->Type[0] |= LV2_PLUGIN_LIMITER; - if (typeNodes.contains(lv2World.class_lowpass)) + if (typeNodes.contains(gLv2World.class_lowpass)) rdfDescriptor->Type[0] |= LV2_PLUGIN_LOWPASS; - if (typeNodes.contains(lv2World.class_mixer)) + if (typeNodes.contains(gLv2World.class_mixer)) rdfDescriptor->Type[1] |= LV2_PLUGIN_MIXER; - if (typeNodes.contains(lv2World.class_modulator)) + if (typeNodes.contains(gLv2World.class_modulator)) rdfDescriptor->Type[1] |= LV2_PLUGIN_MODULATOR; - if (typeNodes.contains(lv2World.class_multiEQ)) + if (typeNodes.contains(gLv2World.class_multiEQ)) rdfDescriptor->Type[0] |= LV2_PLUGIN_MULTI_EQ; - if (typeNodes.contains(lv2World.class_oscillator)) + if (typeNodes.contains(gLv2World.class_oscillator)) rdfDescriptor->Type[1] |= LV2_PLUGIN_OSCILLATOR; - if (typeNodes.contains(lv2World.class_paraEQ)) + if (typeNodes.contains(gLv2World.class_paraEQ)) rdfDescriptor->Type[0] |= LV2_PLUGIN_PARA_EQ; - if (typeNodes.contains(lv2World.class_phaser)) + if (typeNodes.contains(gLv2World.class_phaser)) rdfDescriptor->Type[1] |= LV2_PLUGIN_PHASER; - if (typeNodes.contains(lv2World.class_pitch)) + if (typeNodes.contains(gLv2World.class_pitch)) rdfDescriptor->Type[1] |= LV2_PLUGIN_PITCH; - if (typeNodes.contains(lv2World.class_reverb)) + if (typeNodes.contains(gLv2World.class_reverb)) rdfDescriptor->Type[0] |= LV2_PLUGIN_REVERB; - if (typeNodes.contains(lv2World.class_simulator)) + if (typeNodes.contains(gLv2World.class_simulator)) rdfDescriptor->Type[0] |= LV2_PLUGIN_SIMULATOR; - if (typeNodes.contains(lv2World.class_spatial)) + if (typeNodes.contains(gLv2World.class_spatial)) rdfDescriptor->Type[1] |= LV2_PLUGIN_SPATIAL; - if (typeNodes.contains(lv2World.class_spectral)) + if (typeNodes.contains(gLv2World.class_spectral)) rdfDescriptor->Type[1] |= LV2_PLUGIN_SPECTRAL; - if (typeNodes.contains(lv2World.class_utility)) + if (typeNodes.contains(gLv2World.class_utility)) rdfDescriptor->Type[1] |= LV2_PLUGIN_UTILITY; - if (typeNodes.contains(lv2World.class_waveshaper)) + if (typeNodes.contains(gLv2World.class_waveshaper)) rdfDescriptor->Type[0] |= LV2_PLUGIN_WAVESHAPER; } } @@ -511,7 +511,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) if (const char* const bundle = lilvPlugin.get_bundle_uri().as_string()) rdfDescriptor->Bundle = carla_strdup(lilv_uri_to_path(bundle)); - Lilv::Nodes licenseNodes(lilvPlugin.get_value(lv2World.doap_license)); + Lilv::Nodes licenseNodes(lilvPlugin.get_value(gLv2World.doap_license)); if (licenseNodes.size() > 0) { @@ -523,7 +523,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) // -------------------------------------------------- // Set Plugin UniqueID { - Lilv::Nodes replaceNodes(lilvPlugin.get_value(lv2World.dct_replaces)); + Lilv::Nodes replaceNodes(lilvPlugin.get_value(gLv2World.dct_replaces)); if (replaceNodes.size() > 0) { @@ -574,58 +574,58 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) // Set Port Mode and Type { // Input or Output - if (lilvPort.is_a(lv2World.port_input)) + if (lilvPort.is_a(gLv2World.port_input)) rdfPort->Types |= LV2_PORT_INPUT; - else if (lilvPort.is_a(lv2World.port_output)) + else if (lilvPort.is_a(gLv2World.port_output)) rdfPort->Types |= LV2_PORT_OUTPUT; else carla_stderr("lv2_rdf_new(\"%s\") - port '%s' is not input or output", uri, rdfPort->Name); // Data Type - if (lilvPort.is_a(lv2World.port_control)) + if (lilvPort.is_a(gLv2World.port_control)) rdfPort->Types |= LV2_PORT_CONTROL; - else if (lilvPort.is_a(lv2World.port_audio)) + else if (lilvPort.is_a(gLv2World.port_audio)) rdfPort->Types |= LV2_PORT_AUDIO; - else if (lilvPort.is_a(lv2World.port_cv)) + else if (lilvPort.is_a(gLv2World.port_cv)) rdfPort->Types |= LV2_PORT_CV; - else if (lilvPort.is_a(lv2World.port_atom)) + else if (lilvPort.is_a(gLv2World.port_atom)) { rdfPort->Types |= LV2_PORT_ATOM; - Lilv::Nodes bufferTypeNodes(lilvPort.get_value(lv2World.atom_bufferType)); + Lilv::Nodes bufferTypeNodes(lilvPort.get_value(gLv2World.atom_bufferType)); - if (bufferTypeNodes.contains(lv2World.atom_sequence)) + if (bufferTypeNodes.contains(gLv2World.atom_sequence)) rdfPort->Types |= LV2_PORT_ATOM_SEQUENCE; else carla_stderr("lv2_rdf_new(\"%s\") - port '%s' uses an unknown atom buffer type", uri, rdfPort->Name); - Lilv::Nodes supportNodes(lilvPort.get_value(lv2World.atom_supports)); + Lilv::Nodes supportNodes(lilvPort.get_value(gLv2World.atom_supports)); - if (supportNodes.contains(lv2World.midi_event)) + if (supportNodes.contains(gLv2World.midi_event)) rdfPort->Types |= LV2_PORT_DATA_MIDI_EVENT; - if (supportNodes.contains(lv2World.patch_message)) + if (supportNodes.contains(gLv2World.patch_message)) rdfPort->Types |= LV2_PORT_DATA_PATCH_MESSAGE; - if (! (supportNodes.contains(lv2World.midi_event) || supportNodes.contains(lv2World.patch_message))) + if (! (supportNodes.contains(gLv2World.midi_event) || supportNodes.contains(gLv2World.patch_message))) carla_stderr("lv2_rdf_new(\"%s\") - port '%s' is of atom type but doesn't support MIDI or messages", uri, rdfPort->Name); } - else if (lilvPort.is_a(lv2World.port_event)) + else if (lilvPort.is_a(gLv2World.port_event)) { rdfPort->Types |= LV2_PORT_EVENT; - if (lilvPort.supports_event(lv2World.midi_event)) + if (lilvPort.supports_event(gLv2World.midi_event)) rdfPort->Types |= LV2_PORT_DATA_MIDI_EVENT; else carla_stderr("lv2_rdf_new(\"%s\") - port '%s' is of event type but doesn't support MIDI", uri, rdfPort->Name); } - else if (lilvPort.is_a(lv2World.port_midi)) + else if (lilvPort.is_a(gLv2World.port_midi)) { rdfPort->Types |= LV2_PORT_MIDI_LL; rdfPort->Types |= LV2_PORT_DATA_MIDI_EVENT; @@ -638,44 +638,44 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) // -------------------------------------- // Set Port Properties { - if (lilvPort.has_property(lv2World.pprop_optional)) + if (lilvPort.has_property(gLv2World.pprop_optional)) rdfPort->Properties |= LV2_PORT_OPTIONAL; - if (lilvPort.has_property(lv2World.pprop_enumeration)) + if (lilvPort.has_property(gLv2World.pprop_enumeration)) rdfPort->Properties |= LV2_PORT_ENUMERATION; - if (lilvPort.has_property(lv2World.pprop_integer)) + if (lilvPort.has_property(gLv2World.pprop_integer)) rdfPort->Properties |= LV2_PORT_INTEGER; - if (lilvPort.has_property(lv2World.pprop_sampleRate)) + if (lilvPort.has_property(gLv2World.pprop_sampleRate)) rdfPort->Properties |= LV2_PORT_SAMPLE_RATE; - if (lilvPort.has_property(lv2World.pprop_toggled)) + if (lilvPort.has_property(gLv2World.pprop_toggled)) rdfPort->Properties |= LV2_PORT_TOGGLED; - if (lilvPort.has_property(lv2World.pprop_artifacts)) + if (lilvPort.has_property(gLv2World.pprop_artifacts)) rdfPort->Properties |= LV2_PORT_CAUSES_ARTIFACTS; - if (lilvPort.has_property(lv2World.pprop_continuousCV)) + if (lilvPort.has_property(gLv2World.pprop_continuousCV)) rdfPort->Properties |= LV2_PORT_CONTINUOUS_CV; - if (lilvPort.has_property(lv2World.pprop_discreteCV)) + if (lilvPort.has_property(gLv2World.pprop_discreteCV)) rdfPort->Properties |= LV2_PORT_DISCRETE_CV; - if (lilvPort.has_property(lv2World.pprop_expensive)) + if (lilvPort.has_property(gLv2World.pprop_expensive)) rdfPort->Properties |= LV2_PORT_EXPENSIVE; - if (lilvPort.has_property(lv2World.pprop_strictBounds)) + if (lilvPort.has_property(gLv2World.pprop_strictBounds)) rdfPort->Properties |= LV2_PORT_STRICT_BOUNDS; - if (lilvPort.has_property(lv2World.pprop_logarithmic)) + if (lilvPort.has_property(gLv2World.pprop_logarithmic)) rdfPort->Properties |= LV2_PORT_LOGARITHMIC; - if (lilvPort.has_property(lv2World.pprop_notAutomatic)) + if (lilvPort.has_property(gLv2World.pprop_notAutomatic)) rdfPort->Properties |= LV2_PORT_NOT_AUTOMATIC; - if (lilvPort.has_property(lv2World.pprop_notOnGUI)) + if (lilvPort.has_property(gLv2World.pprop_notOnGUI)) rdfPort->Properties |= LV2_PORT_NOT_ON_GUI; - if (lilvPort.has_property(lv2World.pprop_trigger)) + if (lilvPort.has_property(gLv2World.pprop_trigger)) rdfPort->Properties |= LV2_PORT_TRIGGER; - if (lilvPort.has_property(lv2World.reportsLatency)) + if (lilvPort.has_property(gLv2World.reportsLatency)) rdfPort->Designation = LV2_PORT_DESIGNATION_LATENCY; } // -------------------------------------- // Set Port Designation { - Lilv::Nodes designationNodes(lilvPort.get_value(lv2World.designation)); + Lilv::Nodes designationNodes(lilvPort.get_value(gLv2World.designation)); if (designationNodes.size() > 0) { @@ -720,7 +720,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) // -------------------------------------- // Set Port MIDI Map { - Lilv::Nodes midiMapNodes(lilvPort.get_value(lv2World.mm_defaultControl)); + Lilv::Nodes midiMapNodes(lilvPort.get_value(gLv2World.mm_defaultControl)); if (midiMapNodes.size() > 0) { @@ -728,8 +728,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(gLv2World.find_nodes(midiMapNode, gLv2World.mm_controlType, nullptr)); + Lilv::Nodes midiMapNumberNodes(gLv2World.find_nodes(midiMapNode, gLv2World.mm_controlNumber, nullptr)); if (midiMapTypeNodes.size() == 1 && midiMapNumberNodes.size() == 1) { @@ -754,7 +754,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(gLv2World.value_default)); if (valueNodes.size() > 0) { @@ -762,7 +762,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) rdfPort->Points.Default = valueNodes.get_first().as_float(); } - valueNodes = lilvPort.get_value(lv2World.value_minimum); + valueNodes = lilvPort.get_value(gLv2World.value_minimum); if (valueNodes.size() > 0) { @@ -770,7 +770,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) rdfPort->Points.Minimum = valueNodes.get_first().as_float(); } - valueNodes = lilvPort.get_value(lv2World.value_maximum); + valueNodes = lilvPort.get_value(gLv2World.value_maximum); if (valueNodes.size() > 0) { @@ -782,7 +782,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) // -------------------------------------- // Set Port Unit { - Lilv::Nodes unitUnitNodes(lilvPort.get_value(lv2World.unit_unit)); + Lilv::Nodes unitUnitNodes(lilvPort.get_value(gLv2World.unit_unit)); if (unitUnitNodes.size() > 0) { @@ -843,7 +843,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) } } - Lilv::Nodes unitNameNodes(lilvPort.get_value(lv2World.unit_name)); + Lilv::Nodes unitNameNodes(lilvPort.get_value(gLv2World.unit_name)); if (unitNameNodes.size() > 0) { @@ -854,7 +854,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) } } - Lilv::Nodes unitRenderNodes(lilvPort.get_value(lv2World.unit_render)); + Lilv::Nodes unitRenderNodes(lilvPort.get_value(gLv2World.unit_render)); if (unitRenderNodes.size() > 0) { @@ -865,7 +865,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) } } - Lilv::Nodes unitSymbolNodes(lilvPort.get_value(lv2World.unit_symbol)); + Lilv::Nodes unitSymbolNodes(lilvPort.get_value(gLv2World.unit_symbol)); if (unitSymbolNodes.size() > 0) { @@ -905,7 +905,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) // -------------------------------------------------- // Set Plugin Presets { - Lilv::Nodes presetNodes(lilvPlugin.get_related(lv2World.preset_preset)); + Lilv::Nodes presetNodes(lilvPlugin.get_related(gLv2World.preset_preset)); if (presetNodes.size() > 0) { @@ -934,7 +934,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) { Lilv::Node presetNode(presetNodes.get(j)); - if (lv2World.load_resource(presetNode) == -1) + if (gLv2World.load_resource(presetNode) == -1) continue; if (const char* const presetURI = presetNode.as_uri()) @@ -951,7 +951,7 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) { rdfPreset->URI = carla_strdup(presetURI); - Lilv::Nodes presetLabelNodes(lv2World.find_nodes(presetNode, lv2World.rdfs_label, nullptr)); + Lilv::Nodes presetLabelNodes(gLv2World.find_nodes(presetNode, gLv2World.rdfs_label, nullptr)); if (presetLabelNodes.size() > 0) { @@ -1038,23 +1038,23 @@ const LV2_RDF_Descriptor* lv2_rdf_new(const LV2_URI uri) rdfUI->Type.URI = carla_strdup(uiType); - if (lilvUI.is_a(lv2World.ui_gtk2)) + if (lilvUI.is_a(gLv2World.ui_gtk2)) rdfUI->Type.Value = LV2_UI_GTK2; - else if (lilvUI.is_a(lv2World.ui_gtk3)) + else if (lilvUI.is_a(gLv2World.ui_gtk3)) rdfUI->Type.Value = LV2_UI_GTK3; - else if (lilvUI.is_a(lv2World.ui_qt4)) + else if (lilvUI.is_a(gLv2World.ui_qt4)) rdfUI->Type.Value = LV2_UI_QT4; - else if (lilvUI.is_a(lv2World.ui_qt5)) + else if (lilvUI.is_a(gLv2World.ui_qt5)) rdfUI->Type.Value = LV2_UI_QT5; - else if (lilvUI.is_a(lv2World.ui_cocoa)) + else if (lilvUI.is_a(gLv2World.ui_cocoa)) rdfUI->Type.Value = LV2_UI_COCOA; - else if (lilvUI.is_a(lv2World.ui_windows)) + else if (lilvUI.is_a(gLv2World.ui_windows)) rdfUI->Type.Value = LV2_UI_WINDOWS; - else if (lilvUI.is_a(lv2World.ui_x11)) + else if (lilvUI.is_a(gLv2World.ui_x11)) rdfUI->Type.Value = LV2_UI_X11; - else if (lilvUI.is_a(lv2World.ui_external)) + else if (lilvUI.is_a(gLv2World.ui_external)) rdfUI->Type.Value = LV2_UI_EXTERNAL; - else if (lilvUI.is_a(lv2World.ui_externalOld)) + else if (lilvUI.is_a(gLv2World.ui_externalOld)) rdfUI->Type.Value = LV2_UI_OLD_EXTERNAL; else carla_stderr("lv2_rdf_new(\"%s\") - got unknown UI type '%s'", uri, uiType);