| @@ -57,7 +57,7 @@ CARLA_LD_FLAGS += $(shell pkg-config --libs linuxsampler) | |||
| endif | |||
| ifeq ($(HAVE_ZYN_DEPS),true) | |||
| CARLA_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml) -DWANT_ZYNADDSUBFX -Iplugins/zynaddsubfx | |||
| CARLA_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml) -DWANT_ZYNADDSUBFX | |||
| CARLA_LD_FLAGS += $(shell pkg-config --libs fftw3 mxml) | |||
| endif | |||
| @@ -91,7 +91,7 @@ OBJS += rtmidi-2.0.1/RtMidi.o | |||
| endif | |||
| ifeq ($(HAVE_ZYN_DEPS),true) | |||
| OBJS += plugins/zynaddsubfx.o | |||
| OBJS += plugins/zynaddsubfx.o plugins/zynaddsubfx-src.o | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| @@ -57,7 +57,7 @@ CARLA_LD_FLAGS += $(shell pkg-config --libs linuxsampler) | |||
| endif | |||
| ifeq ($(HAVE_ZYN_DEPS),true) | |||
| CARLA_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml) -DWANT_ZYNADDSUBFX -Iplugins/zynaddsubfx | |||
| CARLA_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml) -DWANT_ZYNADDSUBFX | |||
| CARLA_LD_FLAGS += $(shell pkg-config --libs fftw3 mxml) | |||
| endif | |||
| @@ -91,7 +91,7 @@ OBJS += rtmidi-2.0.1/RtMidi.o | |||
| endif | |||
| ifeq ($(HAVE_ZYN_DEPS),true) | |||
| OBJS += plugins/zynaddsubfx.o | |||
| OBJS += plugins/zynaddsubfx.o plugins/zynaddsubfx-src.o | |||
| endif | |||
| # -------------------------------------------------------------- | |||
| @@ -802,7 +802,11 @@ public: | |||
| midiprog.data = nullptr; | |||
| // Query new programs | |||
| midiprog.count = descriptor->midiProgramCount; | |||
| if (descriptor->get_midi_program && descriptor->set_midi_program) | |||
| { | |||
| while (descriptor->get_midi_program(handle, midiprog.count)) | |||
| midiprog.count += 1; | |||
| } | |||
| if (midiprog.count > 0) | |||
| midiprog.data = new MidiProgramData[midiprog.count]; | |||
| @@ -810,8 +814,8 @@ public: | |||
| // Update data | |||
| for (i=0; i < midiprog.count; i++) | |||
| { | |||
| const MidiProgram* const mpDesc = &descriptor->midiPrograms[i]; | |||
| CARLA_ASSERT(mpDesc->program < 128); | |||
| const MidiProgram* const mpDesc = descriptor->get_midi_program(handle, i); | |||
| CARLA_ASSERT(mpDesc); | |||
| CARLA_ASSERT(mpDesc->name); | |||
| midiprog.data[i].bank = mpDesc->bank; | |||
| @@ -83,9 +83,6 @@ static PluginDescriptor bypassDesc = { | |||
| .portCount = 0, | |||
| .ports = NULL, | |||
| .midiProgramCount = 0, | |||
| .midiPrograms = NULL, | |||
| .instantiate = bypass_instantiate, | |||
| .activate = NULL, | |||
| .deactivate = NULL, | |||
| @@ -96,6 +93,8 @@ static PluginDescriptor bypassDesc = { | |||
| .get_parameter_text = NULL, | |||
| .get_parameter_unit = NULL, | |||
| .get_midi_program = NULL, | |||
| .set_parameter_value = NULL, | |||
| .set_midi_program = NULL, | |||
| .set_custom_data = NULL, | |||
| @@ -137,9 +137,6 @@ typedef struct _PluginDescriptor { | |||
| uint32_t portCount; | |||
| PluginPort* ports; | |||
| uint32_t midiProgramCount; | |||
| MidiProgram* midiPrograms; | |||
| PluginHandle (*instantiate)(struct _PluginDescriptor* _this_, HostDescriptor* host); | |||
| void (*activate)(PluginHandle handle); | |||
| void (*deactivate)(PluginHandle handle); | |||
| @@ -150,6 +147,8 @@ typedef struct _PluginDescriptor { | |||
| const char* (*get_parameter_text)(PluginHandle handle, uint32_t index); | |||
| const char* (*get_parameter_unit)(PluginHandle handle, uint32_t index); | |||
| const MidiProgram* (*get_midi_program)(PluginHandle handle, uint32_t index); | |||
| void (*set_parameter_value)(PluginHandle handle, uint32_t index, double value); | |||
| void (*set_midi_program)(PluginHandle handle, uint32_t bank, uint32_t program); | |||
| void (*set_custom_data)(PluginHandle handle, const char* key, const char* value); | |||
| @@ -37,9 +37,6 @@ public: | |||
| desc.portCount = master->desc.portCount; | |||
| desc.ports = master->desc.ports; | |||
| desc.midiProgramCount = master->desc.midiProgramCount; | |||
| desc.midiPrograms = master->desc.midiPrograms; | |||
| host = master->host; | |||
| } | |||
| else | |||
| @@ -54,9 +51,6 @@ public: | |||
| desc.portCount = 0; | |||
| desc.ports = nullptr; | |||
| desc.midiProgramCount = 0; | |||
| desc.midiPrograms = nullptr; | |||
| host = nullptr; | |||
| } | |||
| @@ -107,7 +101,7 @@ public: | |||
| // ------------------------------------------------------------------- | |||
| PluginDescriptor* descriptorInit() | |||
| const PluginDescriptor* descriptorInit() | |||
| { | |||
| desc.category = getCategory(); | |||
| desc.hints = getHints(); | |||
| @@ -211,15 +205,10 @@ protected: | |||
| // ------------------------------------------------------------------- | |||
| virtual uint32_t getMidiProgramCount() | |||
| virtual const MidiProgram* getMidiProgram(uint32_t index) | |||
| { | |||
| return 0; | |||
| } | |||
| virtual void getMidiProgram(uint32_t index, MidiProgram* midiProgram) | |||
| { | |||
| CARLA_ASSERT(index < getMidiProgramCount()); | |||
| CARLA_ASSERT(midiProgram); | |||
| Q_UNUSED(index); | |||
| return nullptr; | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -293,6 +282,8 @@ private: | |||
| desc.get_parameter_text = _get_parameter_text; | |||
| desc.get_parameter_unit = _get_parameter_unit; | |||
| desc.get_midi_program = _get_midi_program; | |||
| desc.set_parameter_value = _set_parameter_value; | |||
| desc.set_midi_program = _set_midi_program; | |||
| desc.set_custom_data = _set_custom_data; | |||
| @@ -349,6 +340,11 @@ private: | |||
| return ((PluginDescriptorClass*)handle)->getParameterUnit(index); | |||
| } | |||
| static const MidiProgram* _get_midi_program(PluginHandle handle, uint32_t index) | |||
| { | |||
| return ((PluginDescriptorClass*)handle)->getMidiProgram(index); | |||
| } | |||
| static void _set_parameter_value(PluginHandle handle, uint32_t index, double value) | |||
| { | |||
| return ((PluginDescriptorClass*)handle)->setParameterValue(index, value); | |||
| @@ -406,26 +402,10 @@ private: | |||
| port->name = getPortName(i); | |||
| } | |||
| } | |||
| desc.midiProgramCount = getMidiProgramCount(); | |||
| if (desc.midiProgramCount > 0) | |||
| { | |||
| desc.midiPrograms = new MidiProgram [desc.midiProgramCount]; | |||
| for (uint32_t i=0; i < desc.midiProgramCount; i++) | |||
| getMidiProgram(i, &desc.midiPrograms[i]); | |||
| } | |||
| } | |||
| void _handleFini() | |||
| { | |||
| if (desc.midiProgramCount > 0 && desc.midiPrograms) | |||
| delete[] desc.midiPrograms; | |||
| desc.midiProgramCount = 0; | |||
| desc.midiPrograms = nullptr; | |||
| if (desc.portCount > 0 && desc.ports) | |||
| delete[] desc.ports; | |||
| @@ -35,69 +35,8 @@ SOURCES = \ | |||
| SOURCES += \ | |||
| ../plugins/bypass.c \ | |||
| ../plugins/midi-split.cpp \ | |||
| ../plugins/zynaddsubfx.cpp | |||
| #SOURCES += \ | |||
| # ../plugins/zynaddsubfx/DSP/AnalogFilter.cpp \ | |||
| # ../plugins/zynaddsubfx/DSP/FFTwrapper.cpp \ | |||
| # ../plugins/zynaddsubfx/DSP/Filter.cpp \ | |||
| # ../plugins/zynaddsubfx/DSP/FormantFilter.cpp \ | |||
| # ../plugins/zynaddsubfx/DSP/SVFilter.cpp \ | |||
| # ../plugins/zynaddsubfx/DSP/Unison.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/Alienwah.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/Chorus.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/Distorsion.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/DynamicFilter.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/Echo.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/Effect.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/EffectLFO.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/EffectMgr.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/EQ.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/Phaser.cpp \ | |||
| # ../plugins/zynaddsubfx/Effects/Reverb.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/Bank.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/Config.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/Dump.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/Master.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/Microtonal.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/Part.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/Recorder.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/Stereo.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/Util.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/WavFile.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/WaveShapeSmps.cpp \ | |||
| # ../plugins/zynaddsubfx/Misc/XMLwrapper.cpp \ | |||
| # ../plugins/zynaddsubfx/Nio/AudioOut.cpp \ | |||
| # ../plugins/zynaddsubfx/Nio/Engine.cpp \ | |||
| # ../plugins/zynaddsubfx/Nio/EngineMgr.cpp \ | |||
| # ../plugins/zynaddsubfx/Nio/MidiIn.cpp \ | |||
| # ../plugins/zynaddsubfx/Nio/Nio.cpp \ | |||
| # ../plugins/zynaddsubfx/Nio/NulEngine.cpp \ | |||
| # ../plugins/zynaddsubfx/Nio/InMgr.cpp \ | |||
| # ../plugins/zynaddsubfx/Nio/OutMgr.cpp \ | |||
| # ../plugins/zynaddsubfx/Nio/WavEngine.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/ADnoteParameters.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/Controller.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/EnvelopeParams.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/FilterParams.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/LFOParams.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/PADnoteParameters.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/Presets.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/PresetsArray.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/PresetsStore.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/SUBnoteParameters.cpp \ | |||
| # ../plugins/zynaddsubfx/Synth/ADnote.cpp \ | |||
| # ../plugins/zynaddsubfx/Synth/Envelope.cpp \ | |||
| # ../plugins/zynaddsubfx/Synth/LFO.cpp \ | |||
| # ../plugins/zynaddsubfx/Synth/OscilGen.cpp \ | |||
| # ../plugins/zynaddsubfx/Synth/PADnote.cpp \ | |||
| # ../plugins/zynaddsubfx/Synth/Resonance.cpp \ | |||
| # ../plugins/zynaddsubfx/Synth/SUBnote.cpp \ | |||
| # ../plugins/zynaddsubfx/Synth/SynthNote.cpp | |||
| # ../plugins/zynaddsubfx/Effects/.cpp \ | |||
| # ../plugins/zynaddsubfx/Params/.cpp \ | |||
| # ../plugins/zynaddsubfx/Synth/.cpp \ | |||
| ../plugins/zynaddsubfx.cpp \ | |||
| ../plugins/zynaddsubfx-src.cpp | |||
| HEADERS = \ | |||
| ../carla_backend.h \ | |||