Signed-off-by: falkTX <falktx@gmail.com>tags/v2.1-alpha2
@@ -172,7 +172,7 @@ endif | |||
ifeq ($(TESTBUILD),true) | |||
BASE_FLAGS += -Werror -Wabi=98 -Wcast-qual -Wclobbered -Wconversion -Wdisabled-optimization | |||
BASE_FLAGS += -Wdouble-promotion -Wfloat-equal -Wlogical-op -Wpointer-arith -Wsign-conversion | |||
BASE_FLAGS += -Wformat=2 -Woverlength-strings | |||
BASE_FLAGS += -Wformat=2 -Woverlength-strings -Wstringop-overflow=4 -Wstringop-truncation | |||
BASE_FLAGS += -Wmissing-declarations -Wredundant-decls | |||
BASE_FLAGS += -Wshadow -Wundef -Wuninitialized -Wunused | |||
BASE_FLAGS += -Wstrict-aliasing -fstrict-aliasing | |||
@@ -38,13 +38,20 @@ | |||
#endif | |||
#ifdef USING_JUCE | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# endif | |||
# include "AppConfig.h" | |||
# if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
# include "juce_gui_basics/juce_gui_basics.h" | |||
# else | |||
# include "juce_events/juce_events.h" | |||
# include "juce_events/juce_events.h" | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
# include "juce_core/juce_core.h" | |||
#endif | |||
#define CARLA_SAFE_ASSERT_WITH_LAST_ERROR_RETURN(cond, msg, ret) \ | |||
@@ -10,6 +10,13 @@ endif | |||
include $(CWD)/Makefile.mk | |||
# Workaround GCC bug | |||
ifeq ($(TESTBUILD),true) | |||
ifeq ($(USING_JUCE),true) | |||
BUILD_CXX_FLAGS += -Wno-undef | |||
endif | |||
endif | |||
# ---------------------------------------------------------------------------------------------------------------------------- | |||
BINDIR := $(CWD)/../bin | |||
@@ -22,9 +22,26 @@ | |||
#include "RtLinkedList.hpp" | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wcast-qual" | |||
# pragma GCC diagnostic ignored "-Wclass-memaccess" | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Wdouble-promotion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wfloat-equal" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
#endif | |||
#include "AppConfig.h" | |||
#include "juce_audio_devices/juce_audio_devices.h" | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
CARLA_BACKEND_START_NAMESPACE | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
@@ -295,8 +312,7 @@ public: | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(graph != nullptr, false); | |||
char strBuf[STR_MAX+1]; | |||
strBuf[STR_MAX] = '\0'; | |||
char strBuf[STR_MAX]; | |||
ExternalGraph& extGraph(graph->extGraph); | |||
@@ -385,7 +401,8 @@ public: | |||
ConnectionToId connectionToId; | |||
connectionToId.setData(++(extGraph.connections.lastId), kExternalGraphGroupMidiIn, portId, kExternalGraphGroupCarla, kExternalGraphCarlaPortMidiIn); | |||
std::snprintf(strBuf, STR_MAX, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
std::snprintf(strBuf, STR_MAX-1, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
strBuf[STR_MAX-1] = '\0'; | |||
callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, 0, 0, 0.0f, strBuf); | |||
@@ -405,7 +422,8 @@ public: | |||
ConnectionToId connectionToId; | |||
connectionToId.setData(++(extGraph.connections.lastId), kExternalGraphGroupCarla, kExternalGraphCarlaPortMidiOut, kExternalGraphGroupMidiOut, portId); | |||
std::snprintf(strBuf, STR_MAX, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
std::snprintf(strBuf, STR_MAX-1, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
strBuf[STR_MAX-1] = '\0'; | |||
callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, 0, 0, 0.0f, strBuf); | |||
@@ -444,7 +462,10 @@ protected: | |||
void audioDeviceIOCallback(const float** inputChannelData, int numInputChannels, float** outputChannelData, | |||
int numOutputChannels, int numSamples) override | |||
{ | |||
const PendingRtEventsRunner prt(this, numSamples); | |||
CARLA_SAFE_ASSERT_RETURN(numSamples >= 0,); | |||
const uint32_t nframes(static_cast<uint32_t>(numSamples)); | |||
const PendingRtEventsRunner prt(this, nframes); | |||
// assert juce buffers | |||
CARLA_SAFE_ASSERT_RETURN(numInputChannels >= 0,); | |||
@@ -452,11 +473,9 @@ protected: | |||
CARLA_SAFE_ASSERT_RETURN(outputChannelData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(numSamples == static_cast<int>(pData->bufferSize),); | |||
const uint32_t nframes(static_cast<uint32_t>(numSamples)); | |||
// initialize juce output | |||
for (int i=0; i < numOutputChannels; ++i) | |||
carla_zeroFloats(outputChannelData[i], numSamples); | |||
carla_zeroFloats(outputChannelData[i], nframes); | |||
// initialize events | |||
carla_zeroStructs(pData->events.in, kMaxEngineEventInternalCount); | |||
@@ -36,9 +36,20 @@ | |||
#include "CarlaNativePlugin.h" | |||
#if defined(USING_JUCE) && ! (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
# endif | |||
# include "AppConfig.h" | |||
# include "juce_events/juce_events.h" | |||
# define USE_JUCE_MESSAGE_THREAD | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
#endif | |||
#include "water/files/File.h" | |||
@@ -108,6 +119,8 @@ protected: | |||
private: | |||
volatile bool initialised; | |||
CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SharedJuceMessageThread); | |||
}; | |||
#endif | |||
@@ -649,23 +662,24 @@ public: | |||
const uint32_t inChan = 2, uint32_t outChan = 2) | |||
: CarlaEngine(), | |||
pHost(host), | |||
#ifdef USE_JUCE_MESSAGE_THREAD | |||
// if not running inside Carla, we will have to run event loop ourselves | |||
kNeedsJuceMsgThread(host->dispatcher(pHost->handle, | |||
NATIVE_HOST_OPCODE_INTERNAL_PLUGIN, 0, 0, nullptr, 0.0f) == 0), | |||
fJuceMsgThread(), | |||
#endif | |||
kIsPatchbay(isPatchbay), | |||
kHasMidiOut(withMidiOut), | |||
fIsActive(false), | |||
fIsRunning(false), | |||
fUiServer(this), | |||
fOptionsForced(false) | |||
#ifdef USE_JUCE_MESSAGE_THREAD | |||
// if not running inside Carla, we will have to run event loop ourselves | |||
, kNeedsJuceMsgThread(host->dispatcher(pHost->handle, | |||
NATIVE_HOST_OPCODE_INTERNAL_PLUGIN, 0, 0, nullptr, 0.0f) == 0) | |||
#endif | |||
{ | |||
carla_debug("CarlaEngineNative::CarlaEngineNative()"); | |||
#ifdef USE_JUCE_MESSAGE_THREAD | |||
if (kNeedsJuceMsgThread) | |||
sJuceMsgThread->incRef(); | |||
fJuceMsgThread->incRef(); | |||
#endif | |||
pData->bufferSize = pHost->get_buffer_size(pHost->handle); | |||
@@ -727,7 +741,7 @@ public: | |||
#ifdef USE_JUCE_MESSAGE_THREAD | |||
if (kNeedsJuceMsgThread) | |||
sJuceMsgThread->decRef(); | |||
fJuceMsgThread->decRef(); | |||
#endif | |||
carla_debug("CarlaEngineNative::~CarlaEngineNative() - END"); | |||
@@ -2078,6 +2092,11 @@ public: | |||
private: | |||
const NativeHostDescriptor* const pHost; | |||
#ifdef USE_JUCE_MESSAGE_THREAD | |||
const bool kNeedsJuceMsgThread; | |||
const juce::SharedResourcePointer<SharedJuceMessageThread> fJuceMsgThread; | |||
#endif | |||
const bool kIsPatchbay; // rack if false | |||
const bool kHasMidiOut; | |||
bool fIsActive, fIsRunning; | |||
@@ -2085,11 +2104,6 @@ private: | |||
bool fOptionsForced; | |||
#ifdef USE_JUCE_MESSAGE_THREAD | |||
const bool kNeedsJuceMsgThread; | |||
const juce::SharedResourcePointer<SharedJuceMessageThread> sJuceMsgThread; | |||
#endif | |||
CarlaPlugin* _getFirstPlugin() const noexcept | |||
{ | |||
if (pData->curPluginCount == 0 || pData->plugins == nullptr) | |||
@@ -7,6 +7,13 @@ | |||
CWD=../.. | |||
include ../Makefile.mk | |||
# Workaround GCC bug | |||
ifeq ($(TESTBUILD),true) | |||
ifeq ($(USING_JUCE),true) | |||
BUILD_CXX_FLAGS += -Wno-undef | |||
endif | |||
endif | |||
# ---------------------------------------------------------------------------------------------------------------------------- | |||
OBJS = \ | |||
@@ -22,10 +22,30 @@ | |||
#include "CarlaBackendUtils.hpp" | |||
#include "CarlaMathUtils.hpp" | |||
#include "JucePluginWindow.hpp" | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wcast-qual" | |||
# pragma GCC diagnostic ignored "-Wclass-memaccess" | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Wdouble-promotion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wfloat-equal" | |||
# pragma GCC diagnostic ignored "-Woverloaded-virtual" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
#endif | |||
#include "AppConfig.h" | |||
#include "juce_audio_processors/juce_audio_processors.h" | |||
#include "juce_gui_basics/juce_gui_basics.h" | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
#include "JucePluginWindow.hpp" | |||
namespace juce { | |||
extern bool juce_isRunningInWine(); | |||
@@ -54,6 +74,7 @@ public: | |||
fMidiBuffer(), | |||
fPosInfo(), | |||
fChunk(), | |||
fFormatName(), | |||
fWindow() | |||
{ | |||
carla_debug("CarlaPluginJuce::CarlaPluginJuce(%p, %i)", engine, id); | |||
@@ -281,12 +302,10 @@ public: | |||
int32_t* const set = (int32_t*)dataCompat; | |||
dataCompat[39] = dataSize; | |||
set[0] = (int32_t)juce::ByteOrder::littleEndianInt("CcnK"); | |||
set[2] = (int32_t)juce::ByteOrder::littleEndianInt("FBCh"); | |||
set[3] = fxbSwap(1); | |||
set[39] = fxbSwap(dataSize); | |||
set[39] = fxbSwap(static_cast<int32_t>(dataSize)); | |||
{ | |||
const ScopedSingleProcessLocker spl(this, true); | |||
@@ -714,7 +733,7 @@ public: | |||
{ | |||
// disable any output sound | |||
for (uint32_t i=0; i < pData->audioOut.count; ++i) | |||
carla_zeroFloats(audioOut[i], static_cast<int>(frames)); | |||
carla_zeroFloats(audioOut[i], frames); | |||
return; | |||
} | |||
@@ -977,9 +996,12 @@ public: | |||
if (timeInfo.bbt.valid) | |||
{ | |||
const double ppqBar = double(timeInfo.bbt.bar - 1) * timeInfo.bbt.beatsPerBar; | |||
const double ppqBeat = double(timeInfo.bbt.beat - 1); | |||
const double ppqTick = double(timeInfo.bbt.tick) / timeInfo.bbt.ticksPerBeat; | |||
CARLA_SAFE_ASSERT_INT(timeInfo.bbt.bar > 0, timeInfo.bbt.bar); | |||
CARLA_SAFE_ASSERT_INT(timeInfo.bbt.beat > 0, timeInfo.bbt.beat); | |||
const double ppqBar = static_cast<double>(timeInfo.bbt.beatsPerBar) * (timeInfo.bbt.bar - 1); | |||
const double ppqBeat = static_cast<double>(timeInfo.bbt.beat - 1); | |||
const double ppqTick = timeInfo.bbt.tick / timeInfo.bbt.ticksPerBeat; | |||
fPosInfo.bpm = timeInfo.bbt.beatsPerMinute; | |||
@@ -1022,7 +1044,7 @@ public: | |||
else if (! pData->singleMutex.tryLock()) | |||
{ | |||
for (uint32_t i=0; i < pData->audioOut.count; ++i) | |||
carla_zeroFloats(outBuffer[i], static_cast<int>(frames)); | |||
carla_zeroFloats(outBuffer[i], frames); | |||
return false; | |||
} | |||
@@ -1041,7 +1063,7 @@ public: | |||
// Set audio out buffers | |||
for (uint32_t i=0; i < pData->audioOut.count; ++i) | |||
carla_copyFloats(outBuffer[i], fAudioBuffer.getReadPointer(static_cast<int>(i)), static_cast<int>(frames)); | |||
carla_copyFloats(outBuffer[i], fAudioBuffer.getReadPointer(static_cast<int>(i)), frames); | |||
// -------------------------------------------------------------------------------------------------------- | |||
// Midi out | |||
@@ -1167,7 +1167,7 @@ public: | |||
CARLA_SAFE_ASSERT_INT(timeInfo.bbt.beat > 0, timeInfo.bbt.beat); | |||
const double ppqBar = static_cast<double>(timeInfo.bbt.beatsPerBar) * (timeInfo.bbt.bar - 1); | |||
const double ppqBeat = static_cast<double>(timeInfo.bbt.beat - 1.0); | |||
const double ppqBeat = static_cast<double>(timeInfo.bbt.beat - 1); | |||
const double ppqTick = timeInfo.bbt.tick / timeInfo.bbt.ticksPerBeat; | |||
// PPQ Pos | |||
@@ -7,6 +7,13 @@ | |||
CWD=../.. | |||
include ../Makefile.mk | |||
# Workaround GCC bug | |||
ifeq ($(TESTBUILD),true) | |||
ifeq ($(USING_JUCE),true) | |||
BUILD_CXX_FLAGS += -Wno-undef | |||
endif | |||
endif | |||
# ---------------------------------------------------------------------------------------------------------------------------- | |||
OBJS = \ | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
* Carla Plugin Host | |||
* Copyright (C) 2011-2018 Filipe Coelho <falktx@falktx.com> | |||
* Copyright (C) 2011-2019 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | |||
@@ -24,31 +24,25 @@ | |||
# include <fluidsynth.h> | |||
#endif | |||
#ifdef USING_JUCE | |||
# include "AppConfig.h" | |||
# include "juce_core/juce_core.h" | |||
#else | |||
#if defined(__clang__) | |||
# pragma clang diagnostic push | |||
# pragma clang diagnostic ignored "-Wconversion" | |||
# pragma clang diagnostic ignored "-Weffc++" | |||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
#endif | |||
#include "rtaudio/RtAudio.h" | |||
#include "rtmidi/RtMidi.h" | |||
#if defined(__clang__) | |||
# pragma clang diagnostic pop | |||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#ifdef USING_JUCE | |||
# include "AppConfig.h" | |||
# include "juce_core/juce_core.h" | |||
#else | |||
# include "rtaudio/RtAudio.h" | |||
# include "rtmidi/RtMidi.h" | |||
#endif | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
#include "water/files/File.h" | |||
@@ -43,12 +43,23 @@ | |||
#endif | |||
#ifdef USING_JUCE | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
# endif | |||
# include "AppConfig.h" | |||
# if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
# include "juce_gui_basics/juce_gui_basics.h" | |||
# else | |||
# include "juce_events/juce_events.h" | |||
# endif | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
#endif | |||
#include "jackbridge/JackBridge.hpp" | |||
@@ -186,6 +197,9 @@ public: | |||
CarlaBridgePlugin(const bool useBridge, const char* const clientName, const char* const audioPoolBaseName, | |||
const char* const rtClientBaseName, const char* const nonRtClientBaseName, const char* const nonRtServerBaseName) | |||
: fEngine(nullptr), | |||
#ifdef USING_JUCE | |||
fJuceInitialiser(), | |||
#endif | |||
fUsingBridge(false), | |||
fUsingExec(false) | |||
{ | |||
@@ -300,13 +314,14 @@ protected: | |||
private: | |||
const CarlaEngine* fEngine; | |||
bool fUsingBridge; | |||
bool fUsingExec; | |||
#ifdef USING_JUCE | |||
const juce::ScopedJuceInitialiser_GUI sJuceInitialiser; | |||
const juce::ScopedJuceInitialiser_GUI fJuceInitialiser; | |||
#endif | |||
bool fUsingBridge; | |||
bool fUsingExec; | |||
static void callback(void* ptr, EngineCallbackOpcode action, unsigned int pluginId, int value1, int value2, float value3, const char* valueStr) | |||
{ | |||
carla_debug("CarlaBridgePlugin::callback(%p, %i:%s, %i, %i, %i, %f, \"%s\")", ptr, action, EngineCallbackOpcode2Str(action), pluginId, value1, value2, value3, valueStr); | |||
@@ -28,8 +28,21 @@ | |||
#include "CarlaUtils.h" | |||
#ifdef USING_JUCE | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
# endif | |||
# include "AppConfig.h" | |||
# include "juce_events/juce_events.h" | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
#endif | |||
#include "water/files/File.h" | |||
@@ -55,6 +68,9 @@ public: | |||
: Lv2PluginBaseClass<EngineTimeInfo>(sampleRate, features), | |||
fPlugin(nullptr), | |||
fUiName() | |||
#ifdef USING_JUCE | |||
, fJuceInitialiser() | |||
#endif | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->curPluginCount == 0,) | |||
CARLA_SAFE_ASSERT_RETURN(pData->plugins == nullptr,); | |||
@@ -473,7 +489,7 @@ private: | |||
CarlaString fUiName; | |||
#ifdef USING_JUCE | |||
juce::SharedResourcePointer<juce::ScopedJuceInitialiser_GUI> sJuceInitialiser; | |||
juce::SharedResourcePointer<juce::ScopedJuceInitialiser_GUI> fJuceInitialiser; | |||
#endif | |||
void updateParameterOutputs() noexcept | |||
@@ -8,6 +8,13 @@ CWD=.. | |||
MODULENAME=carla-bridge | |||
include $(CWD)/Makefile.mk | |||
# Workaround GCC bug | |||
ifeq ($(TESTBUILD),true) | |||
ifeq ($(USING_JUCE),true) | |||
BUILD_CXX_FLAGS += -Wno-undef | |||
endif | |||
endif | |||
# ---------------------------------------------------------------------------------------------------------------------- | |||
BINDIR := $(CWD)/../bin | |||
@@ -286,10 +286,9 @@ CARLA_BRIDGE_UI_END_NAMESPACE | |||
// ------------------------------------------------------------------------- | |||
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0) | |||
// missing declaration | |||
int qInitResources(); | |||
int qCleanupResources(); | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wmissing-declarations" | |||
#endif | |||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) | |||
@@ -298,4 +297,8 @@ int qCleanupResources(); | |||
# include "resources.qt4.cpp" | |||
#endif | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
// ------------------------------------------------------------------------- |
@@ -7,6 +7,13 @@ | |||
CWD=.. | |||
include $(CWD)/Makefile.mk | |||
# Workaround GCC bug | |||
ifeq ($(TESTBUILD),true) | |||
ifeq ($(USING_JUCE),true) | |||
BUILD_CXX_FLAGS += -Wno-undef | |||
endif | |||
endif | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
BINDIR := $(CWD)/../bin | |||
@@ -24,8 +24,19 @@ | |||
#include "CarlaString.hpp" | |||
#ifdef USING_JUCE | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
# endif | |||
# include "AppConfig.h" | |||
# include "juce_events/juce_events.h" | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
#endif | |||
#include "water/files/File.h" | |||
@@ -57,6 +68,9 @@ public: | |||
fProgramDesc({0, 0, nullptr}), | |||
#endif | |||
fMidiEventCount(0), | |||
#ifdef USING_JUCE | |||
fJuceInitialiser(), | |||
#endif | |||
fWorkerUISignal(0) | |||
{ | |||
carla_zeroStruct(fHost); | |||
@@ -733,12 +747,12 @@ private: | |||
uint32_t fMidiEventCount; | |||
NativeMidiEvent fMidiEvents[kMaxMidiEvents]; | |||
int fWorkerUISignal; | |||
#ifdef USING_JUCE | |||
juce::SharedResourcePointer<juce::ScopedJuceInitialiser_GUI> sJuceInitialiser; | |||
juce::SharedResourcePointer<juce::ScopedJuceInitialiser_GUI> fJuceInitialiser; | |||
#endif | |||
int fWorkerUISignal; | |||
// ------------------------------------------------------------------- | |||
#define handlePtr ((NativePlugin*)handle) | |||
@@ -43,8 +43,19 @@ | |||
#include "CarlaVstUtils.hpp" | |||
#ifdef USING_JUCE | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
# endif | |||
# include "AppConfig.h" | |||
# include "juce_events/juce_events.h" | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
#endif | |||
static uint32_t d_lastBufferSize = 0; | |||
@@ -76,6 +87,9 @@ public: | |||
fUiLauncher(nullptr), | |||
fHostType(kHostTypeNull), | |||
fMidiOutEvents(), | |||
#ifdef USING_JUCE | |||
fJuceInitialiser(), | |||
#endif | |||
fStateChunk(nullptr) | |||
{ | |||
fHost.handle = this; | |||
@@ -618,12 +632,12 @@ private: | |||
CARLA_DECLARE_NON_COPY_STRUCT(FixedVstEvents); | |||
} fMidiOutEvents; | |||
char* fStateChunk; | |||
#ifdef USING_JUCE | |||
juce::SharedResourcePointer<juce::ScopedJuceInitialiser_GUI> sJuceInitialiser; | |||
juce::SharedResourcePointer<juce::ScopedJuceInitialiser_GUI> fJuceInitialiser; | |||
#endif | |||
char* fStateChunk; | |||
// ------------------------------------------------------------------- | |||
#define handlePtr ((NativePlugin*)handle) | |||
@@ -23,9 +23,9 @@ | |||
#include "AppConfig.h" | |||
#include "juce_gui_basics/juce_gui_basics.h" | |||
#if JUCE_LINUX && defined(HAVE_X11) | |||
#if defined(CARLA_OS_LINUX) && defined(HAVE_X11) | |||
# include <X11/Xlib.h> | |||
#elif JUCE_MAC | |||
#elif defined(CARLA_OS_MAC) | |||
# import <Cocoa/Cocoa.h> | |||
#endif | |||
@@ -98,7 +98,7 @@ private: | |||
if (fTransientId == 0) | |||
return; | |||
#if JUCE_LINUX && defined(HAVE_X11) | |||
#if defined(CARLA_OS_LINUX) && defined(HAVE_X11) | |||
Display* const display = XWindowSystem::getInstance()->displayRef(); | |||
CARLA_SAFE_ASSERT_RETURN(display != nullptr,); | |||
@@ -109,7 +109,7 @@ private: | |||
XSetTransientForHint(display, window, static_cast<::Window>(fTransientId)); | |||
#endif | |||
#if JUCE_MAC | |||
#ifdef CARLA_OS_MAC | |||
NSView* const view = (NSView*)getWindowHandle(); | |||
CARLA_SAFE_ASSERT_RETURN(view != nullptr,); | |||
@@ -123,7 +123,7 @@ private: | |||
ordered:NSWindowAbove]; | |||
#endif | |||
#if JUCE_WINDOWS | |||
#ifdef CARLA_OS_WIN | |||
const HWND window = (HWND)getWindowHandle(); | |||
CARLA_SAFE_ASSERT_RETURN(window != nullptr,); | |||