From 9e23d173b71239ccd456dcd83d47cb5b3ca28977 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 4 Feb 2014 12:27:21 +0000 Subject: [PATCH] Work on the JucePlugin class, basic fx + ui working --- source/backend/plugin/JucePlugin.cpp | 723 +++++++++++++++++- source/backend/plugin/VstPlugin.cpp | 7 +- source/backend/standalone/CarlaStandalone.cpp | 4 - source/backend/standalone/Makefile | 1 + source/bridges/Makefile | 22 +- source/modules/juce_audio_processors/Makefile | 2 +- .../format_types/juce_VSTPluginFormat.cpp | 2 +- 7 files changed, 736 insertions(+), 25 deletions(-) diff --git a/source/backend/plugin/JucePlugin.cpp b/source/backend/plugin/JucePlugin.cpp index ec193c5b6..e0e3ee1a9 100644 --- a/source/backend/plugin/JucePlugin.cpp +++ b/source/backend/plugin/JucePlugin.cpp @@ -20,51 +20,746 @@ #ifdef HAVE_JUCE -//#include "JuceHeader.h" +#include "CarlaBackendUtils.hpp" +#include "JucePluginWindow.hpp" -//using juce::VSTPluginFormat; +#include "juce_audio_processors.h" + +using namespace juce; CARLA_BACKEND_START_NAMESPACE -#if 0 class JucePlugin : public CarlaPlugin { public: - JucePlugin(CarlaEngine* const engine, const unsigned short id) - : CarlaPlugin(engine, id) + JucePlugin(CarlaEngine* const engine, const uint id) + : CarlaPlugin(engine, id), + fInstance(nullptr), + fAudioBuffer(0, 0) { carla_debug("JucePlugin::JucePlugin(%p, %i)", engine, id); + + fMidiBuffer.ensureSize(2048); + fMidiBuffer.clear(); } - ~Vst3Plugin() override + ~JucePlugin() override { carla_debug("JucePlugin::~JucePlugin()"); + // close UI + if (pData->hints & PLUGIN_HAS_CUSTOM_UI) + showCustomUI(false); + pData->singleMutex.lock(); pData->masterMutex.lock(); if (pData->client != nullptr && pData->client->isActive()) pData->client->deactivate(); + + if (pData->active) + { + deactivate(); + pData->active = false; + } + + if (fInstance != nullptr) + { + delete fInstance; + fInstance = nullptr; + } + + clearBuffers(); } // ------------------------------------------------------------------- // Information (base) - PluginType getType() const override + PluginType getType() const noexcept override + { + PluginType type = PLUGIN_NONE; + + try { + type = getPluginTypeFromString(fDesc.pluginFormatName.toRawUTF8()); + } catch(...) {} + + return type; + } + + PluginCategory getCategory() const noexcept override + { + PluginCategory category = PLUGIN_CATEGORY_NONE; + + try { + category = getPluginCategoryFromName(fDesc.category.toRawUTF8()); + } catch(...) {} + + return category; + } + + long getUniqueId() const noexcept override + { + return fDesc.uid; + } + + // ------------------------------------------------------------------- + // Information (count) + + // nothing + + // ------------------------------------------------------------------- + // Information (current data) + + // nothing + + // ------------------------------------------------------------------- + // Information (per-plugin data) + + unsigned int getOptionsAvailable() const noexcept override + { + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr, 0x0); + + unsigned int options = 0x0; + + //options |= PLUGIN_OPTION_FIXED_BUFFERS; + options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; + //options |= PLUGIN_OPTION_USE_CHUNKS; + + if (fInstance->acceptsMidi()) + { + options |= PLUGIN_OPTION_SEND_CONTROL_CHANGES; + options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; + options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; + options |= PLUGIN_OPTION_SEND_PITCHBEND; + options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; + } + + return options; + } + + float getParameterValue(const uint32_t parameterId) const noexcept override + { + CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count, 0.0f); + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr, 0.0f); + + return fInstance->getParameter(static_cast(parameterId)); + } + + void getLabel(char* const strBuf) const noexcept override + { + std::strncpy(strBuf, fDesc.name.toRawUTF8(), STR_MAX); + } + + void getMaker(char* const strBuf) const noexcept override + { + std::strncpy(strBuf, fDesc.manufacturerName.toRawUTF8(), STR_MAX); + } + + void getCopyright(char* const strBuf) const noexcept override + { + getMaker(strBuf); + } + + void getRealName(char* const strBuf) const noexcept override + { + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr,); + + std::strncpy(strBuf, fInstance->getName().toRawUTF8(), STR_MAX); + } + + void getParameterName(const uint32_t parameterId, char* const strBuf) const noexcept override + { + CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr,); + + std::strncpy(strBuf, fInstance->getParameterName(static_cast(parameterId)).toRawUTF8(), STR_MAX); + } + + void getParameterUnit(const uint32_t parameterId, char* const strBuf) const noexcept override + { + CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr,); + + std::strncpy(strBuf, fInstance->getParameterLabel(static_cast(parameterId)).toRawUTF8(), STR_MAX); + } + + // ------------------------------------------------------------------- + // Set data (state) + + // nothing + + // ------------------------------------------------------------------- + // Set data (internal stuff) + + void setName(const char* const newName) override + { + CarlaPlugin::setName(newName); + + if (fWindow != nullptr) + { + String uiName(pData->name); + uiName += " (JUCE GUI)"; + fWindow->setName(uiName); + } + } + + // ------------------------------------------------------------------- + // Set data (plugin-specific stuff) + + void setParameterValue(const uint32_t parameterId, const float value, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept override + { + CARLA_SAFE_ASSERT_RETURN(parameterId < pData->param.count,); + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr,); + + const float fixedValue(pData->param.getFixedValue(parameterId, value)); + fInstance->setParameter(static_cast(parameterId), value); + + CarlaPlugin::setParameterValue(parameterId, fixedValue, sendGui, sendOsc, sendCallback); + } + + // ------------------------------------------------------------------- + // Set ui stuff + + void showCustomUI(const bool yesNo) override + { + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr,); + + if (yesNo) + { + if (fWindow == nullptr) + { + String uiName(pData->name); + uiName += " (JUCE GUI)"; + + fWindow = new JucePluginWindow(); + fWindow->setName(uiName); + } + + if (AudioProcessorEditor* const editor = fInstance->createEditorIfNeeded()) + fWindow->show(editor); + } + else + { + if (fWindow != nullptr) + fWindow->hide(); + + if (AudioProcessorEditor* const editor = fInstance->getActiveEditor()) + delete editor; + + fWindow = nullptr; + } + } + + void idle() override + { + if (fWindow != nullptr) + { + if (fWindow->wasClosedByUser()) + { + showCustomUI(false); + pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0.0f, nullptr); + } + } + + CarlaPlugin::idle(); + } + + // ------------------------------------------------------------------- + // Plugin state + + void reload() override + { + CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr,); + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr,); + carla_debug("VstPlugin::reload() - start"); + + const EngineProcessMode processMode(pData->engine->getProccessMode()); + + // Safely disable plugin for reload + const ScopedDisabler sd(this); + + if (pData->active) + deactivate(); + + clearBuffers(); + + fInstance->refreshParameterList(); + + uint32_t aIns, aOuts, mIns, mOuts, params; + aIns = aOuts = mIns = mOuts = params = 0; + + bool needsCtrlIn, needsCtrlOut; + needsCtrlIn = needsCtrlOut = false; + + aIns = (fInstance->getNumInputChannels() > 0) ? static_cast(fInstance->getNumInputChannels()) : 0; + aOuts = (fInstance->getNumOutputChannels() > 0) ? static_cast(fInstance->getNumOutputChannels()) : 0; + params = (fInstance->getNumParameters() > 0) ? static_cast(fInstance->getNumParameters()) : 0; + + if (fInstance->acceptsMidi()) + { + mIns = 1; + needsCtrlIn = true; + } + + if (fInstance->producesMidi()) + { + mOuts = 1; + needsCtrlOut = true; + } + + if (aIns > 0) + { + pData->audioIn.createNew(aIns); + } + + if (aOuts > 0) + { + pData->audioOut.createNew(aOuts); + needsCtrlIn = true; + } + + if (params > 0) + { + pData->param.createNew(params, false); + needsCtrlIn = true; + } + + const uint portNameSize(pData->engine->getMaxPortNameSize()); + CarlaString portName; + + // Audio Ins + for (uint32_t j=0; j < aIns; ++j) + { + portName.clear(); + + if (processMode == ENGINE_PROCESS_MODE_SINGLE_CLIENT) + { + portName = pData->name; + portName += ":"; + } + + if (aIns > 1) + { + portName += "input_"; + portName += CarlaString(j+1); + } + else + portName += "input"; + + portName.truncate(portNameSize); + + pData->audioIn.ports[j].port = (CarlaEngineAudioPort*)pData->client->addPort(kEnginePortTypeAudio, portName, true); + pData->audioIn.ports[j].rindex = j; + } + + // Audio Outs + for (uint32_t j=0; j < aOuts; ++j) + { + portName.clear(); + + if (processMode == ENGINE_PROCESS_MODE_SINGLE_CLIENT) + { + portName = pData->name; + portName += ":"; + } + + if (aOuts > 1) + { + portName += "output_"; + portName += CarlaString(j+1); + } + else + portName += "output"; + + portName.truncate(portNameSize); + + pData->audioOut.ports[j].port = (CarlaEngineAudioPort*)pData->client->addPort(kEnginePortTypeAudio, portName, false); + pData->audioOut.ports[j].rindex = j; + } + + for (uint32_t j=0; j < params; ++j) + { + pData->param.data[j].type = PARAMETER_INPUT; + pData->param.data[j].hints = 0x0; + pData->param.data[j].index = static_cast(j); + pData->param.data[j].rindex = static_cast(j); + pData->param.data[j].midiCC = -1; + pData->param.data[j].midiChannel = 0; + + float min, max, def, step, stepSmall, stepLarge; + + // TODO + //const int numSteps(fInstance->getParameterNumSteps(static_cast(j))); + { + min = 0.0f; + max = 1.0f; + step = 0.001f; + stepSmall = 0.0001f; + stepLarge = 0.1f; + } + + pData->param.data[j].hints |= PARAMETER_IS_ENABLED; +#ifndef BUILD_BRIDGE + //pData->param.data[j].hints |= PARAMETER_USES_CUSTOM_TEXT; +#endif + + if (fInstance->isParameterAutomatable(static_cast(j))) + pData->param.data[j].hints |= PARAMETER_IS_AUTOMABLE; + + // FIXME? + def = fInstance->getParameterDefaultValue(static_cast(j)); + + if (def < min) + def = min; + else if (def > max) + def = max; + + pData->param.ranges[j].min = min; + pData->param.ranges[j].max = max; + pData->param.ranges[j].def = def; + pData->param.ranges[j].step = step; + pData->param.ranges[j].stepSmall = stepSmall; + pData->param.ranges[j].stepLarge = stepLarge; + } + + if (needsCtrlIn) + { + portName.clear(); + + if (processMode == ENGINE_PROCESS_MODE_SINGLE_CLIENT) + { + portName = pData->name; + portName += ":"; + } + + portName += "events-in"; + portName.truncate(portNameSize); + + pData->event.portIn = (CarlaEngineEventPort*)pData->client->addPort(kEnginePortTypeEvent, portName, true); + } + + if (needsCtrlOut) + { + portName.clear(); + + if (processMode == ENGINE_PROCESS_MODE_SINGLE_CLIENT) + { + portName = pData->name; + portName += ":"; + } + + portName += "events-out"; + portName.truncate(portNameSize); + + pData->event.portOut = (CarlaEngineEventPort*)pData->client->addPort(kEnginePortTypeEvent, portName, false); + } + + // plugin hints + pData->hints = 0x0; + + if (fDesc.category.compareIgnoreCase("synth")) + pData->hints |= PLUGIN_IS_SYNTH; + + if (fInstance->hasEditor()) + { + pData->hints |= PLUGIN_HAS_CUSTOM_UI; + pData->hints |= PLUGIN_NEEDS_SINGLE_THREAD; + } + + if (aOuts > 0 && (aIns == aOuts || aIns == 1)) + pData->hints |= PLUGIN_CAN_DRYWET; + + if (aOuts > 0) + pData->hints |= PLUGIN_CAN_VOLUME; + + if (aOuts >= 2 && aOuts % 2 == 0) + pData->hints |= PLUGIN_CAN_BALANCE; + + // extra plugin hints + pData->extraHints = 0x0; + + if (mIns > 0) + pData->extraHints |= PLUGIN_EXTRA_HINT_HAS_MIDI_IN; + + if (mOuts > 0) + pData->extraHints |= PLUGIN_EXTRA_HINT_HAS_MIDI_OUT; + + if (aIns <= 2 && aOuts <= 2 && (aIns == aOuts || aIns == 0 || aOuts == 0)) + pData->extraHints |= PLUGIN_EXTRA_HINT_CAN_RUN_RACK; + + bufferSizeChanged(pData->engine->getBufferSize()); + //reloadPrograms(true); + + if (pData->active) + activate(); + + carla_debug("VstPlugin::reload() - end"); + } + + // ------------------------------------------------------------------- + // Plugin processing + + void activate() noexcept override { - return PLUGIN_CSOUND; + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr,); + + try { + fInstance->prepareToPlay(pData->engine->getSampleRate(), static_cast(pData->engine->getBufferSize())); + } catch(...) {} + } + + void deactivate() noexcept override + { + CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr,); + + try { + fInstance->releaseResources(); + } catch(...) {} + } + + void process(float** const inBuffer, float** const outBuffer, const uint32_t frames) override + { + // -------------------------------------------------------------------------------------------------------- + // Check if active + + if (! pData->active) + { + // disable any output sound + for (uint32_t i=0; i < pData->audioOut.count; ++i) + FloatVectorOperations::clear(outBuffer[i], static_cast(frames)); + return; + } + + // -------------------------------------------------------------------------------------------------------- + // Check if needs reset + + if (pData->needsReset) + { + fInstance->reset(); + pData->needsReset = false; + } + + uint32_t l=0; + for (; l < pData->audioIn.count; ++l) + fAudioBuffer.clear(static_cast(l), 0, static_cast(frames)); + for (; l < pData->audioOut.count; ++l) + fAudioBuffer.clear(static_cast(l), 0, static_cast(frames)); + + processSingle(inBuffer, outBuffer, frames); + } + + bool processSingle(float** const inBuffer, float** const outBuffer, const uint32_t frames) + { + CARLA_SAFE_ASSERT_RETURN(frames > 0, false); + + if (pData->audioIn.count > 0) + { + CARLA_SAFE_ASSERT_RETURN(inBuffer != nullptr, false); + } + if (pData->audioOut.count > 0) + { + CARLA_SAFE_ASSERT_RETURN(outBuffer != nullptr, false); + } + + // -------------------------------------------------------------------------------------------------------- + // Try lock, silence otherwise + + if (pData->engine->isOffline()) + { + pData->singleMutex.lock(); + } + else if (! pData->singleMutex.tryLock()) + { + for (uint32_t i=0; i < pData->audioOut.count; ++i) + { + for (uint32_t k=0; k < frames; ++k) + outBuffer[i][k/*+timeOffset*/] = 0.0f; + } + + return false; + } + + // -------------------------------------------------------------------------------------------------------- + // Set audio in buffers + + uint32_t l; + for (l=0; l < pData->audioIn.count; ++l) + fAudioBuffer.copyFrom(static_cast(l), 0, inBuffer[l], static_cast(frames)); + //for (l=0; l < pData->audioOut.count; ++l) + // fAudioBuffer.clear(static_cast(l), 0, static_cast(frames)); + + // -------------------------------------------------------------------------------------------------------- + // Run plugin + + fInstance->processBlock(fAudioBuffer, fMidiBuffer); + + // -------------------------------------------------------------------------------------------------------- + // Set audio out buffers + + for (uint32_t i=0; i < pData->audioOut.count; ++i) + FloatVectorOperations::copy(outBuffer[i], fAudioBuffer.getSampleData(static_cast(i)), static_cast(frames)); + + // -------------------------------------------------------------------------------------------------------- + + pData->singleMutex.unlock(); + return true; + } + + void bufferSizeChanged(const uint32_t newBufferSize) override + { + CARLA_ASSERT_INT(newBufferSize > 0, newBufferSize); + carla_debug("VstPlugin::bufferSizeChanged(%i)", newBufferSize); + + fAudioBuffer.setSize(static_cast(std::max(pData->audioIn.count, pData->audioOut.count)), static_cast(newBufferSize)); + + if (pData->active) + { + deactivate(); + activate(); + } + } + + void sampleRateChanged(const double newSampleRate) override + { + CARLA_ASSERT_INT(newSampleRate > 0.0, newSampleRate); + carla_debug("VstPlugin::sampleRateChanged(%g)", newSampleRate); + + if (pData->active) + { + deactivate(); + activate(); + } + } + + // ------------------------------------------------------------------- + // Plugin buffers + + // nothing + + // ------------------------------------------------------------------- + // Post-poned UI Stuff + + // nothing + + // ------------------------------------------------------------------- + +protected: + // TODO + + // ------------------------------------------------------------------- + +public: + bool init(const char* const filename, const char* const name, const char* const label) + { + CARLA_SAFE_ASSERT_RETURN(pData->engine != nullptr, false); + + // --------------------------------------------------------------- + // first checks + + if (pData->client != nullptr) + { + pData->engine->setLastError("Plugin client is already registered"); + return false; + } + + if (filename == nullptr || filename[0] == '\0') + { + pData->engine->setLastError("null filename"); + return false; + } + +#if 0 + if (label == nullptr || label[0] == '\0') + { + pData->engine->setLastError("null label"); + return false; + } +#else + (void)label; +#endif + + //fDesc.name = fDesc.descriptiveName = label; + //fDesc.pluginFormatName = "VST"; + fDesc.uid = 0; + fDesc.fileOrIdentifier = filename; + + // TODO - set uid for shell plugins + + fInstance = fFormat.createInstanceFromDescription(fDesc, pData->engine->getSampleRate(), static_cast(pData->engine->getBufferSize())); + fInstance->fillInPluginDescription(fDesc); + + // --------------------------------------------------------------- + // get info + + if (name != nullptr && name[0] != '\0') + pData->name = pData->engine->getUniquePluginName(name); + else + pData->name = pData->engine->getUniquePluginName(fInstance->getName().toRawUTF8()); + + pData->filename = carla_strdup(filename); + + // --------------------------------------------------------------- + // register client + + pData->client = pData->engine->addClient(this); + + if (pData->client == nullptr || ! pData->client->isOk()) + { + pData->engine->setLastError("Failed to register plugin client"); + return false; + } + + // --------------------------------------------------------------- + // load plugin settings + + { + // set default options + pData->options = 0x0; + + //pData->options |= PLUGIN_OPTION_FIXED_BUFFERS; + pData->options |= PLUGIN_OPTION_MAP_PROGRAM_CHANGES; + //pData->options |= PLUGIN_OPTION_USE_CHUNKS; + + if (fInstance->acceptsMidi()) + { + pData->options |= PLUGIN_OPTION_SEND_CHANNEL_PRESSURE; + pData->options |= PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH; + pData->options |= PLUGIN_OPTION_SEND_PITCHBEND; + pData->options |= PLUGIN_OPTION_SEND_ALL_SOUND_OFF; + } + + // set identifier string + String juceId(fDesc.createIdentifierString()); + + CarlaString identifier("Juce/"); + identifier += juceId.toRawUTF8(); + pData->identifier = identifier.dup(); + + // load settings + pData->options = pData->loadSettings(pData->options, getOptionsAvailable()); + } + + return true; } private: - VSTPluginFormat format; + PluginDescription fDesc; + VSTPluginFormat fFormat; + AudioPluginInstance* fInstance; + + AudioSampleBuffer fAudioBuffer; + MidiBuffer fMidiBuffer; + + ScopedPointer fWindow; CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(JucePlugin) }; -#endif CARLA_BACKEND_END_NAMESPACE -#endif +#endif // HAVE_JUCE + +// ------------------------------------------------------------------------------------------------------------------- CARLA_BACKEND_START_NAMESPACE @@ -72,10 +767,10 @@ CarlaPlugin* CarlaPlugin::newJuce(const Initializer& init, const char* const for { carla_debug("CarlaPlugin::newJuce({%p, \"%s\", \"%s\", \"%s\"}, %s)", init.engine, init.filename, init.name, init.label, format); -#if 0 //def HAVE_JUCE +#ifdef HAVE_JUCE JucePlugin* const plugin(new JucePlugin(init.engine, init.id)); - //if (! plugin->init(init.filename, init.name, init.label)) + if (! plugin->init(init.filename, init.name, init.label)) { delete plugin; return nullptr; @@ -101,3 +796,5 @@ CarlaPlugin* CarlaPlugin::newJuce(const Initializer& init, const char* const for } CARLA_BACKEND_END_NAMESPACE + +// ------------------------------------------------------------------------------------------------------------------- diff --git a/source/backend/plugin/VstPlugin.cpp b/source/backend/plugin/VstPlugin.cpp index 13594efc0..f0f3765fb 100644 --- a/source/backend/plugin/VstPlugin.cpp +++ b/source/backend/plugin/VstPlugin.cpp @@ -241,10 +241,7 @@ public: void getCopyright(char* const strBuf) const noexcept override { - CARLA_SAFE_ASSERT_RETURN(fEffect != nullptr,); - - strBuf[0] = '\0'; - dispatcher(effGetVendorString, 0, 0, strBuf, 0.0f); + getMaker(strBuf); } void getRealName(char* const strBuf) const noexcept override @@ -2459,7 +2456,7 @@ CarlaPlugin* CarlaPlugin::newVST(const Initializer& init) carla_debug("CarlaPlugin::newVST({%p, \"%s\", \"%s\"})", init.engine, init.filename, init.name); #ifdef WANT_VST -# if defined(HAVE_JUCE) && ! defined(VESTIGE_HEADER) +# if 1 //defined(HAVE_JUCE) && ! defined(VESTIGE_HEADER) return newJuce(init, "VST"); # else VstPlugin* const plugin(new VstPlugin(init.engine, init.id)); diff --git a/source/backend/standalone/CarlaStandalone.cpp b/source/backend/standalone/CarlaStandalone.cpp index 844b60eb7..2afca5219 100644 --- a/source/backend/standalone/CarlaStandalone.cpp +++ b/source/backend/standalone/CarlaStandalone.cpp @@ -30,10 +30,6 @@ #include -#ifdef BUILD_BRIDGE -# undef HAVE_JUCE -#endif - #ifdef HAVE_JUCE # include "juce_gui_basics.h" using juce::initialiseJuce_GUI; diff --git a/source/backend/standalone/Makefile b/source/backend/standalone/Makefile index 185e34936..d8cdd58cf 100644 --- a/source/backend/standalone/Makefile +++ b/source/backend/standalone/Makefile @@ -27,6 +27,7 @@ LINK_FLAGS += $(RTMEMPOOL_LIBS) ifeq ($(HAVE_JUCE),true) STATIC_LIBS += ../../modules/juce_audio_basics.a STATIC_LIBS += ../../modules/juce_audio_devices.a +STATIC_LIBS += ../../modules/juce_audio_processors.a STATIC_LIBS += ../../modules/juce_core.a STATIC_LIBS += ../../modules/juce_data_structures.a STATIC_LIBS += ../../modules/juce_events.a diff --git a/source/bridges/Makefile b/source/bridges/Makefile index 18ed38338..ae461f256 100644 --- a/source/bridges/Makefile +++ b/source/bridges/Makefile @@ -602,7 +602,12 @@ LIBS_WIN32 = \ ifeq ($(HAVE_JUCE),true) LIBS_WIN32 += \ ../modules/juce_audio_basics.win32.a \ - ../modules/juce_core.win32.a + ../modules/juce_audio_processors.win32.a \ + ../modules/juce_core.win32.a \ + ../modules/juce_data_structures.win32.a \ + ../modules/juce_events.win32.a \ + ../modules/juce_graphics.win32.a \ + ../modules/juce_gui_basics.win32.a endif carla-bridge-win32.exe: $(OBJS_WIN32) $(LIBS_WIN32) ../modules/jackbridge-win32.dll @@ -693,9 +698,24 @@ doxygen: carla_bridge.doxygen ../modules/juce_audio_basics.%.a: .FORCE $(MAKE) -C ../modules juce_audio_basics_$* +../modules/juce_audio_processors.%.a: .FORCE + $(MAKE) -C ../modules juce_audio_processors_$* + ../modules/juce_core.%.a: .FORCE $(MAKE) -C ../modules juce_core_$* +../modules/juce_data_structures.%.a: .FORCE + $(MAKE) -C ../modules juce_data_structures_$* + +../modules/juce_events.%.a: .FORCE + $(MAKE) -C ../modules juce_events_$* + +../modules/juce_graphics.%.a: .FORCE + $(MAKE) -C ../modules juce_graphics_$* + +../modules/juce_gui_basics.%.a: .FORCE + $(MAKE) -C ../modules juce_gui_basics_$* + ../modules/lilv.%.a: .FORCE $(MAKE) -C ../modules lilv_$* diff --git a/source/modules/juce_audio_processors/Makefile b/source/modules/juce_audio_processors/Makefile index a84906437..f845000b5 100644 --- a/source/modules/juce_audio_processors/Makefile +++ b/source/modules/juce_audio_processors/Makefile @@ -8,7 +8,7 @@ include ../../Makefile.mk # -------------------------------------------------------------- -BUILD_CXX_FLAGS += $(JUCE_AUDIO_PROCESSORS_FLAGS) -I. -w +BUILD_CXX_FLAGS += $(JUCE_AUDIO_PROCESSORS_FLAGS) -I. -I../../includes/vst -w LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS) -L.. -ljuce_audio_basics -ljuce_gui_basics -ljuce_graphics -ljuce_data_structures -ljuce_events -ljuce_core ifeq ($(MACOS),true) diff --git a/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 2c9dcddd0..359e61f9c 100644 --- a/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -470,7 +470,7 @@ public: if (dllModule != INVALID_HANDLE_VALUE) { - if (HRSRC res = FindResource (dllModule, MAKEINTRESOURCE (resID), type.toRawUTF8())) + if (HRSRC res = FindResource (dllModule, MAKEINTRESOURCE (resID), (LPCWSTR)type.toRawUTF8())) { if (HGLOBAL hGlob = LoadResource (dllModule, res)) {