diff --git a/source/backend/Makefile b/source/backend/Makefile index 33c3ed005..2e286c774 100644 --- a/source/backend/Makefile +++ b/source/backend/Makefile @@ -57,6 +57,15 @@ UTILS_LIBS += $(MODULEDIR)/juce_audio_formats.a UTILS_LIBS += $(MODULEDIR)/juce_core.a UTILS_LIBS += $(MODULEDIR)/lilv.a +ifeq ($(MACOS),true) +UTILS_LIBS += $(MODULEDIR)/juce_audio_processors.a +UTILS_LIBS += $(MODULEDIR)/juce_data_structures.a +UTILS_LIBS += $(MODULEDIR)/juce_events.a +UTILS_LIBS += $(MODULEDIR)/juce_graphics.a +UTILS_LIBS += $(MODULEDIR)/juce_gui_basics.a +UTILS_LIBS += $(MODULEDIR)/juce_gui_extra.a +endif + # ---------------------------------------------------------------------------------------------------------------------------- STANDALONE_LINK_FLAGS = $(JACKBRIDGE_LIBS) @@ -107,6 +116,15 @@ UTILS_LINK_FLAGS += $(JUCE_AUDIO_FORMATS_LIBS) UTILS_LINK_FLAGS += $(JUCE_CORE_LIBS) UTILS_LINK_FLAGS += $(LILV_LIBS) +ifeq ($(MACOS),true) +UTILS_LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS) +UTILS_LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS) +UTILS_LINK_FLAGS += $(JUCE_EVENTS_LIBS) +UTILS_LINK_FLAGS += $(JUCE_GRAPHICS_LIBS) +UTILS_LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) +UTILS_LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS) +endif + ifneq ($(HAIKU),true) UTILS_LINK_FLAGS += -lpthread endif diff --git a/source/backend/plugin/CarlaPluginBridge.cpp b/source/backend/plugin/CarlaPluginBridge.cpp index bc1d923ad..098b41b68 100644 --- a/source/backend/plugin/CarlaPluginBridge.cpp +++ b/source/backend/plugin/CarlaPluginBridge.cpp @@ -60,7 +60,7 @@ struct BridgeAudioPool { , shm(shm_t_INIT) {} #else { - shm = shm_t_INIT; + carla_shm_init(shm); } #endif @@ -137,12 +137,12 @@ struct BridgeRtClientControl : public CarlaRingBufferControl { BridgeRtClientControl() : data(nullptr), filename(), - needsSemDestroy(false), + needsSemDestroy(false) #ifdef CARLA_PROPER_CPP11_SUPPORT - shm(shm_t_INIT) {} + , shm(shm_t_INIT) {} #else { - shm = shm_t_INIT; + carla_shm_init(shm); } #endif @@ -276,7 +276,7 @@ struct BridgeNonRtClientControl : public CarlaRingBufferControl , shm(shm_t_INIT) {} #else { - shm = shm_t_INIT; + carla_shm_init(shm); } #endif @@ -391,7 +391,7 @@ struct BridgeNonRtServerControl : public CarlaRingBufferControl , shm(shm_t_INIT) {} #else { - shm = shm_t_INIT; + carla_shm_init(shm); } #endif diff --git a/source/bridges-ui/CarlaBridgeUI.cpp b/source/bridges-ui/CarlaBridgeUI.cpp index 84c4e7daa..bb3788d41 100644 --- a/source/bridges-ui/CarlaBridgeUI.cpp +++ b/source/bridges-ui/CarlaBridgeUI.cpp @@ -20,8 +20,12 @@ #include "CarlaBase64Utils.hpp" -#undef NULL -#define NULL nullptr +// needed for atom-util +#ifndef nullptr +# undef NULL +# define NULL nullptr +#endif + #include "lv2/atom-util.h" CARLA_BRIDGE_START_NAMESPACE diff --git a/source/native-plugins/midi-base.hpp b/source/native-plugins/midi-base.hpp index 39806a832..c270ccd2d 100644 --- a/source/native-plugins/midi-base.hpp +++ b/source/native-plugins/midi-base.hpp @@ -37,13 +37,6 @@ struct RawMidiEvent { uint64_t time; uint8_t size; uint8_t data[MAX_EVENT_DATA_SIZE]; - - RawMidiEvent() noexcept - : time(0), - size(0) - { - carla_zeroBytes(data, MAX_EVENT_DATA_SIZE); - } }; // ----------------------------------------------------------------------- @@ -355,6 +348,8 @@ public: if (needle == nullptr) return; + carla_zeroStruct(midiEvent); + tmpSize = needle - dataRead; CARLA_SAFE_ASSERT_RETURN(tmpSize > 0 && tmpSize < 24,); diff --git a/source/native-plugins/midi-sequencer.cpp b/source/native-plugins/midi-sequencer.cpp index 0baf03371..7bb9b8be2 100644 --- a/source/native-plugins/midi-sequencer.cpp +++ b/source/native-plugins/midi-sequencer.cpp @@ -61,14 +61,14 @@ protected: for (uint32_t i=0; i < midiEventCount; ++i) { - const NativeMidiEvent* const midiEvent = &midiEvents[i]; + const NativeMidiEvent* const midiEvent(&midiEvents[i]); + rawMidiEvent.time = fTimeInfo.playing ? fTimeInfo.frame + midiEvent->time : 0; + rawMidiEvent.size = midiEvent->size; rawMidiEvent.data[0] = midiEvent->data[0]; rawMidiEvent.data[1] = midiEvent->data[1]; rawMidiEvent.data[2] = midiEvent->data[2]; rawMidiEvent.data[3] = midiEvent->data[3]; - rawMidiEvent.size = midiEvent->size; - rawMidiEvent.time = fTimeInfo.playing ? fTimeInfo.frame + midiEvent->time : 0; fInEvents.appendRT(rawMidiEvent); } @@ -147,7 +147,7 @@ protected: const double fullBeats = fullTicks/ticksPerBeat; const uint32_t tick = static_cast(std::floor(std::fmod(fullTicks, ticksPerBeat))); - const uint32_t beat = static_cast(std::floor(std::fmod(fullBeats, beatsPerBar))); + const uint32_t beat = static_cast(std::floor(std::fmod(fullBeats, static_cast(beatsPerBar)))); const uint32_t bar = static_cast(std::floor(fullBeats/beatsPerBar)); const CarlaMutexLocker cml(getPipeLock()); diff --git a/source/utils/CarlaPipeUtils.cpp b/source/utils/CarlaPipeUtils.cpp index f1fe0a8b0..3faa8fd42 100644 --- a/source/utils/CarlaPipeUtils.cpp +++ b/source/utils/CarlaPipeUtils.cpp @@ -19,11 +19,14 @@ #include "CarlaString.hpp" #include "CarlaMIDI.h" +#include "juce_core.h" + // needed for atom-util -#undef NULL -#define NULL nullptr +#ifndef nullptr +# undef NULL +# define NULL nullptr +#endif -#include "juce_core.h" #include "lv2/atom-util.h" #include