From 884d18982199a1fedc3b32a7800c8cb5751fa495 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 4 Feb 2014 09:17:11 +0000 Subject: [PATCH] Misc fixing for mingw --- source/Makefile.mk | 11 +++++++++++ source/backend/plugin/VstPlugin.cpp | 18 +++++++++--------- source/utils/CarlaVstUtils.hpp | 8 +++++++- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/source/Makefile.mk b/source/Makefile.mk index e58288525..a1aa50b45 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -38,6 +38,17 @@ endif endif endif +# -------------------------------------------------------------- +# Use the real VSTSDK in MacOS and Windows + +ifeq ($(MACOS),true) +CARLA_VESTIGE_HEADER = false +endif + +ifeq ($(WIN32),true) +CARLA_VESTIGE_HEADER = false +endif + # -------------------------------------------------------------- # Common build and link flags diff --git a/source/backend/plugin/VstPlugin.cpp b/source/backend/plugin/VstPlugin.cpp index c4ff8085f..13594efc0 100644 --- a/source/backend/plugin/VstPlugin.cpp +++ b/source/backend/plugin/VstPlugin.cpp @@ -647,7 +647,7 @@ public: max = 1.0f; } - if (dispatcher(effVendorSpecific, kVstParameterUsesIntStep, j, nullptr, 0.0f) >= 0xbeef) + if (dispatcher(effVendorSpecific, kVstParameterUsesIntStep, static_cast(j), nullptr, 0.0f) >= 0xbeef) { step = 1.0f; stepSmall = 1.0f; @@ -841,7 +841,7 @@ public: int32_t initialDelay = *(int32_t*)empty3Ptr; pData->latency = (initialDelay > 0) ? static_cast(initialDelay) : 0; #else - pData->latency = fEffect->initialDelay; + pData->latency = (fEffect->initialDelay > 0) ? static_cast(fEffect->initialDelay) : 0; #endif pData->client->setLatency(pData->latency); @@ -1366,7 +1366,7 @@ public: const EngineMidiEvent& midiEvent(event.midi); - uint8_t status = MIDI_GET_STATUS_FROM_DATA(midiEvent.data); + uint8_t status = static_cast(MIDI_GET_STATUS_FROM_DATA(midiEvent.data)); uint8_t channel = event.channel; // Fix bad note-off (per VST spec) @@ -1435,7 +1435,7 @@ public: CARLA_SAFE_ASSERT_CONTINUE(fMidiEvents[k].midiData[0] > 0); const uint8_t status(static_cast(fMidiEvents[k].midiData[0])); - const uint8_t channel(status < MIDI_STATUS_BIT ? status & MIDI_STATUS_BIT : 0); + const uint8_t channel(static_cast(status < MIDI_STATUS_BIT ? status & MIDI_STATUS_BIT : 0)); uint8_t midiData[3]; midiData[0] = static_cast(fMidiEvents[k].midiData[0]); @@ -1604,9 +1604,9 @@ public: deactivate(); #if ! VST_FORCE_DEPRECATED - dispatcher(effSetBlockSizeAndSampleRate, 0, newBufferSize, nullptr, static_cast(pData->engine->getSampleRate())); + dispatcher(effSetBlockSizeAndSampleRate, 0, static_cast(newBufferSize), nullptr, static_cast(pData->engine->getSampleRate())); #endif - dispatcher(effSetBlockSize, 0, newBufferSize, nullptr, 0.0f); + dispatcher(effSetBlockSize, 0, static_cast(newBufferSize), nullptr, 0.0f); if (pData->active) activate(); @@ -1621,7 +1621,7 @@ public: deactivate(); #if ! VST_FORCE_DEPRECATED - dispatcher(effSetBlockSizeAndSampleRate, 0, pData->engine->getBufferSize(), nullptr, static_cast(newSampleRate)); + dispatcher(effSetBlockSizeAndSampleRate, 0, static_cast(pData->engine->getBufferSize()), nullptr, static_cast(newSampleRate)); #endif dispatcher(effSetSampleRate, 0, 0, nullptr, static_cast(newSampleRate)); @@ -2183,10 +2183,10 @@ public: // initialize plugin (part 2) #if ! VST_FORCE_DEPRECATED - dispatcher(effSetBlockSizeAndSampleRate, 0, pData->engine->getBufferSize(), nullptr, static_cast(pData->engine->getSampleRate())); + dispatcher(effSetBlockSizeAndSampleRate, 0, static_cast(pData->engine->getBufferSize()), nullptr, static_cast(pData->engine->getSampleRate())); #endif dispatcher(effSetSampleRate, 0, 0, nullptr, static_cast(pData->engine->getSampleRate())); - dispatcher(effSetBlockSize, 0, pData->engine->getBufferSize(), nullptr, 0.0f); + dispatcher(effSetBlockSize, 0, static_cast(pData->engine->getBufferSize()), nullptr, 0.0f); dispatcher(effSetProcessPrecision, 0, kVstProcessPrecision32, nullptr, 0.0f); if (dispatcher(effGetVstVersion, 0, 0, nullptr, 0.0f) < kVstVersion) diff --git a/source/utils/CarlaVstUtils.hpp b/source/utils/CarlaVstUtils.hpp index 18eec9e6d..e885bb860 100644 --- a/source/utils/CarlaVstUtils.hpp +++ b/source/utils/CarlaVstUtils.hpp @@ -34,7 +34,7 @@ #define VST_2_4_EXTENSIONS 1 #define VST_FORCE_DEPRECATED 0 -#if VESTIGE_HEADER +#ifdef VESTIGE_HEADER #include "vestige/aeffectx.h" #define audioMasterGetOutputSpeakerArrangement audioMasterGetSpeakerArrangement #define effFlagsProgramChunks (1 << 5) @@ -122,6 +122,12 @@ struct VstTimeInfo_R { int32_t timeSigNumerator, timeSigDenominator, smpteOffset, smpteFrameRate, samplesToNextClock, flags; }; #else +#ifndef CARLA_OS_MAC +# undef TARGET_API_MAC_CARBON +# define TARGET_API_MAC_CARBON 0 +#endif +#undef VST_64BIT_PLATFORM +#define VST_64BIT_PLATFORM defined(_WIN64) || defined(__LP64__) || defined (_LP64) #include "vst/aeffectx.h" typedef VstTimeInfo VstTimeInfo_R; #endif