| @@ -46,7 +46,7 @@ make $JOBS UI RES WIDGETS | |||||
| # Build discovery | # Build discovery | ||||
| make $JOBS discovery | make $JOBS discovery | ||||
| rm bin/carla-discovery-win32.exe | |||||
| rm -f bin/carla-discovery-win32.exe | |||||
| cp bin/carla-discovery-native.exe bin/carla-discovery-win32.exe | cp bin/carla-discovery-native.exe bin/carla-discovery-win32.exe | ||||
| # Build backend | # Build backend | ||||
| @@ -47,7 +47,7 @@ make $JOBS UI RES WIDGETS | |||||
| # Build discovery | # Build discovery | ||||
| make $JOBS discovery | make $JOBS discovery | ||||
| rm bin/carla-discovery-win64.exe | |||||
| rm -f bin/carla-discovery-win64.exe | |||||
| cp bin/carla-discovery-native.exe bin/carla-discovery-win64.exe | cp bin/carla-discovery-native.exe bin/carla-discovery-win64.exe | ||||
| # Build backend | # Build backend | ||||
| @@ -99,6 +99,10 @@ UTILS_LINK_FLAGS += $(JUCE_CORE_LIBS) | |||||
| UTILS_LINK_FLAGS += $(LILV_LIBS) | UTILS_LINK_FLAGS += $(LILV_LIBS) | ||||
| UTILS_LINK_FLAGS += $(NATIVE_PLUGINS_LIBS) | UTILS_LINK_FLAGS += $(NATIVE_PLUGINS_LIBS) | ||||
| ifneq ($(HAIKU),true) | |||||
| UTILS_LINK_FLAGS += -lpthread | |||||
| endif | |||||
| # ---------------------------------------------------------------------------------------------------------------------------- | # ---------------------------------------------------------------------------------------------------------------------------- | ||||
| all: $(TARGETS) | all: $(TARGETS) | ||||
| @@ -812,7 +812,7 @@ private: | |||||
| void splice() | void splice() | ||||
| { | { | ||||
| dataPending.spliceAppendTo(data); | |||||
| dataPending.moveTo(data, true /* append */); | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -1453,7 +1453,6 @@ protected: | |||||
| const CarlaMutexLocker cml(fUiServer.getPipeLock()); | const CarlaMutexLocker cml(fUiServer.getPipeLock()); | ||||
| const ScopedLocale csl; | const ScopedLocale csl; | ||||
| #ifndef CARLA_OS_WIN // FIXME | |||||
| // send transport | // send transport | ||||
| fUiServer.writeAndFixMessage("transport"); | fUiServer.writeAndFixMessage("transport"); | ||||
| fUiServer.writeMessage(timeInfo.playing ? "true\n" : "false\n"); | fUiServer.writeMessage(timeInfo.playing ? "true\n" : "false\n"); | ||||
| @@ -1473,7 +1472,6 @@ protected: | |||||
| } | } | ||||
| fUiServer.flushMessages(); | fUiServer.flushMessages(); | ||||
| #endif | |||||
| // send peaks and param outputs for all plugins | // send peaks and param outputs for all plugins | ||||
| for (uint i=0; i < pData->curPluginCount; ++i) | for (uint i=0; i < pData->curPluginCount; ++i) | ||||
| @@ -37,8 +37,8 @@ static const bool gHideShowTesting = std::getenv("CARLA_UI_TESTING") != nullptr; | |||||
| class CarlaBridgeToolkitGtk : public CarlaBridgeToolkit | class CarlaBridgeToolkitGtk : public CarlaBridgeToolkit | ||||
| { | { | ||||
| public: | public: | ||||
| CarlaBridgeToolkitGtk(CarlaBridgeUI* const ui) | |||||
| : CarlaBridgeToolkit(ui), | |||||
| CarlaBridgeToolkitGtk(CarlaBridgeUI* const u) | |||||
| : CarlaBridgeToolkit(u), | |||||
| fNeedsShow(false), | fNeedsShow(false), | ||||
| fWindow(nullptr), | fWindow(nullptr), | ||||
| fLastX(0), | fLastX(0), | ||||
| @@ -47,7 +47,7 @@ public: | |||||
| fLastHeight(0), | fLastHeight(0), | ||||
| leakDetector_CarlaBridgeToolkitGtk() | leakDetector_CarlaBridgeToolkitGtk() | ||||
| { | { | ||||
| carla_debug("CarlaBridgeToolkitGtk::CarlaBridgeToolkitGtk(%p)", ui); | |||||
| carla_debug("CarlaBridgeToolkitGtk::CarlaBridgeToolkitGtk(%p)", u); | |||||
| } | } | ||||
| ~CarlaBridgeToolkitGtk() override | ~CarlaBridgeToolkitGtk() override | ||||
| @@ -34,13 +34,16 @@ class CarlaBridgeToolkitPlugin : public CarlaBridgeToolkit, | |||||
| private CarlaPluginUI::CloseCallback | private CarlaPluginUI::CloseCallback | ||||
| { | { | ||||
| public: | public: | ||||
| CarlaBridgeToolkitPlugin(CarlaBridgeUI* const ui) | |||||
| : CarlaBridgeToolkit(ui), | |||||
| CarlaBridgeToolkitPlugin(CarlaBridgeUI* const u) | |||||
| : CarlaBridgeToolkit(u), | |||||
| fUI(nullptr), | fUI(nullptr), | ||||
| fIdling(false), | fIdling(false), | ||||
| #if defined(CARLA_OS_WIN) || defined(CARLA_OS_MAC) | |||||
| kJuceInit(), | |||||
| #endif | |||||
| leakDetector_CarlaBridgeToolkitPlugin() | leakDetector_CarlaBridgeToolkitPlugin() | ||||
| { | { | ||||
| carla_debug("CarlaBridgeToolkitPlugin::CarlaBridgeToolkitPlugin(%p)", ui); | |||||
| carla_debug("CarlaBridgeToolkitPlugin::CarlaBridgeToolkitPlugin(%p)", u); | |||||
| } | } | ||||
| ~CarlaBridgeToolkitPlugin() override | ~CarlaBridgeToolkitPlugin() override | ||||
| @@ -50,16 +50,16 @@ class CarlaBridgeToolkitQt: public QObject, | |||||
| Q_OBJECT | Q_OBJECT | ||||
| public: | public: | ||||
| CarlaBridgeToolkitQt(CarlaBridgeUI* const ui) | |||||
| CarlaBridgeToolkitQt(CarlaBridgeUI* const u) | |||||
| : QObject(nullptr), | : QObject(nullptr), | ||||
| CarlaBridgeToolkit(ui), | |||||
| CarlaBridgeToolkit(u), | |||||
| fApp(nullptr), | fApp(nullptr), | ||||
| fWindow(nullptr), | fWindow(nullptr), | ||||
| fMsgTimer(0), | fMsgTimer(0), | ||||
| fNeedsShow(false), | fNeedsShow(false), | ||||
| leakDetector_CarlaBridgeToolkitQt() | leakDetector_CarlaBridgeToolkitQt() | ||||
| { | { | ||||
| carla_debug("CarlaBridgeToolkitQt::CarlaBridgeToolkitQt(%p)", ui); | |||||
| carla_debug("CarlaBridgeToolkitQt::CarlaBridgeToolkitQt(%p)", u); | |||||
| } | } | ||||
| ~CarlaBridgeToolkitQt() override | ~CarlaBridgeToolkitQt() override | ||||
| @@ -519,8 +519,10 @@ public: | |||||
| void idleUI() override | void idleUI() override | ||||
| { | { | ||||
| #if defined(BRIDGE_COCOA) || defined(BRIDGE_HWND) || defined(BRIDGE_X11) | |||||
| if (fHandle != nullptr && fExt.idle != nullptr) | if (fHandle != nullptr && fExt.idle != nullptr) | ||||
| fExt.idle->idle(fHandle); | fExt.idle->idle(fHandle); | ||||
| #endif | |||||
| } | } | ||||
| // --------------------------------------------------------------------- | // --------------------------------------------------------------------- | ||||
| @@ -218,7 +218,7 @@ bool CarlaBridgeUI::msgReceived(const char* const msg) noexcept | |||||
| CARLA_SAFE_ASSERT_RETURN(readNextLineAsULong(transientWindowId), true); | CARLA_SAFE_ASSERT_RETURN(readNextLineAsULong(transientWindowId), true); | ||||
| fGotOptions = true; | fGotOptions = true; | ||||
| uiOptionsChanged(useTheme, useThemeColors, windowTitle, transientWindowId); | |||||
| uiOptionsChanged(useTheme, useThemeColors, windowTitle, static_cast<uintptr_t>(transientWindowId)); | |||||
| delete[] windowTitle; | delete[] windowTitle; | ||||
| return true; | return true; | ||||
| @@ -25,6 +25,10 @@ endif | |||||
| BUILD_CXX_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_UI -I. -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/utils -isystem $(CWD)/modules | BUILD_CXX_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_UI -I. -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/utils -isystem $(CWD)/modules | ||||
| LINK_FLAGS += $(JUCE_CORE_LIBS) | LINK_FLAGS += $(JUCE_CORE_LIBS) | ||||
| ifneq ($(HAIKU),true) | |||||
| LINK_FLAGS += -lpthread | |||||
| endif | |||||
| # ---------------------------------------------------------------------------------------------------------------------------- | # ---------------------------------------------------------------------------------------------------------------------------- | ||||
| BUILD_GTK2_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_GTK2 $(shell pkg-config --cflags gtk+-2.0) | BUILD_GTK2_FLAGS = $(BUILD_CXX_FLAGS) -DBRIDGE_GTK2 $(shell pkg-config --cflags gtk+-2.0) | ||||
| @@ -84,6 +84,18 @@ class CarlaHostSignals(QObject): | |||||
| ErrorCallback = pyqtSignal(str) | ErrorCallback = pyqtSignal(str) | ||||
| QuitCallback = pyqtSignal() | QuitCallback = pyqtSignal() | ||||
| #def __init__(self): | |||||
| #QObject.__init__(self) | |||||
| # ------------------------------------------------------------------------------------------------------------ | |||||
| # Carla Host object (dummy/null, does nothing) | |||||
| class CarlaHostQtNull(CarlaHostSignals, CarlaHostNull): | |||||
| #class CarlaHostQtDLL(CarlaHostSignals, CarlaHostNull, metaclass=PyQtMetaClass): | |||||
| def __init__(self): | |||||
| CarlaHostSignals.__init__(self) | |||||
| CarlaHostNull.__init__(self) | |||||
| # ------------------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------------------ | ||||
| # Carla Host object using a DLL | # Carla Host object using a DLL | ||||
| @@ -2008,7 +2008,7 @@ def initHost(initName, libPrefixOrPluginClass, isControl, isPlugin, failError): | |||||
| try: | try: | ||||
| host = PluginClass() if isPlugin else CarlaHostQtDLL(os.path.join(pathBinaries, libname)) | host = PluginClass() if isPlugin else CarlaHostQtDLL(os.path.join(pathBinaries, libname)) | ||||
| except: | except: | ||||
| host = CarlaHostNull() | |||||
| host = CarlaHostQtNull() | |||||
| host.isControl = isControl | host.isControl = isControl | ||||
| host.isPlugin = isPlugin | host.isPlugin = isPlugin | ||||
| @@ -39,6 +39,11 @@ ifeq ($(MACOS),true) | |||||
| BUILD_CXX_FLAGS += -ObjC++ | BUILD_CXX_FLAGS += -ObjC++ | ||||
| endif | endif | ||||
| # vstsdk requires this | |||||
| ifeq ($(MACOS_OR_WIN32),true) | |||||
| BUILD_CXX_FLAGS += -Wno-zero-as-null-pointer-constant | |||||
| endif | |||||
| 32BIT_FLAGS += -DBUILD_BRIDGE | 32BIT_FLAGS += -DBUILD_BRIDGE | ||||
| 64BIT_FLAGS += -DBUILD_BRIDGE | 64BIT_FLAGS += -DBUILD_BRIDGE | ||||
| @@ -92,8 +92,8 @@ | |||||
| # define P_UINTPTR "%llx" | # define P_UINTPTR "%llx" | ||||
| # define P_SIZE "%I64u" | # define P_SIZE "%I64u" | ||||
| #elif defined(CARLA_OS_WIN32) | #elif defined(CARLA_OS_WIN32) | ||||
| # define P_INT64 "%I64i" | |||||
| # define P_UINT64 "%I64u" | |||||
| # define P_INT64 "%lli" | |||||
| # define P_UINT64 "%llu" | |||||
| # define P_INTPTR "%i" | # define P_INTPTR "%i" | ||||
| # define P_UINTPTR "%x" | # define P_UINTPTR "%x" | ||||
| # define P_SIZE "%u" | # define P_SIZE "%u" | ||||
| @@ -19,6 +19,7 @@ | |||||
| #ifdef JACKBRIDGE_DUMMY | #ifdef JACKBRIDGE_DUMMY | ||||
| # include "CarlaUtils.hpp" | # include "CarlaUtils.hpp" | ||||
| #else | #else | ||||
| # include <cerrno> | |||||
| # include "CarlaSemUtils.hpp" | # include "CarlaSemUtils.hpp" | ||||
| # include "CarlaShmUtils.hpp" | # include "CarlaShmUtils.hpp" | ||||
| #endif // ! JACKBRIDGE_DUMMY | #endif // ! JACKBRIDGE_DUMMY | ||||
| @@ -43,6 +43,9 @@ LIBS += $(MODULEDIR)/juce_data_structures.a | |||||
| LIBS += $(MODULEDIR)/juce_events.a | LIBS += $(MODULEDIR)/juce_events.a | ||||
| LIBS += $(MODULEDIR)/juce_graphics.a | LIBS += $(MODULEDIR)/juce_graphics.a | ||||
| LIBS += $(MODULEDIR)/juce_gui_basics.a | LIBS += $(MODULEDIR)/juce_gui_basics.a | ||||
| endif | |||||
| ifeq ($(MACOS),true) | |||||
| LIBS += $(MODULEDIR)/juce_gui_extra.a | LIBS += $(MODULEDIR)/juce_gui_extra.a | ||||
| endif | endif | ||||
| @@ -64,6 +67,9 @@ LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS) | |||||
| LINK_FLAGS += $(JUCE_EVENTS_LIBS) | LINK_FLAGS += $(JUCE_EVENTS_LIBS) | ||||
| LINK_FLAGS += $(JUCE_GRAPHICS_LIBS) | LINK_FLAGS += $(JUCE_GRAPHICS_LIBS) | ||||
| LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) | LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) | ||||
| endif | |||||
| ifeq ($(MACOS),true) | |||||
| LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS) | LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS) | ||||
| endif | endif | ||||
| @@ -16,7 +16,6 @@ | |||||
| */ | */ | ||||
| #include "CarlaPipeUtils.hpp" | #include "CarlaPipeUtils.hpp" | ||||
| #include "CarlaSemUtils.hpp" | |||||
| // ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
| @@ -31,8 +30,6 @@ public: | |||||
| carla_stdout("CLIENT RECEIVED: \"%s\"", msg); | carla_stdout("CLIENT RECEIVED: \"%s\"", msg); | ||||
| return true; | return true; | ||||
| } | } | ||||
| sem_t sem; | |||||
| }; | }; | ||||
| class CarlaPipeServer2 : public CarlaPipeServer | class CarlaPipeServer2 : public CarlaPipeServer | ||||
| @@ -26,8 +26,6 @@ | |||||
| #include <semaphore.h> | #include <semaphore.h> | ||||
| #if defined(CARLA_OS_MAC) | #if defined(CARLA_OS_MAC) | ||||
| # include <fcntl.h> | |||||
| # include <unistd.h> | |||||
| extern "C" { | extern "C" { | ||||
| # include "osx_sem_timedwait.c" | # include "osx_sem_timedwait.c" | ||||
| }; | }; | ||||
| @@ -126,7 +124,7 @@ bool carla_sem_timedwait(sem_t* const sem, const uint secs) noexcept | |||||
| timeout.tv_sec = now.tv_sec; | timeout.tv_sec = now.tv_sec; | ||||
| timeout.tv_nsec = now.tv_usec * 1000; | timeout.tv_nsec = now.tv_usec * 1000; | ||||
| #endif | #endif | ||||
| timeout.tv_sec += secs; | |||||
| timeout.tv_sec += static_cast<time_t>(secs); | |||||
| try { | try { | ||||
| return (::sem_timedwait(sem, &timeout) == 0); | return (::sem_timedwait(sem, &timeout) == 0); | ||||
| @@ -170,7 +170,7 @@ void* carla_shm_map(shm_t& shm, const std::size_t size) noexcept | |||||
| try { | try { | ||||
| #ifdef CARLA_OS_WIN | #ifdef CARLA_OS_WIN | ||||
| const HANDLE map(:CreateFileMapping(shm.shm, nullptr, PAGE_READWRITE, size, size, nullptr)); | |||||
| const HANDLE map(::CreateFileMapping(shm.shm, nullptr, PAGE_READWRITE, size, size, nullptr)); | |||||
| CARLA_SAFE_ASSERT_RETURN(map != nullptr, nullptr); | CARLA_SAFE_ASSERT_RETURN(map != nullptr, nullptr); | ||||
| void* const ptr(::MapViewOfFile(map, FILE_MAP_COPY, 0, 0, size)); | void* const ptr(::MapViewOfFile(map, FILE_MAP_COPY, 0, 0, size)); | ||||