Browse Source

Misc fixing for mingw

tags/1.9.4
falkTX 10 years ago
parent
commit
884d189821
3 changed files with 27 additions and 10 deletions
  1. +11
    -0
      source/Makefile.mk
  2. +9
    -9
      source/backend/plugin/VstPlugin.cpp
  3. +7
    -1
      source/utils/CarlaVstUtils.hpp

+ 11
- 0
source/Makefile.mk View File

@@ -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



+ 9
- 9
source/backend/plugin/VstPlugin.cpp View File

@@ -647,7 +647,7 @@ public:
max = 1.0f;
}

if (dispatcher(effVendorSpecific, kVstParameterUsesIntStep, j, nullptr, 0.0f) >= 0xbeef)
if (dispatcher(effVendorSpecific, kVstParameterUsesIntStep, static_cast<int32_t>(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<uint32_t>(initialDelay) : 0;
#else
pData->latency = fEffect->initialDelay;
pData->latency = (fEffect->initialDelay > 0) ? static_cast<uint32_t>(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<uint8_t>(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<uint8_t>(fMidiEvents[k].midiData[0]));
const uint8_t channel(status < MIDI_STATUS_BIT ? status & MIDI_STATUS_BIT : 0);
const uint8_t channel(static_cast<uint8_t>(status < MIDI_STATUS_BIT ? status & MIDI_STATUS_BIT : 0));

uint8_t midiData[3];
midiData[0] = static_cast<uint8_t>(fMidiEvents[k].midiData[0]);
@@ -1604,9 +1604,9 @@ public:
deactivate();

#if ! VST_FORCE_DEPRECATED
dispatcher(effSetBlockSizeAndSampleRate, 0, newBufferSize, nullptr, static_cast<float>(pData->engine->getSampleRate()));
dispatcher(effSetBlockSizeAndSampleRate, 0, static_cast<int32_t>(newBufferSize), nullptr, static_cast<float>(pData->engine->getSampleRate()));
#endif
dispatcher(effSetBlockSize, 0, newBufferSize, nullptr, 0.0f);
dispatcher(effSetBlockSize, 0, static_cast<int32_t>(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<float>(newSampleRate));
dispatcher(effSetBlockSizeAndSampleRate, 0, static_cast<int32_t>(pData->engine->getBufferSize()), nullptr, static_cast<float>(newSampleRate));
#endif
dispatcher(effSetSampleRate, 0, 0, nullptr, static_cast<float>(newSampleRate));

@@ -2183,10 +2183,10 @@ public:
// initialize plugin (part 2)

#if ! VST_FORCE_DEPRECATED
dispatcher(effSetBlockSizeAndSampleRate, 0, pData->engine->getBufferSize(), nullptr, static_cast<float>(pData->engine->getSampleRate()));
dispatcher(effSetBlockSizeAndSampleRate, 0, static_cast<int32_t>(pData->engine->getBufferSize()), nullptr, static_cast<float>(pData->engine->getSampleRate()));
#endif
dispatcher(effSetSampleRate, 0, 0, nullptr, static_cast<float>(pData->engine->getSampleRate()));
dispatcher(effSetBlockSize, 0, pData->engine->getBufferSize(), nullptr, 0.0f);
dispatcher(effSetBlockSize, 0, static_cast<int32_t>(pData->engine->getBufferSize()), nullptr, 0.0f);
dispatcher(effSetProcessPrecision, 0, kVstProcessPrecision32, nullptr, 0.0f);

if (dispatcher(effGetVstVersion, 0, 0, nullptr, 0.0f) < kVstVersion)


+ 7
- 1
source/utils/CarlaVstUtils.hpp View File

@@ -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


Loading…
Cancel
Save