From bbbc6982fb4a3f9dd0a55520058f42fef5b1225f Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 20 Jan 2018 16:48:10 +0100 Subject: [PATCH 01/37] Fix macOS deps build under 10.12 --- data/macos/build-deps.sh | 2 +- data/macos/patches/qt55-newosx-fix.patch | 71 ++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 data/macos/patches/qt55-newosx-fix.patch diff --git a/data/macos/build-deps.sh b/data/macos/build-deps.sh index fc738b38e..f638e854a 100755 --- a/data/macos/build-deps.sh +++ b/data/macos/build-deps.sh @@ -405,7 +405,7 @@ if [ ! -f qtbase-opensource-src-${QT5_VERSION}/build-done ]; then -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \ -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \ -no-cups -no-dbus -no-evdev -no-fontconfig -no-harfbuzz -no-gif -no-glib -no-nis -no-openssl -no-pch -no-sql-ibase -no-sql-odbc \ - -no-audio-backend -no-qml-debug -no-separate-debug-info \ + -no-audio-backend -no-qml-debug -no-separate-debug-info -no-use-gold-linker \ -no-compile-examples -nomake examples -nomake tests -make libs -make tools touch configured fi diff --git a/data/macos/patches/qt55-newosx-fix.patch b/data/macos/patches/qt55-newosx-fix.patch new file mode 100644 index 000000000..8c2a56d87 --- /dev/null +++ b/data/macos/patches/qt55-newosx-fix.patch @@ -0,0 +1,71 @@ +From 0707260a4f8e64dfadf1df5f935e74cabb7c7d27 Mon Sep 17 00:00:00 2001 +From: Jake Petroules +Date: Sun, 1 Oct 2017 21:48:17 -0700 +Subject: [PATCH] Fix build error with macOS 10.13 SDK +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf8 +Content-Transfer-Encoding: 8bit + +Several of these variables/macros are no longer defined. We didn't +validate the preconditions on iOS, tvOS, or watchOS, so no +need to bother validating them on macOS either. Nor did we check the +OSStatus result on any platform anyways. + +Task-number: QTBUG-63401 +Change-Id: Ife64dff767cf6d3f4b839fc53ec486181c176bf3 +(cherry-picked from 861544583511d4e6f7745d2339b26ff1cd44132b) +Reviewed-by: Timur Pocheptsov +Reviewed-by: Tor Arne Vestbø +--- + src/plugins/platforms/cocoa/qcocoahelpers.h | 2 +- + src/plugins/platforms/cocoa/qcocoahelpers.mm | 13 +------------ + 2 files changed, 2 insertions(+), 13 deletions(-) + +diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h +index bbb3793..74371d5 100644 +--- a/src/plugins/platforms/cocoa/qcocoahelpers.h ++++ b/src/plugins/platforms/cocoa/qcocoahelpers.h +@@ -80,7 +80,7 @@ QColor qt_mac_toQColor(CGColorRef color); + // Creates a mutable shape, it's the caller's responsibility to release. + HIMutableShapeRef qt_mac_QRegionToHIMutableShape(const QRegion ®ion); + +-OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage); ++void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage); + + NSDragOperation qt_mac_mapDropAction(Qt::DropAction action); + NSDragOperation qt_mac_mapDropActions(Qt::DropActions actions); +diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm +index cd73148..3f8429e 100644 +--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm ++++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm +@@ -544,15 +544,8 @@ NSRect qt_mac_flipRect(const QRect &rect) + return NSMakeRect(rect.x(), flippedY, rect.width(), rect.height()); + } + +-OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage) ++void qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGImageRef inImage) + { +- // Verbatim copy if HIViewDrawCGImage (as shown on Carbon-Dev) +- OSStatus err = noErr; +- +- require_action(inContext != NULL, InvalidContext, err = paramErr); +- require_action(inBounds != NULL, InvalidBounds, err = paramErr); +- require_action(inImage != NULL, InvalidImage, err = paramErr); +- + CGContextSaveGState( inContext ); + CGContextTranslateCTM (inContext, 0, inBounds->origin.y + CGRectGetMaxY(*inBounds)); + CGContextScaleCTM(inContext, 1, -1); +@@ -560,10 +553,6 @@ OSStatus qt_mac_drawCGImage(CGContextRef inContext, const CGRect *inBounds, CGIm + CGContextDrawImage(inContext, *inBounds, inImage); + + CGContextRestoreGState(inContext); +-InvalidImage: +-InvalidBounds: +-InvalidContext: +- return err; + } + + Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum) +-- +2.7.4 + From bcfb07f7730416eb863f06e4632910fa05ebab91 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 20 Jan 2018 17:07:58 +0100 Subject: [PATCH 02/37] Do not set MACOS_OLD on new macOS systems --- data/macos/build.sh | 5 ++++- data/macos/env.sh | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/data/macos/build.sh b/data/macos/build.sh index c100e60ac..5c5a82791 100755 --- a/data/macos/build.sh +++ b/data/macos/build.sh @@ -20,7 +20,10 @@ source data/macos/common.env MAKE_ARGS="${MAKE_ARGS} EXTERNAL_PLUGINS=false" export MACOS="true" -export MACOS_OLD="true" + +if [ $(clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p') -lt 9 ]; then + export MACOS_OLD="true" +fi export CC=clang export CXX=clang++ diff --git a/data/macos/env.sh b/data/macos/env.sh index 1e4ffd026..07b7f3c48 100644 --- a/data/macos/env.sh +++ b/data/macos/env.sh @@ -5,13 +5,14 @@ source data/macos/common.env -export MACOS="true" -export MACOS_OLD="true" export CC=clang export CXX=clang++ export MACOS="true" -export MACOS_OLD="true" + +if [ $(clang -v 2>&1 | sed -n 's/.*version \([0-9]\).*/\1/p') -lt 9 ]; then + export MACOS_OLD="true" +fi export CC=clang export CXX=clang++ From 3d0cdd10de3aaf7640a1c1b8c9c7b99af14e2c17 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 11:48:56 +0100 Subject: [PATCH 03/37] Build extra plugins on windows and mac --- data/macos/build.sh | 2 -- data/windows/build-win.sh | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/macos/build.sh b/data/macos/build.sh index c100e60ac..adbddae30 100755 --- a/data/macos/build.sh +++ b/data/macos/build.sh @@ -17,8 +17,6 @@ fi source data/macos/common.env -MAKE_ARGS="${MAKE_ARGS} EXTERNAL_PLUGINS=false" - export MACOS="true" export MACOS_OLD="true" diff --git a/data/windows/build-win.sh b/data/windows/build-win.sh index f417c2d9e..b078ebcd9 100755 --- a/data/windows/build-win.sh +++ b/data/windows/build-win.sh @@ -27,8 +27,11 @@ fi source data/windows/common.env -MAKE_ARGS="${MAKE_ARGS} HAVE_QT4=false HAVE_QT5=false HAVE_PYQT5=true HAVE_FFMPEG=false" -MAKE_ARGS="${MAKE_ARGS} BUILDING_FOR_WINDOWS=true EXTERNAL_PLUGINS=false" +MAKE_ARGS="${MAKE_ARGS} HAVE_QT4=false HAVE_QT5=false HAVE_PYQT5=true HAVE_FFMPEG=false HAVE_PROJECTM=false" +MAKE_ARGS="${MAKE_ARGS} BUILDING_FOR_WINDOWS=true" + +# FIXME +MAKE_ARGS="${MAKE_ARGS} HAVE_ZYN_DEPS=false" if [ x"${ARCH}" != x"32" ]; then CPUARCH="x86_64" From a1aa0965cc9fe9bf4006c6fdf1ce81819f22d19e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 11:54:20 +0100 Subject: [PATCH 04/37] Trying to fix transient windows on windows and mac --- source/modules/dgl/src/Window.cpp | 17 ++++++----------- source/utils/CarlaPluginUI.cpp | 13 +++---------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/source/modules/dgl/src/Window.cpp b/source/modules/dgl/src/Window.cpp index 85975f67b..f2d353b2c 100644 --- a/source/modules/dgl/src/Window.cpp +++ b/source/modules/dgl/src/Window.cpp @@ -129,17 +129,15 @@ struct Window::PrivateData { init(); const PuglInternals* const parentImpl(parent.pData->fView->impl); + + // NOTE: almost a 1:1 copy of setTransientWinId() #if defined(DISTRHO_OS_WINDOWS) - // TODO + SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)parentImpl->hwnd); #elif defined(DISTRHO_OS_MAC) - [parentImpl->window orderWindow:NSWindowBelow relativeTo:[[mView window] windowNumber]]; + [mWindow orderWindow:NSWindowBelow relativeTo:parentImpl->window]; #else XSetTransientForHint(xDisplay, xWindow, parentImpl->win); #endif - return; - - // maybe unused - (void)parentImpl; } PrivateData(Application& app, Window* const self, const intptr_t parentId) @@ -626,14 +624,11 @@ struct Window::PrivateData { DISTRHO_SAFE_ASSERT_RETURN(winId != 0,); #if defined(DISTRHO_OS_WINDOWS) - // TODO + SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)winId); #elif defined(DISTRHO_OS_MAC) NSWindow* const window = [NSApp windowWithWindowNumber:winId]; DISTRHO_SAFE_ASSERT_RETURN(window != nullptr,); - - [window addChildWindow:mWindow - ordered:NSWindowAbove]; - [mWindow makeKeyWindow]; + [mWindow orderWindow:NSWindowBelow relativeTo:window]; #else XSetTransientForHint(xDisplay, xWindow, static_cast< ::Window>(winId)); #endif diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index 722bbc4b7..fd6036667 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -443,8 +443,7 @@ public: CocoaPluginUI(Callback* const cb, const uintptr_t parentId, const bool isResizable) noexcept : CarlaPluginUI(cb, isResizable), fView(nullptr), - fWindow(0), - fParentId(parentId) + fWindow(0) { [NSAutoreleasePool new]; [NSApplication sharedApplication]; @@ -495,9 +494,6 @@ public: [fView setHidden:NO]; [fWindow setIsVisible:YES]; - - if (fParentId != 0) - setTransientWinId(fParentId); } void hide() override @@ -562,9 +558,7 @@ public: NSWindow* window = [NSApp windowWithWindowNumber:winId]; CARLA_SAFE_ASSERT_RETURN(window != nullptr,); - [window addChildWindow:fWindow - ordered:NSWindowAbove]; - [fWindow makeKeyWindow]; + [fWindow orderWindow:NSWindowBelow relativeTo:window]; } void setChildWindow(void* const winId) override @@ -585,7 +579,6 @@ public: private: NSView* fView; id fWindow; - uintptr_t fParentId; CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CocoaPluginUI) }; @@ -769,7 +762,7 @@ public: { CARLA_SAFE_ASSERT_RETURN(fWindow != 0,); - // TODO + SetWindowLongPtr(fWindow, GWLP_HWNDPARENT, (LONG_PTR)winId); } void setChildWindow(void* const winId) override From a1faf839533ab2d217b92b6f67a117baa7f9a9cc Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 12:36:19 +0100 Subject: [PATCH 05/37] Win32: center plugin UIs when opening them --- source/modules/dgl/src/Window.cpp | 43 ++++++++++++++++++++++++++----- source/utils/CarlaPluginUI.cpp | 31 +++++++++++++++++++--- 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/source/modules/dgl/src/Window.cpp b/source/modules/dgl/src/Window.cpp index f2d353b2c..723476c15 100644 --- a/source/modules/dgl/src/Window.cpp +++ b/source/modules/dgl/src/Window.cpp @@ -87,7 +87,8 @@ struct Window::PrivateData { fWidgets(), fModal(), #if defined(DISTRHO_OS_WINDOWS) - hwnd(0) + hwnd(nullptr), + hwndParent(nullptr) #elif defined(DISTRHO_OS_MAC) fNeedsIdle(true), mView(nullptr), @@ -115,7 +116,8 @@ struct Window::PrivateData { fWidgets(), fModal(parent.pData), #if defined(DISTRHO_OS_WINDOWS) - hwnd(0) + hwnd(nullptr), + hwndParent(nullptr) #elif defined(DISTRHO_OS_MAC) fNeedsIdle(false), mView(nullptr), @@ -132,7 +134,8 @@ struct Window::PrivateData { // NOTE: almost a 1:1 copy of setTransientWinId() #if defined(DISTRHO_OS_WINDOWS) - SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)parentImpl->hwnd); + hwndParent = parentImpl->hwnd; + SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)hwndParent); #elif defined(DISTRHO_OS_MAC) [mWindow orderWindow:NSWindowBelow relativeTo:parentImpl->window]; #else @@ -154,7 +157,8 @@ struct Window::PrivateData { fWidgets(), fModal(), #if defined(DISTRHO_OS_WINDOWS) - hwnd(0) + hwnd(nullptr), + hwndParent(nullptr) #elif defined(DISTRHO_OS_MAC) fNeedsIdle(parentId == 0), mView(nullptr), @@ -434,9 +438,34 @@ struct Window::PrivateData { #if defined(DISTRHO_OS_WINDOWS) if (yesNo) - ShowWindow(hwnd, fFirstInit ? SW_SHOWNORMAL : SW_RESTORE); + { + if (fFirstInit) + { + RECT rectChild, rectParent; + + if (hwndParent != nullptr && + GetWindowRect(hwnd, &rectChild) && + GetWindowRect(hwndParent, &rectParent)) + { + SetWindowPos(hwnd, hwndParent, + rectParent.left + (rectChild.right-rectChild.left)/2, + rectParent.top + (rectChild.bottom-rectChild.top)/2, + 0, 0, SWP_SHOWWINDOW|SWP_NOSIZE); + } + else + { + ShowWindow(hwnd, SW_SHOWNORMAL); + } + } + else + { + ShowWindow(hwnd, SW_RESTORE); + } + } else + { ShowWindow(hwnd, SW_HIDE); + } UpdateWindow(hwnd); #elif defined(DISTRHO_OS_MAC) @@ -624,6 +653,7 @@ struct Window::PrivateData { DISTRHO_SAFE_ASSERT_RETURN(winId != 0,); #if defined(DISTRHO_OS_WINDOWS) + hwndParent = (HWND)winId; SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)winId); #elif defined(DISTRHO_OS_MAC) NSWindow* const window = [NSApp windowWithWindowNumber:winId]; @@ -979,7 +1009,8 @@ struct Window::PrivateData { } fModal; #if defined(DISTRHO_OS_WINDOWS) - HWND hwnd; + HWND hwnd; + HWND hwndParent; #elif defined(DISTRHO_OS_MAC) bool fNeedsIdle; PuglOpenGLView* mView; diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index fd6036667..53fd3525b 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -599,7 +599,8 @@ class WindowsPluginUI : public CarlaPluginUI public: WindowsPluginUI(Callback* const cb, const uintptr_t parentId, const bool isResizable) noexcept : CarlaPluginUI(cb, isResizable), - fWindow(0), + fWindow(nullptr), + fParentWindow(nullptr), fIsVisible(false), fFirstShow(true) { @@ -668,9 +669,31 @@ public: { CARLA_SAFE_ASSERT_RETURN(fWindow != 0,); - ShowWindow(fWindow, fFirstShow ? SW_SHOWNORMAL : SW_RESTORE); + if (fFirstShow) + { + fFirstShow = false; + RECT rectChild, rectParent; + + if (fParentWindow != nullptr && + GetWindowRect(fWindow, &rectChild) && + GetWindowRect(fParentWindow, &rectParent)) + { + SetWindowPos(fWindow, fParentWindow, + rectParent.left + (rectChild.right-rectChild.left)/2, + rectParent.top + (rectChild.bottom-rectChild.top)/2, + 0, 0, SWP_SHOWWINDOW|SWP_NOSIZE); + } + else + { + ShowWindow(fWindow, SW_SHOWNORMAL); + } + } + else + { + ShowWindow(fWindow, SW_RESTORE); + } + fIsVisible = true; - fFirstShow = false; UpdateWindow(fWindow); } @@ -762,6 +785,7 @@ public: { CARLA_SAFE_ASSERT_RETURN(fWindow != 0,); + fParentWindow = (HWND)winId; SetWindowLongPtr(fWindow, GWLP_HWNDPARENT, (LONG_PTR)winId); } @@ -782,6 +806,7 @@ public: private: HWND fWindow; + HWND fParentWindow; WNDCLASS fWindowClass; bool fIsVisible; From ca5df4f15182a59c30b39a013d31df8fd366fd92 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 13:03:36 +0100 Subject: [PATCH 06/37] Implement transient windows (out of process) for win32 --- source/backend/plugin/CarlaPlugin.cpp | 6 +++- source/backend/plugin/CarlaPluginInternal.cpp | 1 + source/backend/plugin/CarlaPluginInternal.hpp | 1 + .../bridges-ui/CarlaBridgeToolkitNative.cpp | 3 +- source/modules/dgl/src/Window.cpp | 16 --------- source/utils/CarlaPluginUI.cpp | 35 +++++++++++++++++-- 6 files changed, 41 insertions(+), 21 deletions(-) diff --git a/source/backend/plugin/CarlaPlugin.cpp b/source/backend/plugin/CarlaPlugin.cpp index 72396148c..fc5e24bea 100644 --- a/source/backend/plugin/CarlaPlugin.cpp +++ b/source/backend/plugin/CarlaPlugin.cpp @@ -2210,8 +2210,12 @@ void CarlaPlugin::uiIdle() CarlaString uiTitle(pData->name); uiTitle += " (GUI)"; - if (CarlaPluginUI::tryTransientWinIdMatch(getUiBridgeProcessId(), uiTitle, pData->engine->getOptions().frontendWinId, true)) + if (CarlaPluginUI::tryTransientWinIdMatch(getUiBridgeProcessId(), uiTitle, + pData->engine->getOptions().frontendWinId, pData->transientFirstTry)) + { pData->transientTryCounter = 0; + pData->transientFirstTry = false; + } } void CarlaPlugin::uiParameterChange(const uint32_t index, const float value) noexcept diff --git a/source/backend/plugin/CarlaPluginInternal.cpp b/source/backend/plugin/CarlaPluginInternal.cpp index f33815227..f04eff34d 100644 --- a/source/backend/plugin/CarlaPluginInternal.cpp +++ b/source/backend/plugin/CarlaPluginInternal.cpp @@ -592,6 +592,7 @@ CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx ctrlChannel(0), extraHints(0x0), transientTryCounter(0), + transientFirstTry(true), name(nullptr), filename(nullptr), iconName(nullptr), diff --git a/source/backend/plugin/CarlaPluginInternal.hpp b/source/backend/plugin/CarlaPluginInternal.hpp index 8a9a14169..840c0f64e 100644 --- a/source/backend/plugin/CarlaPluginInternal.hpp +++ b/source/backend/plugin/CarlaPluginInternal.hpp @@ -228,6 +228,7 @@ struct CarlaPlugin::ProtectedData { int8_t ctrlChannel; uint extraHints; uint transientTryCounter; + bool transientFirstTry; // data 1 const char* name; diff --git a/source/bridges-ui/CarlaBridgeToolkitNative.cpp b/source/bridges-ui/CarlaBridgeToolkitNative.cpp index 1f8293f86..280a2e190 100644 --- a/source/bridges-ui/CarlaBridgeToolkitNative.cpp +++ b/source/bridges-ui/CarlaBridgeToolkitNative.cpp @@ -68,8 +68,7 @@ public: fHostUI->setTitle(options.windowTitle.buffer()); -#ifdef HAVE_X11 - // Out-of-process reparenting only possible on X11 +#if (defined(CARLA_OS_WIN) && defined(BRIDGE_HWND)) || (defined(HAVE_X11) && defined(BRIDGE_X11)) if (options.transientWindowId != 0) { fHostUI->setTransientWinId(options.transientWindowId); diff --git a/source/modules/dgl/src/Window.cpp b/source/modules/dgl/src/Window.cpp index 723476c15..53f9a29a6 100644 --- a/source/modules/dgl/src/Window.cpp +++ b/source/modules/dgl/src/Window.cpp @@ -346,22 +346,6 @@ struct Window::PrivateData { fModal.enabled = true; fModal.parent->fModal.childFocus = this; -#ifdef DISTRHO_OS_WINDOWS - // Center this window - PuglInternals* const parentImpl = fModal.parent->fView->impl; - - RECT curRect; - RECT parentRect; - GetWindowRect(hwnd, &curRect); - GetWindowRect(parentImpl->hwnd, &parentRect); - - int x = parentRect.left+(parentRect.right-curRect.right)/2; - int y = parentRect.top +(parentRect.bottom-curRect.bottom)/2; - - SetWindowPos(hwnd, 0, x, y, 0, 0, SWP_NOACTIVATE|SWP_NOOWNERZORDER|SWP_NOSIZE|SWP_NOZORDER); - UpdateWindow(hwnd); -#endif - fModal.parent->setVisible(true); setVisible(true); diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index 53fd3525b..a0e32b522 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -1046,10 +1046,41 @@ bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* cons XFlush(sd.display); return true; -#else +#endif + +#ifdef CARLA_OS_MAC + // TODO +#endif + +#ifdef CARLA_OS_WIN + if (HWND const childWindow = FindWindowA(nullptr, uiTitle)) + { + HWND const parentWindow = (HWND)winId; + SetWindowLongPtr(childWindow, GWLP_HWNDPARENT, (LONG_PTR)parentWindow); + + if (centerUI) + { + RECT rectChild, rectParent; + + if (GetWindowRect(childWindow, &rectChild) && GetWindowRect(parentWindow, &rectParent)) + { + SetWindowPos(childWindow, parentWindow, + rectParent.left + (rectChild.right-rectChild.left)/2, + rectParent.top + (rectChild.bottom-rectChild.top)/2, + 0, 0, SWP_NOSIZE); + } + } + + carla_stdout("Match found using window name"); + return true; + } + + return false; +#endif + + // fallback, may be unused return true; (void)pid; (void)centerUI; -#endif } // ----------------------------------------------------- From 3af13e7d52b3b8009fadd88c1b334c6123d95503 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 12:05:18 +0000 Subject: [PATCH 07/37] Patch qt for newer mac fix --- data/macos/build-deps.sh | 68 +++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/data/macos/build-deps.sh b/data/macos/build-deps.sh index f638e854a..64c991428 100755 --- a/data/macos/build-deps.sh +++ b/data/macos/build-deps.sh @@ -4,12 +4,12 @@ # automake, autoconf, bison, flex, libtool # p5-libxml-perl, p5-xml-libxml, p7zip, pkgconfig -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # stop on error set -e -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # cd to correct path if [ -f Makefile ]; then @@ -21,7 +21,7 @@ fi source common.env -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # function to remove old stuff cleanup() @@ -59,7 +59,7 @@ exit 0 } -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # function to build base libs build_base() @@ -79,7 +79,7 @@ export CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden" export LDFLAGS="-fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs" export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib -m${ARCH}" -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # pkgconfig if [ ! -d pkg-config-${PKG_CONFIG_VERSION} ]; then @@ -97,7 +97,7 @@ if [ ! -f pkg-config-${PKG_CONFIG_VERSION}_$ARCH/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # liblo if [ ! -d liblo-${LIBLO_VERSION} ]; then @@ -117,13 +117,13 @@ if [ ! -f liblo-${LIBLO_VERSION}_$ARCH/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- if [ x"${ARCH}" = x"32" ]; then return fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # file/magic if [ ! -d file-${FILE_VERSION} ]; then @@ -140,7 +140,7 @@ if [ ! -f file-${FILE_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # libogg if [ ! -d libogg-${LIBOGG_VERSION} ]; then @@ -157,7 +157,7 @@ if [ ! -f libogg-${LIBOGG_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # libvorbis if [ ! -d libvorbis-${LIBVORBIS_VERSION} ]; then @@ -174,7 +174,7 @@ if [ ! -f libvorbis-${LIBVORBIS_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # flac if [ ! -d flac-${FLAC_VERSION} ]; then @@ -194,7 +194,7 @@ if [ ! -f flac-${FLAC_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # libsndfile if [ ! -d libsndfile-${LIBSNDFILE_VERSION} ]; then @@ -212,7 +212,7 @@ if [ ! -f libsndfile-${LIBSNDFILE_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # libgig if [ ! -d libgig-${LIBGIG_VERSION} ]; then @@ -233,7 +233,7 @@ if [ ! -f libgig-${LIBGIG_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # linuxsampler if [ ! -d linuxsampler-${LINUXSAMPLER_VERSION} ]; then @@ -249,8 +249,6 @@ if [ ! -f linuxsampler-${LINUXSAMPLER_VERSION}/build-done ]; then sed -i -e "s|HAVE_AU|HAVE_VST|" src/hostplugins/Makefile.am touch patched fi - #rm -f configure - #env PATH=/opt/local/bin:$PATH make -f Makefile.svn configure env PATH=/opt/local/bin:$PATH /opt/local/bin/aclocal -I /opt/local/share/aclocal env PATH=/opt/local/bin:$PATH /opt/local/bin/glibtoolize --force --copy env PATH=/opt/local/bin:$PATH /opt/local/bin/autoheader @@ -272,7 +270,7 @@ if [ ! -f linuxsampler-${LINUXSAMPLER_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # libffi if [ ! -d libffi-${LIBFFI_VERSION} ]; then @@ -289,7 +287,7 @@ if [ ! -f libffi-${LIBFFI_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # gettext if [ ! -d gettext-${GETTEXT_VERSION} ]; then @@ -306,7 +304,7 @@ if [ ! -f gettext-${GETTEXT_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # glib if [ ! -d glib-${GLIB_VERSION} ]; then @@ -329,7 +327,7 @@ if [ ! -f glib-${GLIB_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # fluidsynth if [ ! -d fluidsynth-${FLUIDSYNTH_VERSION} ]; then @@ -355,7 +353,7 @@ fi } -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # build base libs export ARCH=32 @@ -364,7 +362,7 @@ build_base export ARCH=64 build_base -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # set flags for qt stuff export PREFIX=${TARGETDIR}/carla @@ -381,7 +379,7 @@ export MAKE=/usr/bin/make export CFG_ARCH=x86_64 export QMAKESPEC=macx-clang -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # qt5-base download if [ ! -d qtbase-opensource-src-${QT5_VERSION} ]; then @@ -390,13 +388,17 @@ if [ ! -d qtbase-opensource-src-${QT5_VERSION} ]; then /opt/local/bin/7z x qtbase-opensource-src-${QT5_VERSION}.tar fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # qt5-base (64bit, shared, framework) if [ ! -f qtbase-opensource-src-${QT5_VERSION}/build-done ]; then cd qtbase-opensource-src-${QT5_VERSION} if [ ! -f configured ]; then - sed -i -e "s|AWK=.*|AWK=/opt/local/bin/gawk|" configure + if [ ! -f carla-patched ]; then + sed -i -e "s|AWK=.*|AWK=/opt/local/bin/gawk|" configure + patch -p1 -i ../patches/qt55-newosx-fix.patch + touch carla-patched + fi chmod +x configure chmod -R 777 config.tests/unix/ ./configure -release -shared -opensource -confirm-license -force-pkg-config -platform macx-clang -framework \ @@ -462,7 +464,7 @@ QT59_ARGS="./configure -prefix ${PREFIX} -plugindir ${PREFIX}/lib/qt5/plugins -h -qt-sqlite " -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # qt5-mac-extras if [ ! -d qtmacextras-opensource-src-${QT5_VERSION} ]; then @@ -480,7 +482,7 @@ if [ ! -f qtmacextras-opensource-src-${QT5_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # qt5-svg if [ ! -d qtsvg-opensource-src-${QT5_VERSION} ]; then @@ -498,7 +500,7 @@ if [ ! -f qtsvg-opensource-src-${QT5_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # python if [ ! -d Python-${PYTHON_VERSION} ]; then @@ -515,7 +517,7 @@ if [ ! -f Python-${PYTHON_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # sip if [ ! -d sip-${SIP_VERSION} ]; then @@ -532,7 +534,7 @@ if [ ! -f sip-${SIP_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # pyqt5 if [ ! -d PyQt-gpl-${PYQT5_VERSION} ]; then @@ -549,7 +551,7 @@ if [ ! -f PyQt-gpl-${PYQT5_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # pyliblo if [ ! -d pyliblo-${PYLIBLO_VERSION} ]; then @@ -566,7 +568,7 @@ if [ ! -f pyliblo-${PYLIBLO_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # cxfreeze if [ ! -d cx_Freeze-${CXFREEZE_VERSION} ]; then @@ -583,4 +585,4 @@ if [ ! -f cx_Freeze-${CXFREEZE_VERSION}/build-done ]; then cd .. fi -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- From 77ed8989bf5e0aa99f997085941977d7d52f4bd8 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 12:21:17 +0000 Subject: [PATCH 08/37] Fix transient window on osx (and fixes build) --- source/modules/dgl/src/Window.cpp | 11 +++++++---- source/utils/CarlaPluginUI.cpp | 7 ++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/source/modules/dgl/src/Window.cpp b/source/modules/dgl/src/Window.cpp index 53f9a29a6..fea2c1eba 100644 --- a/source/modules/dgl/src/Window.cpp +++ b/source/modules/dgl/src/Window.cpp @@ -137,7 +137,8 @@ struct Window::PrivateData { hwndParent = parentImpl->hwnd; SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)hwndParent); #elif defined(DISTRHO_OS_MAC) - [mWindow orderWindow:NSWindowBelow relativeTo:parentImpl->window]; + [parentImpl->window addChildWindow:mWindow + ordered:NSWindowAbove]; #else XSetTransientForHint(xDisplay, xWindow, parentImpl->win); #endif @@ -640,9 +641,11 @@ struct Window::PrivateData { hwndParent = (HWND)winId; SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)winId); #elif defined(DISTRHO_OS_MAC) - NSWindow* const window = [NSApp windowWithWindowNumber:winId]; - DISTRHO_SAFE_ASSERT_RETURN(window != nullptr,); - [mWindow orderWindow:NSWindowBelow relativeTo:window]; + NSWindow* const parentWindow = [NSApp windowWithWindowNumber:winId]; + DISTRHO_SAFE_ASSERT_RETURN(parentWindow != nullptr,); + + [parentWindow addChildWindow:mWindow + ordered:NSWindowAbove]; #else XSetTransientForHint(xDisplay, xWindow, static_cast< ::Window>(winId)); #endif diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index a0e32b522..c8b73d8d4 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -555,10 +555,11 @@ public: { CARLA_SAFE_ASSERT_RETURN(fWindow != 0,); - NSWindow* window = [NSApp windowWithWindowNumber:winId]; - CARLA_SAFE_ASSERT_RETURN(window != nullptr,); + NSWindow* const parentWindow = [NSApp windowWithWindowNumber:winId]; + CARLA_SAFE_ASSERT_RETURN(parentWindow != nullptr,); - [fWindow orderWindow:NSWindowBelow relativeTo:window]; + [parentWindow addChildWindow:fWindow + ordered:NSWindowAbove]; } void setChildWindow(void* const winId) override From 846cd15e00b502e1eff52e47fd179666adbac3dd Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 14:47:52 +0000 Subject: [PATCH 09/37] Implement try-transient for osx, partially (whatever is possible) --- source/utils/CarlaPluginUI.cpp | 49 +++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index c8b73d8d4..970b53f01 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -1050,7 +1050,54 @@ bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* cons #endif #ifdef CARLA_OS_MAC - // TODO + uint const hints = kCGWindowListOptionOnScreenOnly|kCGWindowListExcludeDesktopElements; + + CFArrayRef const windowListRef = CGWindowListCopyWindowInfo(hints, kCGNullWindowID); + const NSArray* const windowList = (const NSArray*)windowListRef; + + int windowToMap, windowWithPID = 0, windowWithNameAndPID = 0; + + for (NSDictionary* const entry in windowList) + { + if ([entry[(id)kCGWindowSharingState] intValue] == kCGWindowSharingNone) + continue; + + NSString* const windowName = entry[(id)kCGWindowName]; + int const windowNumber = [entry[(id)kCGWindowNumber] intValue]; + uintptr_t const windowPID = [entry[(id)kCGWindowOwnerPID] intValue]; + + if (windowPID != pid) + continue; + + windowWithPID = windowNumber; + + if (windowName != nullptr && std::strcmp([windowName UTF8String], uiTitle) == 0) + windowWithNameAndPID = windowNumber; + } + + CFRelease(windowListRef); + + if (windowWithNameAndPID != 0) + { + carla_stdout("Match found using pid and name"); + windowToMap = windowWithNameAndPID; + } + else if (windowWithPID != 0) + { + carla_stdout("Match found using pid"); + windowToMap = windowWithPID; + } + else + { + return false; + } + + NSWindow* const parentWindow = [NSApp windowWithWindowNumber:winId]; + CARLA_SAFE_ASSERT_RETURN(parentWindow != nullptr, false); + + [parentWindow orderWindow:NSWindowBelow + relativeTo:windowToMap]; + return true; #endif #ifdef CARLA_OS_WIN From 54094ef99515aaf0238f86234b07a3e6cb475991 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 14:59:44 +0000 Subject: [PATCH 10/37] Build our obj-c code with different class names per build target --- source/backend/CarlaStandalone.cpp | 3 ++- source/backend/engine/CarlaEngineNative.cpp | 3 ++- source/bridges-ui/CarlaBridgeToolkitNative.cpp | 3 ++- source/utils/CarlaPluginUI.cpp | 12 +++++++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/source/backend/CarlaStandalone.cpp b/source/backend/CarlaStandalone.cpp index 72ff5e778..c3f2ed6af 100644 --- a/source/backend/CarlaStandalone.cpp +++ b/source/backend/CarlaStandalone.cpp @@ -1,6 +1,6 @@ /* * Carla Standalone - * Copyright (C) 2011-2017 Filipe Coelho + * Copyright (C) 2011-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -1998,6 +1998,7 @@ const char* carla_get_host_osc_url_udp() // ------------------------------------------------------------------------------------------------------------------- +#define CARLA_PLUGIN_UI_CLASS_PREFIX Standalone #include "CarlaPluginUI.cpp" #include "CarlaDssiUtils.cpp" #include "CarlaPatchbayUtils.cpp" diff --git a/source/backend/engine/CarlaEngineNative.cpp b/source/backend/engine/CarlaEngineNative.cpp index 1766a2ca9..52f837bf3 100644 --- a/source/backend/engine/CarlaEngineNative.cpp +++ b/source/backend/engine/CarlaEngineNative.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2017 Filipe Coelho + * Copyright (C) 2011-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -2323,6 +2323,7 @@ const EngineDriverDeviceInfo* CarlaEngine::getRtAudioDeviceInfo(const uint, cons CARLA_BACKEND_END_NAMESPACE +#define CARLA_PLUGIN_UI_CLASS_PREFIX EngineNative #include "CarlaHostCommon.cpp" #include "CarlaPluginUI.cpp" #include "CarlaDssiUtils.cpp" diff --git a/source/bridges-ui/CarlaBridgeToolkitNative.cpp b/source/bridges-ui/CarlaBridgeToolkitNative.cpp index 280a2e190..cbd859919 100644 --- a/source/bridges-ui/CarlaBridgeToolkitNative.cpp +++ b/source/bridges-ui/CarlaBridgeToolkitNative.cpp @@ -1,6 +1,6 @@ /* * Carla Bridge UI - * Copyright (C) 2014-2017 Filipe Coelho + * Copyright (C) 2014-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -224,6 +224,7 @@ CarlaBridgeToolkit* CarlaBridgeToolkit::createNew(CarlaBridgeFormat* const forma CARLA_BRIDGE_UI_END_NAMESPACE +#define CARLA_PLUGIN_UI_CLASS_PREFIX ToolkitNative #include "CarlaPluginUI.cpp" // ------------------------------------------------------------------------- diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index 970b53f01..d3c6fc697 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin UI - * Copyright (C) 2014-2017 Filipe Coelho + * Copyright (C) 2014-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -33,6 +33,10 @@ # include #endif +#ifndef CARLA_PLUGIN_UI_CLASS_PREFIX +# error CARLA_PLUGIN_UI_CLASS_PREFIX undefined +#endif + // --------------------------------------------------------------------------------------------------------------------- // X11 @@ -359,6 +363,12 @@ private: #ifdef CARLA_OS_MAC +#ifdef BUILD_BRIDGE +# define CarlaPluginWindow CarlaPluginWindowBridged ## CARLA_PLUGIN_UI_CLASS_PREFIX ## CARLA_VERSION_HEX +#else +# define CarlaPluginWindow CarlaPluginWindow ## CARLA_PLUGIN_UI_CLASS_PREFIX ## CARLA_VERSION_HEX +#endif + @interface CarlaPluginWindow : NSWindow { @public From f601258934cf0e066b61ae3cf7d68fddde3fd411 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 15:10:09 +0000 Subject: [PATCH 11/37] Fix previous commit --- source/utils/CarlaPluginUI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index d3c6fc697..f529d9261 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -364,9 +364,9 @@ private: #ifdef CARLA_OS_MAC #ifdef BUILD_BRIDGE -# define CarlaPluginWindow CarlaPluginWindowBridged ## CARLA_PLUGIN_UI_CLASS_PREFIX ## CARLA_VERSION_HEX +# define CarlaPluginWindow CARLA_JOIN_MACRO(CarlaPluginWindowBridged, CARLA_PLUGIN_UI_CLASS_PREFIX) #else -# define CarlaPluginWindow CarlaPluginWindow ## CARLA_PLUGIN_UI_CLASS_PREFIX ## CARLA_VERSION_HEX +# define CarlaPluginWindow CARLA_JOIN_MACRO(CarlaPluginWindow, CARLA_PLUGIN_UI_CLASS_PREFIX) #endif @interface CarlaPluginWindow : NSWindow From 47f165663962a38bb9a3a1abee7239004d1a9bb8 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 15:24:11 +0000 Subject: [PATCH 12/37] Export only main functions for LV2 plugin in macOS --- source/plugin/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/plugin/Makefile b/source/plugin/Makefile index 0466d95f8..eb62aa1d4 100644 --- a/source/plugin/Makefile +++ b/source/plugin/Makefile @@ -81,6 +81,12 @@ LINK_FLAGS += $(LINUXSAMPLER_LIBS) LINK_FLAGS += $(MAGIC_LIBS) LINK_FLAGS += $(X11_LIBS) +ifeq ($(MACOS),true) +# NOTE: this assumes only LV2 version will be built +SHARED += -Wl,-exported_symbol,_lv2_descriptor +SHARED += -Wl,-exported_symbol,_lv2ui_descriptor +endif + # ---------------------------------------------------------------------------------------------------------------------------- TARGETS = \ From 27b52fe5a5de9e2bbfde5ea04fbf6b0c8818e74e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 16:34:31 +0100 Subject: [PATCH 13/37] Enable manage-ui option under all OSes --- source/carla_settings.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/carla_settings.py b/source/carla_settings.py index 3faeaa923..f431b7a9d 100755 --- a/source/carla_settings.py +++ b/source/carla_settings.py @@ -243,10 +243,6 @@ class CarlaSettingsW(QDialog): self.ui.ch_main_show_logs.setEnabled(False) self.ui.ch_main_show_logs.setVisible(False) - if WINDOWS: - self.ui.ch_engine_manage_uis.setEnabled(False) - self.ui.ch_engine_manage_uis.setVisible(False) - if host.isControl: self.ui.lw_page.hideRow(self.TAB_INDEX_CANVAS) self.ui.lw_page.hideRow(self.TAB_INDEX_ENGINE) @@ -292,6 +288,8 @@ class CarlaSettingsW(QDialog): self.ui.ch_engine_prefer_ui_bridges.setChecked(False) self.ui.ch_engine_prefer_ui_bridges.setEnabled(False) self.ui.ch_engine_prefer_ui_bridges.setVisible(False) + self.ui.label_engine_ui_bridges_timeout.setEnabled(False) + self.ui.label_engine_ui_bridges_timeout.setVisible(False) self.ui.sb_engine_ui_bridges_timeout.setEnabled(False) self.ui.sb_engine_ui_bridges_timeout.setVisible(False) From 67dfa9ae14aad68e918cd2ebacab1121eb18e7f8 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 16:41:45 +0100 Subject: [PATCH 14/37] Improve some small disabled logic in the settings page --- resources/ui/carla_settings.ui | 21 ++++++++++++++++++++- source/carla_settings.py | 14 ++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/resources/ui/carla_settings.ui b/resources/ui/carla_settings.ui index d997e6c84..21936d4d8 100644 --- a/resources/ui/carla_settings.ui +++ b/resources/ui/carla_settings.ui @@ -924,7 +924,7 @@ - + How much time to wait for OSC GUIs to ping back the host @@ -1893,6 +1893,9 @@ This mode is not available for VST plugins. + + false + Whenever possible, run the plugins in bridge mode. @@ -2085,5 +2088,21 @@ This mode is not available for VST plugins. + + cb_exp_plugin_bridges + toggled(bool) + ch_engine_prefer_plugin_bridges + setEnabled(bool) + + + 402 + 145 + + + 402 + 433 + + + diff --git a/source/carla_settings.py b/source/carla_settings.py index f431b7a9d..522349dae 100755 --- a/source/carla_settings.py +++ b/source/carla_settings.py @@ -326,8 +326,10 @@ class CarlaSettingsW(QDialog): self.ui.ch_main_experimental.toggled.connect(self.slot_enableExperimental) self.ui.ch_exp_wine_bridges.toggled.connect(self.slot_enableWineBridges) + self.ui.cb_exp_plugin_bridges.toggled.connect(self.slot_pluginBridgesToggled) self.ui.cb_canvas_eyecandy.toggled.connect(self.slot_canvasEyeCandyToggled) self.ui.cb_canvas_fancy_eyecandy.toggled.connect(self.slot_canvasFancyEyeCandyToggled) + self.ui.cb_canvas_use_opengl.toggled.connect(self.slot_canvasOpenGLToggled) # ---------------------------------------------------------------------------------------------------- # Post-connect setup @@ -860,6 +862,13 @@ class CarlaSettingsW(QDialog): else: self.ui.lw_page.hideRow(self.TAB_INDEX_WINE) + @pyqtSlot(bool) + def slot_pluginBridgesToggled(self, toggled): + if not toggled: + self.ui.ch_exp_wine_bridges.setChecked(False) + self.ui.ch_engine_prefer_plugin_bridges.setChecked(False) + self.ui.lw_page.hideRow(self.TAB_INDEX_WINE) + @pyqtSlot(bool) def slot_canvasEyeCandyToggled(self, toggled): if not toggled: @@ -870,6 +879,11 @@ class CarlaSettingsW(QDialog): if toggled: self.ui.cb_canvas_eyecandy.setChecked(True) + @pyqtSlot(bool) + def slot_canvasOpenGLToggled(self, toggled): + if not toggled: + self.ui.cb_canvas_render_hq_aa.setChecked(False) + # -------------------------------------------------------------------------------------------------------- @pyqtSlot() From 3d83d6d810b13cf9e8d965da1d70a198d1ebb72c Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 16:50:48 +0100 Subject: [PATCH 15/37] Add note in settings regarding UIs in plugin bridges for macOS --- resources/ui/carla_settings.ui | 21 ++++++++++++++------- source/carla_settings.py | 3 +++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/resources/ui/carla_settings.ui b/resources/ui/carla_settings.ui index 21936d4d8..587a1ab6d 100644 --- a/resources/ui/carla_settings.ui +++ b/resources/ui/carla_settings.ui @@ -708,7 +708,7 @@ - + 2 @@ -989,6 +989,13 @@ + + + + NOTE: Plugin-bridge UIs cannot be managed by Carla on macOS + + + @@ -1006,9 +1013,9 @@ - + - + Qt::Horizontal @@ -1021,7 +1028,7 @@ - + 22 @@ -1040,14 +1047,14 @@ - + Restart the engine to load the new settings - + Qt::Horizontal @@ -1069,7 +1076,7 @@ 20 - 225 + 300 diff --git a/source/carla_settings.py b/source/carla_settings.py index 522349dae..b236e8dfa 100755 --- a/source/carla_settings.py +++ b/source/carla_settings.py @@ -283,6 +283,9 @@ class CarlaSettingsW(QDialog): self.ui.ch_exp_prevent_bad_behaviour.setVisible(False) self.ui.lw_page.hideRow(self.TAB_INDEX_WINE) + if not MACOS: + self.ui.label_engine_ui_bridges_mac_note.setVisible(False) + # FIXME, pipes on win32 not working, and mis-behaving on macOS if MACOS or WINDOWS: self.ui.ch_engine_prefer_ui_bridges.setChecked(False) From 7e912fc22a525d275eb553a1b716e3d74ea75f66 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 16:57:48 +0100 Subject: [PATCH 16/37] Adjust settings size on init --- resources/ui/carla_settings.ui | 2 +- source/carla_settings.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/ui/carla_settings.ui b/resources/ui/carla_settings.ui index 587a1ab6d..091fd58fc 100644 --- a/resources/ui/carla_settings.ui +++ b/resources/ui/carla_settings.ui @@ -7,7 +7,7 @@ 0 0 612 - 587 + 507 diff --git a/source/carla_settings.py b/source/carla_settings.py index b236e8dfa..8c4a74c3c 100755 --- a/source/carla_settings.py +++ b/source/carla_settings.py @@ -347,6 +347,8 @@ class CarlaSettingsW(QDialog): self.ui.lw_page.setCurrentCell(0, 0) + self.adjustSize() + # -------------------------------------------------------------------------------------------------------- def loadSettings(self): From ffd2facd1929e237bb6287cc2d95e5076f903c23 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 17:18:50 +0100 Subject: [PATCH 17/37] Fix warning building extra plugins on win/mac --- source/native-plugins/external/Makefile.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/native-plugins/external/Makefile.mk b/source/native-plugins/external/Makefile.mk index 74b0cd86a..296db656a 100644 --- a/source/native-plugins/external/Makefile.mk +++ b/source/native-plugins/external/Makefile.mk @@ -98,7 +98,9 @@ endif DPF_FLAGS = -I$(CWDE)/modules/distrho ifeq ($(HAVE_DGL),true) +ifneq ($(MACOS_OR_WIN32),true) DPF_FLAGS += $(shell pkg-config --cflags gl) +endif DPF_FLAGS += -I$(CWDE)/modules/dgl -DDGL_NAMESPACE=CarlaDGL -DDGL_FILE_BROWSER_DISABLED -DDGL_NO_SHARED_RESOURCES endif From c9bc09a0bd032ce4cbbe6a337829bbfb0a428910 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 16:37:09 +0000 Subject: [PATCH 18/37] DGL only set osx child window when parent becomes visible --- source/modules/dgl/src/Window.cpp | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/source/modules/dgl/src/Window.cpp b/source/modules/dgl/src/Window.cpp index fea2c1eba..cb848067a 100644 --- a/source/modules/dgl/src/Window.cpp +++ b/source/modules/dgl/src/Window.cpp @@ -92,7 +92,8 @@ struct Window::PrivateData { #elif defined(DISTRHO_OS_MAC) fNeedsIdle(true), mView(nullptr), - mWindow(nullptr) + mWindow(nullptr), + mParentWindow(nullptr) #else xDisplay(nullptr), xWindow(0) @@ -121,7 +122,8 @@ struct Window::PrivateData { #elif defined(DISTRHO_OS_MAC) fNeedsIdle(false), mView(nullptr), - mWindow(nullptr) + mWindow(nullptr), + mParentWindow(nullptr) #else xDisplay(nullptr), xWindow(0) @@ -137,8 +139,7 @@ struct Window::PrivateData { hwndParent = parentImpl->hwnd; SetWindowLongPtr(hwnd, GWLP_HWNDPARENT, (LONG_PTR)hwndParent); #elif defined(DISTRHO_OS_MAC) - [parentImpl->window addChildWindow:mWindow - ordered:NSWindowAbove]; + mParentWindow = parentImpl->window; #else XSetTransientForHint(xDisplay, xWindow, parentImpl->win); #endif @@ -163,7 +164,8 @@ struct Window::PrivateData { #elif defined(DISTRHO_OS_MAC) fNeedsIdle(parentId == 0), mView(nullptr), - mWindow(nullptr) + mWindow(nullptr), + mParentWindow(nullptr) #else xDisplay(nullptr), xWindow(0) @@ -457,16 +459,31 @@ struct Window::PrivateData { if (yesNo) { if (mWindow != nullptr) + { + if (mParentWindow != nullptr) + [mParentWindow addChildWindow:mWindow + ordered:NSWindowAbove]; + [mWindow setIsVisible:YES]; + } else + { [mView setHidden:NO]; + } } else { if (mWindow != nullptr) + { + if (mParentWindow != nullptr) + [mParentWindow removeChildWindow:mWindow]; + [mWindow setIsVisible:NO]; + } else + { [mView setHidden:YES]; + } } #else if (yesNo) @@ -1002,6 +1019,7 @@ struct Window::PrivateData { bool fNeedsIdle; PuglOpenGLView* mView; id mWindow; + id mParentWindow; #else Display* xDisplay; ::Window xWindow; From 0029bf61dd0c57df237e774cc1d41b8af1ab8487 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 18:25:24 +0000 Subject: [PATCH 19/37] Build zlib, mxml and fftw3 for osx --- data/macos/build-deps.sh | 64 ++++++++++++++++++++++++++++++++++++++++ data/macos/common.env | 3 ++ 2 files changed, 67 insertions(+) diff --git a/data/macos/build-deps.sh b/data/macos/build-deps.sh index 64c991428..af590e5e8 100755 --- a/data/macos/build-deps.sh +++ b/data/macos/build-deps.sh @@ -351,6 +351,70 @@ if [ ! -f fluidsynth-${FLUIDSYNTH_VERSION}/build-done ]; then cd .. fi + +# ------------------------------------------------------------------------------------ +# zlib + +if [ ! -d zlib-${ZLIB_VERSION} ]; then + curl -L https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz -o zlib-${ZLIB_VERSION}.tar.gz + tar -xf zlib-${ZLIB_VERSION}.tar.gz +fi + +if [ ! -f zlib-${ZLIB_VERSION}/build-done ]; then + cd zlib-${ZLIB_VERSION} + ./configure --static --prefix=$PREFIX + make + make install + touch build-done + cd .. +fi + +# ------------------------------------------------------------------------------------ +# mxml + +if [ ! -d mxml-${MXML_VERSION} ]; then + curl -L https://github.com/michaelrsweet/mxml/releases/download/v${MXML_VERSION}/mxml-${MXML_VERSION}.tar.gz -o mxml-${MXML_VERSION}.tar.gz + mkdir mxml-${MXML_VERSION} + cd mxml-${MXML_VERSION} + tar -xf ../mxml-${MXML_VERSION}.tar.gz + cd .. +fi + +if [ ! -f mxml-${MXML_VERSION}/build-done ]; then + cd mxml-${MXML_VERSION} + ./configure --disable-shared --prefix=$PREFIX + make libmxml.a + cp *.a $PREFIX/lib/ + cp *.pc $PREFIX/lib/pkgconfig/ + cp mxml.h $PREFIX/include/ + touch build-done + cd .. +fi + +# --------------------------------------------------------------------------------------------------------------------- +# fftw3 (needs to be last as it modifies C[XX]FLAGS) + +if [ ! -d fftw-${FFTW3_VERSION} ]; then + curl -O http://www.fftw.org/fftw-${FFTW3_VERSION}.tar.gz + tar -xf fftw-${FFTW3_VERSION}.tar.gz +fi + +if [ ! -f fftw-${FFTW3_VERSION}/build-done ]; then + export CFLAGS="${CFLAGS} -ffast-math" + export CXXFLAGS="${CXXFLAGS} -ffast-math" + cd fftw-${FFTW3_VERSION} + ./configure --enable-static --enable-sse2 --disable-shared --disable-debug --prefix=$PREFIX + make + make install + make clean + ./configure --enable-static --enable-sse --enable-sse2 --enable-single --disable-shared --disable-debug --prefix=$PREFIX + make + make install + make clean + touch build-done + cd .. +fi + } # --------------------------------------------------------------------------------------------------------------------- diff --git a/data/macos/common.env b/data/macos/common.env index 21f8abe9c..11f27dfb2 100644 --- a/data/macos/common.env +++ b/data/macos/common.env @@ -15,6 +15,9 @@ GETTEXT_VERSION=0.18.3.2 GLIB_VERSION=2.44.1 GLIB_MVERSION=2.44 FLUIDSYNTH_VERSION=1.1.6 +ZLIB_VERSION=1.2.11 +MXML_VERSION=2.11 +FFTW3_VERSION=3.3.7 QT5_VERSION=5.5.1 QT5_MVERSION=5.5 PYTHON_VERSION=3.4.7 From 8f5de5e0fe39949c2f899d3db44a2b0ec81f4e60 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 18:43:03 +0000 Subject: [PATCH 20/37] Disable try-transient code in plugin bridges --- source/backend/plugin/CarlaPlugin.cpp | 2 ++ source/backend/plugin/CarlaPluginBridge.cpp | 6 +++++- source/backend/plugin/CarlaPluginDSSI.cpp | 6 +++++- source/backend/plugin/CarlaPluginInternal.cpp | 6 +++++- source/backend/plugin/CarlaPluginInternal.hpp | 4 +++- source/backend/plugin/CarlaPluginLV2.cpp | 4 ++++ source/backend/plugin/CarlaPluginNative.cpp | 6 +++++- source/utils/CarlaPluginUI.cpp | 2 ++ source/utils/CarlaPluginUI.hpp | 4 +++- 9 files changed, 34 insertions(+), 6 deletions(-) diff --git a/source/backend/plugin/CarlaPlugin.cpp b/source/backend/plugin/CarlaPlugin.cpp index fc5e24bea..6f5f95069 100644 --- a/source/backend/plugin/CarlaPlugin.cpp +++ b/source/backend/plugin/CarlaPlugin.cpp @@ -2198,6 +2198,7 @@ void CarlaPlugin::uiIdle() pData->postUiEvents.data.clear(); } +#ifndef BUILD_BRIDGE if (pData->transientTryCounter == 0) return; if (++pData->transientTryCounter % 10 != 0) @@ -2216,6 +2217,7 @@ void CarlaPlugin::uiIdle() pData->transientTryCounter = 0; pData->transientFirstTry = false; } +#endif } void CarlaPlugin::uiParameterChange(const uint32_t index, const float value) noexcept diff --git a/source/backend/plugin/CarlaPluginBridge.cpp b/source/backend/plugin/CarlaPluginBridge.cpp index 7e3e5ba25..3f2e2778e 100644 --- a/source/backend/plugin/CarlaPluginBridge.cpp +++ b/source/backend/plugin/CarlaPluginBridge.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin Bridge - * Copyright (C) 2011-2017 Filipe Coelho + * Copyright (C) 2011-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -391,9 +391,11 @@ public: { carla_debug("CarlaPluginBridge::~CarlaPluginBridge()"); +#ifndef BUILD_BRIDGE // close UI if (pData->hints & PLUGIN_HAS_CUSTOM_UI) pData->transientTryCounter = 0; +#endif pData->singleMutex.lock(); pData->masterMutex.lock(); @@ -2175,7 +2177,9 @@ public: break; case kPluginBridgeNonRtServerUiClosed: +#ifndef BUILD_BRIDGE pData->transientTryCounter = 0; +#endif pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0.0f, nullptr); break; diff --git a/source/backend/plugin/CarlaPluginDSSI.cpp b/source/backend/plugin/CarlaPluginDSSI.cpp index 1b9e567bc..a42de9b64 100644 --- a/source/backend/plugin/CarlaPluginDSSI.cpp +++ b/source/backend/plugin/CarlaPluginDSSI.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin, DSSI implementation - * Copyright (C) 2011-2017 Filipe Coelho + * Copyright (C) 2011-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -669,7 +669,9 @@ public: } else { +#ifndef BUILD_BRIDGE pData->transientTryCounter = 0; +#endif if (fOscData.target != nullptr) { @@ -2333,8 +2335,10 @@ public: for (uint32_t i=0; i < pData->param.count; ++i) osc_send_control(fOscData, pData->param.data[i].rindex, getParameterValue(i)); +#ifndef BUILD_BRIDGE if (pData->engine->getOptions().frontendWinId != 0) pData->transientTryCounter = 1; +#endif carla_stdout("CarlaPluginDSSI::updateOscData() - done"); } diff --git a/source/backend/plugin/CarlaPluginInternal.cpp b/source/backend/plugin/CarlaPluginInternal.cpp index f04eff34d..a8d8226bd 100644 --- a/source/backend/plugin/CarlaPluginInternal.cpp +++ b/source/backend/plugin/CarlaPluginInternal.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin - * Copyright (C) 2011-2014 Filipe Coelho + * Copyright (C) 2011-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -591,8 +591,10 @@ CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx uiLib(nullptr), ctrlChannel(0), extraHints(0x0), +#ifndef BUILD_BRIDGE transientTryCounter(0), transientFirstTry(true), +#endif name(nullptr), filename(nullptr), iconName(nullptr), @@ -620,7 +622,9 @@ CarlaPlugin::ProtectedData::ProtectedData(CarlaEngine* const eng, const uint idx CarlaPlugin::ProtectedData::~ProtectedData() noexcept { CARLA_SAFE_ASSERT(! (active && needsReset)); +#ifndef BUILD_BRIDGE CARLA_SAFE_ASSERT(transientTryCounter == 0); +#endif { // mutex MUST have been locked before diff --git a/source/backend/plugin/CarlaPluginInternal.hpp b/source/backend/plugin/CarlaPluginInternal.hpp index 840c0f64e..f1510b392 100644 --- a/source/backend/plugin/CarlaPluginInternal.hpp +++ b/source/backend/plugin/CarlaPluginInternal.hpp @@ -1,6 +1,6 @@ /* * Carla Plugin - * Copyright (C) 2011-2014 Filipe Coelho + * Copyright (C) 2011-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -227,8 +227,10 @@ struct CarlaPlugin::ProtectedData { // misc int8_t ctrlChannel; uint extraHints; +#ifndef BUILD_BRIDGE uint transientTryCounter; bool transientFirstTry; +#endif // data 1 const char* name; diff --git a/source/backend/plugin/CarlaPluginLV2.cpp b/source/backend/plugin/CarlaPluginLV2.cpp index a3d9b42bb..2bf33f441 100644 --- a/source/backend/plugin/CarlaPluginLV2.cpp +++ b/source/backend/plugin/CarlaPluginLV2.cpp @@ -1284,8 +1284,10 @@ public: const uintptr_t frontendWinId(pData->engine->getOptions().frontendWinId); +#ifndef BUILD_BRIDGE if (! yesNo) pData->transientTryCounter = 0; +#endif if (fUI.type == UI::TYPE_BRIDGE) { @@ -1575,7 +1577,9 @@ public: fPipeServer.stopPipeServer(2000); // fall through case CarlaPipeServerLV2::UiCrashed: +#ifndef BUILD_BRIDGE pData->transientTryCounter = 0; +#endif pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0.0f, nullptr); break; } diff --git a/source/backend/plugin/CarlaPluginNative.cpp b/source/backend/plugin/CarlaPluginNative.cpp index 712711d62..d9b93b127 100644 --- a/source/backend/plugin/CarlaPluginNative.cpp +++ b/source/backend/plugin/CarlaPluginNative.cpp @@ -1,6 +1,6 @@ /* * Carla Native Plugin - * Copyright (C) 2012-2017 Filipe Coelho + * Copyright (C) 2012-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -229,7 +229,9 @@ public: if (fIsUiVisible && fDescriptor != nullptr && fDescriptor->ui_show != nullptr && fHandle != nullptr) fDescriptor->ui_show(fHandle, false); +#ifndef BUILD_BRIDGE pData->transientTryCounter = 0; +#endif } pData->singleMutex.lock(); @@ -751,7 +753,9 @@ public: if (! yesNo) { +#ifndef BUILD_BRIDGE pData->transientTryCounter = 0; +#endif return; } diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index f529d9261..8dffcdaa4 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -853,6 +853,7 @@ LRESULT CALLBACK wndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) // ----------------------------------------------------- +#ifndef BUILD_BRIDGE bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* const uiTitle, const uintptr_t winId, const bool centerUI) { CARLA_SAFE_ASSERT_RETURN(uiTitle != nullptr && uiTitle[0] != '\0', true); @@ -1140,6 +1141,7 @@ bool CarlaPluginUI::tryTransientWinIdMatch(const uintptr_t pid, const char* cons return true; (void)pid; (void)centerUI; } +#endif // BUILD_BRIDGE // ----------------------------------------------------- diff --git a/source/utils/CarlaPluginUI.hpp b/source/utils/CarlaPluginUI.hpp index 19996aeb3..32d794899 100644 --- a/source/utils/CarlaPluginUI.hpp +++ b/source/utils/CarlaPluginUI.hpp @@ -1,6 +1,6 @@ /* * Carla Plugin UI - * Copyright (C) 2014 Filipe Coelho + * Copyright (C) 2014-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -46,7 +46,9 @@ public: virtual void* getDisplay() const noexcept = 0; #endif +#ifndef BUILD_BRIDGE static bool tryTransientWinIdMatch(const uintptr_t pid, const char* const uiTitle, const uintptr_t winId, const bool centerUI); +#endif #ifdef CARLA_OS_MAC static CarlaPluginUI* newCocoa(Callback*, uintptr_t, bool); From 86560329aa3b15c6b97a72b2bdb6f1daf44ba1a4 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 20:01:20 +0100 Subject: [PATCH 21/37] Cleanup mac os build-deps script --- data/macos/build-deps.sh | 73 ++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/data/macos/build-deps.sh b/data/macos/build-deps.sh index af590e5e8..bdab539d0 100755 --- a/data/macos/build-deps.sh +++ b/data/macos/build-deps.sh @@ -123,6 +123,23 @@ if [ x"${ARCH}" = x"32" ]; then return fi +# --------------------------------------------------------------------------------------------------------------------- +# zlib + +if [ ! -d zlib-${ZLIB_VERSION} ]; then + curl -L https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz -o zlib-${ZLIB_VERSION}.tar.gz + tar -xf zlib-${ZLIB_VERSION}.tar.gz +fi + +if [ ! -f zlib-${ZLIB_VERSION}/build-done ]; then + cd zlib-${ZLIB_VERSION} + ./configure --static --prefix=${PREFIX} + make + make install + touch build-done + cd .. +fi + # --------------------------------------------------------------------------------------------------------------------- # file/magic @@ -280,7 +297,7 @@ fi if [ ! -f libffi-${LIBFFI_VERSION}/build-done ]; then cd libffi-${LIBFFI_VERSION} - ./configure --enable-static --disable-shared --prefix=$PREFIX + ./configure --enable-static --disable-shared --prefix=${PREFIX} make ${MAKE_ARGS} make install touch build-done @@ -321,7 +338,7 @@ if [ ! -f glib-${GLIB_VERSION}/build-done ]; then env PATH=/opt/local/bin:$PATH make ${MAKE_ARGS} || true touch gio/gio-querymodules gio/glib-compile-resources gio/gsettings gio/gdbus gio/gresource gio/gapplication env PATH=/opt/local/bin:$PATH make ${MAKE_ARGS} - touch $PREFIX/bin/gtester-report + touch ${PREFIX}/bin/gtester-report env PATH=/opt/local/bin:$PATH make install touch build-done cd .. @@ -351,25 +368,7 @@ if [ ! -f fluidsynth-${FLUIDSYNTH_VERSION}/build-done ]; then cd .. fi - -# ------------------------------------------------------------------------------------ -# zlib - -if [ ! -d zlib-${ZLIB_VERSION} ]; then - curl -L https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz -o zlib-${ZLIB_VERSION}.tar.gz - tar -xf zlib-${ZLIB_VERSION}.tar.gz -fi - -if [ ! -f zlib-${ZLIB_VERSION}/build-done ]; then - cd zlib-${ZLIB_VERSION} - ./configure --static --prefix=$PREFIX - make - make install - touch build-done - cd .. -fi - -# ------------------------------------------------------------------------------------ +# --------------------------------------------------------------------------------------------------------------------- # mxml if [ ! -d mxml-${MXML_VERSION} ]; then @@ -382,11 +381,11 @@ fi if [ ! -f mxml-${MXML_VERSION}/build-done ]; then cd mxml-${MXML_VERSION} - ./configure --disable-shared --prefix=$PREFIX + ./configure --disable-shared --prefix=${PREFIX} make libmxml.a - cp *.a $PREFIX/lib/ - cp *.pc $PREFIX/lib/pkgconfig/ - cp mxml.h $PREFIX/include/ + cp *.a ${PREFIX}/lib/ + cp *.pc ${PREFIX}/lib/pkgconfig/ + cp mxml.h ${PREFIX}/include/ touch build-done cd .. fi @@ -403,11 +402,11 @@ if [ ! -f fftw-${FFTW3_VERSION}/build-done ]; then export CFLAGS="${CFLAGS} -ffast-math" export CXXFLAGS="${CXXFLAGS} -ffast-math" cd fftw-${FFTW3_VERSION} - ./configure --enable-static --enable-sse2 --disable-shared --disable-debug --prefix=$PREFIX + ./configure --enable-static --enable-sse2 --disable-shared --disable-debug --prefix=${PREFIX} make make install make clean - ./configure --enable-static --enable-sse --enable-sse2 --enable-single --disable-shared --disable-debug --prefix=$PREFIX + ./configure --enable-static --enable-sse --enable-sse2 --enable-single --disable-shared --disable-debug --prefix=${PREFIX} make make install make clean @@ -466,7 +465,7 @@ if [ ! -f qtbase-opensource-src-${QT5_VERSION}/build-done ]; then chmod +x configure chmod -R 777 config.tests/unix/ ./configure -release -shared -opensource -confirm-license -force-pkg-config -platform macx-clang -framework \ - -prefix $PREFIX -plugindir $PREFIX/lib/qt5/plugins -headerdir $PREFIX/include/qt5 \ + -prefix ${PREFIX} -plugindir ${PREFIX}/lib/qt5/plugins -headerdir ${PREFIX}/include/qt5 \ -qt-freetype -qt-libjpeg -qt-libpng -qt-pcre -opengl desktop -qpa cocoa \ -no-directfb -no-eglfs -no-kms -no-linuxfb -no-mtdev -no-xcb -no-xcb-xlib \ -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2 \ @@ -481,12 +480,12 @@ if [ ! -f qtbase-opensource-src-${QT5_VERSION}/build-done ]; then ln -s ${PREFIX}/lib/QtGui.framework/Headers ${PREFIX}/include/qt5/QtGui ln -s ${PREFIX}/lib/QtWidgets.framework/Headers ${PREFIX}/include/qt5/QtWidgets sed -i -e "s/ -lqtpcre/ /" ${PREFIX}/lib/pkgconfig/Qt5Core.pc - sed -i -e "s/ '/ /" $PREFIX/lib/pkgconfig/Qt5Core.pc - sed -i -e "s/ '/ /" $PREFIX/lib/pkgconfig/Qt5Core.pc - sed -i -e "s/ '/ /" $PREFIX/lib/pkgconfig/Qt5Gui.pc - sed -i -e "s/ '/ /" $PREFIX/lib/pkgconfig/Qt5Gui.pc - sed -i -e "s/ '/ /" $PREFIX/lib/pkgconfig/Qt5Widgets.pc - sed -i -e "s/ '/ /" $PREFIX/lib/pkgconfig/Qt5Widgets.pc + sed -i -e "s/ '/ /" ${PREFIX}/lib/pkgconfig/Qt5Core.pc + sed -i -e "s/ '/ /" ${PREFIX}/lib/pkgconfig/Qt5Core.pc + sed -i -e "s/ '/ /" ${PREFIX}/lib/pkgconfig/Qt5Gui.pc + sed -i -e "s/ '/ /" ${PREFIX}/lib/pkgconfig/Qt5Gui.pc + sed -i -e "s/ '/ /" ${PREFIX}/lib/pkgconfig/Qt5Widgets.pc + sed -i -e "s/ '/ /" ${PREFIX}/lib/pkgconfig/Qt5Widgets.pc touch build-done cd .. fi @@ -574,7 +573,7 @@ fi if [ ! -f Python-${PYTHON_VERSION}/build-done ]; then cd Python-${PYTHON_VERSION} - ./configure --prefix=$PREFIX + ./configure --prefix=${PREFIX} make make install touch build-done @@ -627,7 +626,7 @@ if [ ! -f pyliblo-${PYLIBLO_VERSION}/build-done ]; then cd pyliblo-${PYLIBLO_VERSION} env CFLAGS="${CFLAGS} -I${TARGETDIR}/carla64/include" LDFLAGS="${LDFLAGS} -L${TARGETDIR}/carla64/lib" \ python3 setup.py build - python3 setup.py install --prefix=$PREFIX + python3 setup.py install --prefix=${PREFIX} touch build-done cd .. fi @@ -644,7 +643,7 @@ if [ ! -f cx_Freeze-${CXFREEZE_VERSION}/build-done ]; then cd cx_Freeze-${CXFREEZE_VERSION} sed -i -e 's/"python%s.%s"/"python%s.%sm"/' setup.py python3 setup.py build - python3 setup.py install --prefix=$PREFIX + python3 setup.py install --prefix=${PREFIX} touch build-done cd .. fi From 074b1bcf19113d68768d1116a408b2907635c561 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 20:19:46 +0100 Subject: [PATCH 22/37] Fix linux build after latest changes --- source/backend/plugin/CarlaPluginJack.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/backend/plugin/CarlaPluginJack.cpp b/source/backend/plugin/CarlaPluginJack.cpp index f7797c1b9..47c04d689 100644 --- a/source/backend/plugin/CarlaPluginJack.cpp +++ b/source/backend/plugin/CarlaPluginJack.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin JACK - * Copyright (C) 2016-2017 Filipe Coelho + * Copyright (C) 2016-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -221,9 +221,11 @@ public: { carla_debug("CarlaPluginJack::~CarlaPluginJack()"); +#ifndef BUILD_BRIDGE // close UI if (pData->hints & PLUGIN_HAS_CUSTOM_UI) pData->transientTryCounter = 0; +#endif pData->singleMutex.lock(); pData->masterMutex.lock(); From 670b1a53d6842f4d9e535fb8c7fb615a29e234fc Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 21:11:09 +0100 Subject: [PATCH 23/37] Add a few packages to linux build scripts --- data/linux/build-all.sh | 3 ++- data/linux/build-deps.sh | 46 ++++++++++++++++++++++++++++++++++++++++ data/linux/common.env | 2 ++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/data/linux/build-all.sh b/data/linux/build-all.sh index e1a947c7b..761056adb 100755 --- a/data/linux/build-all.sh +++ b/data/linux/build-all.sh @@ -95,6 +95,7 @@ if [ ! -f /tmp/setup-repo-packages ]; then apt-get install -y build-essential libglib2.0-dev uuid-dev git-core apt-get install -y autoconf libtool apt-get install -y bison flex libxml-libxml-perl libxml-parser-perl + apt-get install -y libgl1-mesa-dev libglu1-mesa-dev apt-get clean rm /usr/lib/libuuid.so touch /tmp/setup-repo-packages @@ -192,7 +193,7 @@ export RCC_QT4=/usr/bin/rcc export LINUX="true" cd ${CHROOT_CARLA_DIR} -make EXTERNAL_PLUGINS=false ${MAKE_ARGS} +make ${MAKE_ARGS} if [ x"${ARCH}" != x"32" ]; then export CFLAGS="-I${TARGETDIR}/carla32/include -m32" diff --git a/data/linux/build-deps.sh b/data/linux/build-deps.sh index 9c05a7379..7593840ab 100755 --- a/data/linux/build-deps.sh +++ b/data/linux/build-deps.sh @@ -301,6 +301,52 @@ if [ ! -f fluidsynth-${FLUIDSYNTH_VERSION}/build-done ]; then cd .. fi +# --------------------------------------------------------------------------------------------------------------------- +# mxml + +if [ ! -d mxml-${MXML_VERSION} ]; then + wget --no-check-certificate https://github.com/michaelrsweet/mxml/releases/download/v${MXML_VERSION}/mxml-${MXML_VERSION}.tar.gz -O mxml-${MXML_VERSION}.tar.gz + mkdir mxml-${MXML_VERSION} + cd mxml-${MXML_VERSION} + tar -xf ../mxml-${MXML_VERSION}.tar.gz + cd .. +fi + +if [ ! -f mxml-${MXML_VERSION}/build-done ]; then + cd mxml-${MXML_VERSION} + ./configure --disable-shared --prefix=$PREFIX + make libmxml.a + cp *.a $PREFIX/lib/ + cp *.pc $PREFIX/lib/pkgconfig/ + cp mxml.h $PREFIX/include/ + touch build-done + cd .. +fi + +# --------------------------------------------------------------------------------------------------------------------- +# fftw3 (needs to be last as it modifies C[XX]FLAGS) + +if [ ! -d fftw-${FFTW3_VERSION} ]; then + wget --no-check-certificate http://www.fftw.org/fftw-${FFTW3_VERSION}.tar.gz + tar -xf fftw-${FFTW3_VERSION}.tar.gz +fi + +if [ ! -f fftw-${FFTW3_VERSION}/build-done ]; then + export CFLAGS="${CFLAGS} -ffast-math" + export CXXFLAGS="${CXXFLAGS} -ffast-math" + cd fftw-${FFTW3_VERSION} + ./configure --enable-static --enable-sse2 --disable-shared --disable-debug --prefix=$PREFIX + make + make install + make clean + ./configure --enable-static --enable-sse --enable-sse2 --enable-single --disable-shared --disable-debug --prefix=$PREFIX + make + make install + make clean + touch build-done + cd .. +fi + } # --------------------------------------------------------------------------------------------------------------------- diff --git a/data/linux/common.env b/data/linux/common.env index 4fa9d2184..75efc49c9 100644 --- a/data/linux/common.env +++ b/data/linux/common.env @@ -11,6 +11,8 @@ LIBSNDFILE_VERSION=1.0.28 LIBGIG_VERSION=4.0.0 LINUXSAMPLER_VERSION=2.0.0 FLUIDSYNTH_VERSION=1.1.6 +MXML_VERSION=2.11 +FFTW3_VERSION=3.3.7 MAKE_ARGS="-j 8" TARGETDIR=$HOME/builds From 7307d37487772ef4afa4ba7d01d0676da0ed7fed Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 23:02:26 +0100 Subject: [PATCH 24/37] Changes to make zyn fx buildable on mingw Skips most of zyn code --- data/linux/build-deps.sh | 10 +- data/windows/build-deps.sh | 63 +++++- data/windows/build-win.sh | 3 - data/windows/common.env | 2 + source/native-plugins/external/Makefile | 6 +- source/native-plugins/zynaddsubfx-src.cpp | 195 ++++++++++-------- .../zynaddsubfx/rtosc/pretty-format.c | 8 +- 7 files changed, 193 insertions(+), 94 deletions(-) diff --git a/data/linux/build-deps.sh b/data/linux/build-deps.sh index 7593840ab..411065c4e 100755 --- a/data/linux/build-deps.sh +++ b/data/linux/build-deps.sh @@ -335,11 +335,17 @@ if [ ! -f fftw-${FFTW3_VERSION}/build-done ]; then export CFLAGS="${CFLAGS} -ffast-math" export CXXFLAGS="${CXXFLAGS} -ffast-math" cd fftw-${FFTW3_VERSION} - ./configure --enable-static --enable-sse2 --disable-shared --disable-debug --prefix=$PREFIX + ./configure --enable-static --disable-shared --prefix=${PREFIX} \ + --enable-sse2 \ + --disable-debug --disable-alloca --disable-fortran \ + --with-our-malloc make make install make clean - ./configure --enable-static --enable-sse --enable-sse2 --enable-single --disable-shared --disable-debug --prefix=$PREFIX + ./configure --enable-static --disable-shared --prefix=${PREFIX} \ + --enable-sse2 --enable-sse --enable-single \ + --disable-debug --disable-alloca --disable-fortran \ + --with-our-malloc make make install make clean diff --git a/data/windows/build-deps.sh b/data/windows/build-deps.sh index 749907f36..129dc244f 100755 --- a/data/windows/build-deps.sh +++ b/data/windows/build-deps.sh @@ -352,14 +352,71 @@ if [ ! -f fluidsynth-${FLUIDSYNTH_VERSION}/build-done ]; then cd .. fi +# --------------------------------------------------------------------------------------------------------------------- +# mxml + +if [ ! -d mxml-${MXML_VERSION} ]; then + wget -c https://github.com/michaelrsweet/mxml/releases/download/v${MXML_VERSION}/mxml-${MXML_VERSION}.tar.gz -O mxml-${MXML_VERSION}.tar.gz + mkdir mxml-${MXML_VERSION} + cd mxml-${MXML_VERSION} + tar -xf ../mxml-${MXML_VERSION}.tar.gz + cd .. +fi + +if [ ! -f mxml-${MXML_VERSION}/build-done ]; then + cd mxml-${MXML_VERSION} + ./configure --disable-shared --prefix=${PREFIX} \ + --target=${MINGW_PREFIX} --host=${MINGW_PREFIX} --build=${HOST_ARCH} + make libmxml.a + cp *.a ${PREFIX}/lib/ + cp *.pc ${PREFIX}/lib/pkgconfig/ + cp mxml.h ${PREFIX}/include/ + touch build-done + cd .. +fi + +# --------------------------------------------------------------------------------------------------------------------- +# fftw3 (needs to be last as it modifies C[XX]FLAGS) + +if [ ! -d fftw-${FFTW3_VERSION} ]; then + curl -O http://www.fftw.org/fftw-${FFTW3_VERSION}.tar.gz + tar -xf fftw-${FFTW3_VERSION}.tar.gz +fi + +if [ ! -f fftw-${FFTW3_VERSION}/build-done ]; then + export CFLAGS="${CFLAGS} -ffast-math" + export CXXFLAGS="${CXXFLAGS} -ffast-math" + cd fftw-${FFTW3_VERSION} + ./configure --enable-static --disable-shared --prefix=${PREFIX} \ + --target=${MINGW_PREFIX} --host=${MINGW_PREFIX} --build=${HOST_ARCH} \ + --enable-sse2 \ + --disable-debug --disable-alloca --disable-fortran \ + --with-our-malloc + make + make install + make clean + ./configure --enable-static --disable-shared --prefix=${PREFIX} \ + --target=${MINGW_PREFIX} --host=${MINGW_PREFIX} --build=${HOST_ARCH} \ + --enable-sse2 --enable-sse --enable-single \ + --disable-debug --disable-alloca --disable-fortran \ + --with-our-malloc + make + make install + make clean + touch build-done + cd .. +fi + } # --------------------------------------------------------------------------------------------------------------------- # build base libs -export ARCH=32 -build_base -cleanup_pkgs +# cleanup_prefix + +# export ARCH=32 +# build_base +# cleanup_pkgs export ARCH=64 build_base diff --git a/data/windows/build-win.sh b/data/windows/build-win.sh index b078ebcd9..1421d8f29 100755 --- a/data/windows/build-win.sh +++ b/data/windows/build-win.sh @@ -30,9 +30,6 @@ source data/windows/common.env MAKE_ARGS="${MAKE_ARGS} HAVE_QT4=false HAVE_QT5=false HAVE_PYQT5=true HAVE_FFMPEG=false HAVE_PROJECTM=false" MAKE_ARGS="${MAKE_ARGS} BUILDING_FOR_WINDOWS=true" -# FIXME -MAKE_ARGS="${MAKE_ARGS} HAVE_ZYN_DEPS=false" - if [ x"${ARCH}" != x"32" ]; then CPUARCH="x86_64" else diff --git a/data/windows/common.env b/data/windows/common.env index b8ac7e965..8ab3e5e37 100644 --- a/data/windows/common.env +++ b/data/windows/common.env @@ -15,6 +15,8 @@ GETTEXT_VERSION=0.18.3.2 GLIB_VERSION=2.22.5 GLIB_MVERSION=2.22 FLUIDSYNTH_VERSION=1.1.6 +MXML_VERSION=2.11 +FFTW3_VERSION=3.3.7 QT5_VERSION=5.5.1 QT5_MVERSION=5.5 PYTHON_VERSION=3.4.7 diff --git a/source/native-plugins/external/Makefile b/source/native-plugins/external/Makefile index 3205b7598..c20660420 100644 --- a/source/native-plugins/external/Makefile +++ b/source/native-plugins/external/Makefile @@ -35,8 +35,12 @@ OBJS_all += \ ifeq ($(HAVE_ZYN_DEPS),true) OBJS_all += \ $(OBJDIR)/zynaddsubfx-fx.cpp.o \ - $(OBJDIR)/zynaddsubfx-src.cpp.o \ + $(OBJDIR)/zynaddsubfx-src.cpp.o + +ifneq ($(MACOS_OR_WIN32),true) +OBJS_all += \ $(OBJDIR)/zynaddsubfx-synth.cpp.o +endif ifeq ($(HAVE_ZYN_UI_DEPS),true) TARGETS += resources/zynaddsubfx-ui$(APP_EXT) diff --git a/source/native-plugins/zynaddsubfx-src.cpp b/source/native-plugins/zynaddsubfx-src.cpp index 31414c0fc..ee6520e40 100644 --- a/source/native-plugins/zynaddsubfx-src.cpp +++ b/source/native-plugins/zynaddsubfx-src.cpp @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2012-2016 Filipe Coelho + * Copyright (C) 2012-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -26,16 +26,32 @@ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Winconsistent-missing-override" # pragma clang diagnostic ignored "-Wunused-private-field" -#elif defined(__GNUC__) && (__GNUC__ >= 6) +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) # pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wshift-negative-value" -# pragma GCC diagnostic ignored "-Wmisleading-indentation" +# pragma GCC diagnostic ignored "-Wliteral-suffix" +# if __GNUC__ >= 6 +# pragma GCC diagnostic ignored "-Wshift-negative-value" +# pragma GCC diagnostic ignored "-Wmisleading-indentation" +# endif #endif // base c-style headers #include "zynaddsubfx/tlsf/tlsf.h" #include "zynaddsubfx/rtosc/rtosc.h" +#ifdef CARLA_OS_WIN +# define PRId64 P_INT64 +# define PRIi64 P_INT64 +# define PRIx64 P_UINT64 +# define PRId32 "%d" +# define PRIi32 "%i" +# define PRIx32 "%x" +#endif + +#if ! (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) +# define CARLA_ZYN_FULL +#endif + // C-code includes extern "C" { #include "zynaddsubfx/tlsf/tlsf.c" @@ -52,6 +68,7 @@ extern "C" { #undef tlsf_insist #include "zynaddsubfx/rtosc/dispatch.c" +#include "zynaddsubfx/rtosc/pretty-format.c" #include "zynaddsubfx/rtosc/rtosc.c" } @@ -71,6 +88,7 @@ extern "C" { // zynaddsubfx includes #include "zynaddsubfx/version.cpp" +#ifdef CARLA_ZYN_FULL #include "zynaddsubfx/Containers/MultiPseudoStack.cpp" #undef rBegin #undef rObject @@ -95,7 +113,9 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/DSP/AnalogFilter.cpp" +#include "zynaddsubfx/Misc/Bank.cpp" +#undef INSTRUMENT_EXTENSION +#undef FORCE_BANK_DIR_FILE #undef rBegin #undef rObject #undef rStdString @@ -103,7 +123,9 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/DSP/FFTwrapper.cpp" +#define INSTRUMENT_EXTENSION INSTRUMENT_EXTENSION_DB +#include "zynaddsubfx/Misc/BankDb.cpp" +#undef INSTRUMENT_EXTENSION #undef rBegin #undef rObject #undef rStdString @@ -111,7 +133,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/DSP/Filter.cpp" +#include "zynaddsubfx/Misc/CallbackRepeater.cpp" #undef rBegin #undef rObject #undef rStdString @@ -119,7 +141,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/DSP/FormantFilter.cpp" +#include "zynaddsubfx/Misc/Config.cpp" #undef rBegin #undef rObject #undef rStdString @@ -127,15 +149,15 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/DSP/SVFilter.cpp" -#undef rBegin +#include "zynaddsubfx/Misc/Master.cpp" #undef rObject #undef rStdString #undef rStdStringCb #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/DSP/Unison.cpp" +#include "zynaddsubfx/Misc/Microtonal.cpp" +#undef MAX_LINE_SIZE #undef rBegin #undef rObject #undef rStdString @@ -143,7 +165,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/Alienwah.cpp" +#include "zynaddsubfx/Misc/MiddleWare.cpp" #undef rBegin #undef rObject #undef rStdString @@ -151,7 +173,8 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/Chorus.cpp" +#include "zynaddsubfx/Misc/Part.cpp" +#undef CLONE #undef rBegin #undef rObject #undef rStdString @@ -159,7 +182,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/Distorsion.cpp" +#include "zynaddsubfx/Misc/PresetExtractor.cpp" #undef rBegin #undef rObject #undef rStdString @@ -167,7 +190,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/DynamicFilter.cpp" +#include "zynaddsubfx/Misc/Recorder.cpp" #undef rBegin #undef rObject #undef rStdString @@ -175,8 +198,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/Echo.cpp" -#undef MAX_DELAY +#include "zynaddsubfx/Misc/WavFile.cpp" #undef rBegin #undef rObject #undef rStdString @@ -184,7 +206,8 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/Effect.cpp" +#include "zynaddsubfx/Params/ADnoteParameters.cpp" +#undef EXPAND #undef rBegin #undef rObject #undef rStdString @@ -192,7 +215,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/EffectLFO.cpp" +#include "zynaddsubfx/Params/Controller.cpp" #undef rBegin #undef rObject #undef rStdString @@ -200,7 +223,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/EffectMgr.cpp" +#include "zynaddsubfx/Params/EnvelopeParams.cpp" #undef rBegin #undef rObject #undef rStdString @@ -208,7 +231,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/EQ.cpp" +#include "zynaddsubfx/Params/LFOParams.cpp" #undef rBegin #undef rObject #undef rStdString @@ -216,10 +239,9 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/Phaser.cpp" -#undef PHASER_LFO_SHAPE -#undef ONE_ -#undef ZERO_ +#include "zynaddsubfx/Params/PADnoteParameters.cpp" +#undef PC +#undef P_C #undef rBegin #undef rObject #undef rStdString @@ -227,7 +249,9 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Effects/Reverb.cpp" +#include "zynaddsubfx/Params/SUBnoteParameters.cpp" +#undef doPaste +#undef doPPaste #undef rBegin #undef rObject #undef rStdString @@ -235,7 +259,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/Allocator.cpp" +#include "zynaddsubfx/Synth/ADnote.cpp" #undef rBegin #undef rObject #undef rStdString @@ -243,9 +267,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/Bank.cpp" -#undef INSTRUMENT_EXTENSION -#undef FORCE_BANK_DIR_FILE +#include "zynaddsubfx/Synth/Envelope.cpp" #undef rBegin #undef rObject #undef rStdString @@ -253,9 +275,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#define INSTRUMENT_EXTENSION INSTRUMENT_EXTENSION_DB -#include "zynaddsubfx/Misc/BankDb.cpp" -#undef INSTRUMENT_EXTENSION +#include "zynaddsubfx/Synth/LFO.cpp" #undef rBegin #undef rObject #undef rStdString @@ -263,7 +283,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/CallbackRepeater.cpp" +#include "zynaddsubfx/Synth/ModFilter.cpp" #undef rBegin #undef rObject #undef rStdString @@ -271,7 +291,13 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/Config.cpp" +#include "zynaddsubfx/Synth/OscilGen.cpp" +#undef PC +#undef DIFF +#undef PRESERVE +#undef RESTORE +#undef FUNC +#undef FILTER #undef rBegin #undef rObject #undef rStdString @@ -279,15 +305,15 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/Master.cpp" +#include "zynaddsubfx/Synth/PADnote.cpp" +#undef rBegin #undef rObject #undef rStdString #undef rStdStringCb #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/Microtonal.cpp" -#undef MAX_LINE_SIZE +#include "zynaddsubfx/Synth/Resonance.cpp" #undef rBegin #undef rObject #undef rStdString @@ -295,7 +321,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/MiddleWare.cpp" +#include "zynaddsubfx/Synth/SUBnote.cpp" #undef rBegin #undef rObject #undef rStdString @@ -303,8 +329,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/Part.cpp" -#undef CLONE +#include "zynaddsubfx/Synth/SynthNote.cpp" #undef rBegin #undef rObject #undef rStdString @@ -312,7 +337,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/PresetExtractor.cpp" +#include "zynaddsubfx/Synth/WatchPoint.cpp" #undef rBegin #undef rObject #undef rStdString @@ -320,7 +345,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/Recorder.cpp" +#include "zynaddsubfx/UI/ConnectionDummy.cpp" #undef rBegin #undef rObject #undef rStdString @@ -328,7 +353,10 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/Util.cpp" +#include "zynaddsubfx/globals.cpp" +#endif // CARLA_ZYN_FULL + +#include "zynaddsubfx/DSP/AnalogFilter.cpp" #undef rBegin #undef rObject #undef rStdString @@ -336,7 +364,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/WavFile.cpp" +#include "zynaddsubfx/DSP/FFTwrapper.cpp" #undef rBegin #undef rObject #undef rStdString @@ -344,7 +372,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/WaveShapeSmps.cpp" +#include "zynaddsubfx/DSP/Filter.cpp" #undef rBegin #undef rObject #undef rStdString @@ -352,7 +380,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Misc/XMLwrapper.cpp" +#include "zynaddsubfx/DSP/FormantFilter.cpp" #undef rBegin #undef rObject #undef rStdString @@ -360,8 +388,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/ADnoteParameters.cpp" -#undef EXPAND +#include "zynaddsubfx/DSP/SVFilter.cpp" #undef rBegin #undef rObject #undef rStdString @@ -369,7 +396,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/Controller.cpp" +#include "zynaddsubfx/DSP/Unison.cpp" #undef rBegin #undef rObject #undef rStdString @@ -377,7 +404,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/EnvelopeParams.cpp" +#include "zynaddsubfx/Effects/Alienwah.cpp" #undef rBegin #undef rObject #undef rStdString @@ -385,7 +412,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/FilterParams.cpp" +#include "zynaddsubfx/Effects/Chorus.cpp" #undef rBegin #undef rObject #undef rStdString @@ -393,7 +420,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/LFOParams.cpp" +#include "zynaddsubfx/Effects/Distorsion.cpp" #undef rBegin #undef rObject #undef rStdString @@ -401,9 +428,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/PADnoteParameters.cpp" -#undef PC -#undef P_C +#include "zynaddsubfx/Effects/DynamicFilter.cpp" #undef rBegin #undef rObject #undef rStdString @@ -411,7 +436,8 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/Presets.cpp" +#include "zynaddsubfx/Effects/Echo.cpp" +#undef MAX_DELAY #undef rBegin #undef rObject #undef rStdString @@ -419,7 +445,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/PresetsArray.cpp" +#include "zynaddsubfx/Effects/Effect.cpp" #undef rBegin #undef rObject #undef rStdString @@ -427,7 +453,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/PresetsStore.cpp" +#include "zynaddsubfx/Effects/EffectLFO.cpp" #undef rBegin #undef rObject #undef rStdString @@ -435,9 +461,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Params/SUBnoteParameters.cpp" -#undef doPaste -#undef doPPaste +#include "zynaddsubfx/Effects/EffectMgr.cpp" #undef rBegin #undef rObject #undef rStdString @@ -445,7 +469,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/ADnote.cpp" +#include "zynaddsubfx/Effects/EQ.cpp" #undef rBegin #undef rObject #undef rStdString @@ -453,7 +477,10 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/Envelope.cpp" +#include "zynaddsubfx/Effects/Phaser.cpp" +#undef PHASER_LFO_SHAPE +#undef ONE_ +#undef ZERO_ #undef rBegin #undef rObject #undef rStdString @@ -461,7 +488,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/LFO.cpp" +#include "zynaddsubfx/Effects/Reverb.cpp" #undef rBegin #undef rObject #undef rStdString @@ -469,7 +496,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/ModFilter.cpp" +#include "zynaddsubfx/Misc/Allocator.cpp" #undef rBegin #undef rObject #undef rStdString @@ -477,13 +504,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/OscilGen.cpp" -#undef PC -#undef DIFF -#undef PRESERVE -#undef RESTORE -#undef FUNC -#undef FILTER +#include "zynaddsubfx/Misc/Util.cpp" #undef rBegin #undef rObject #undef rStdString @@ -491,7 +512,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/PADnote.cpp" +#include "zynaddsubfx/Misc/WaveShapeSmps.cpp" #undef rBegin #undef rObject #undef rStdString @@ -499,7 +520,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/Resonance.cpp" +#include "zynaddsubfx/Misc/XMLwrapper.cpp" #undef rBegin #undef rObject #undef rStdString @@ -507,7 +528,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/SUBnote.cpp" +#include "zynaddsubfx/Params/FilterParams.cpp" #undef rBegin #undef rObject #undef rStdString @@ -515,7 +536,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/SynthNote.cpp" +#include "zynaddsubfx/Params/Presets.cpp" #undef rBegin #undef rObject #undef rStdString @@ -523,7 +544,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/Synth/WatchPoint.cpp" +#include "zynaddsubfx/Params/PresetsArray.cpp" #undef rBegin #undef rObject #undef rStdString @@ -531,7 +552,7 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/UI/ConnectionDummy.cpp" +#include "zynaddsubfx/Params/PresetsStore.cpp" #undef rBegin #undef rObject #undef rStdString @@ -539,14 +560,13 @@ extern "C" { #undef rChangeCb #define rChangeCb -#include "zynaddsubfx/globals.cpp" - #if defined(__clang__) # pragma clang diagnostic pop #elif defined(__GNUC__) && (__GNUC__ >= 6) # pragma GCC diagnostic pop #endif +#ifdef CARLA_ZYN_FULL // Dummy variables and functions for linking purposes namespace zyncarla { class WavFile; @@ -563,3 +583,16 @@ namespace Nio { void waveStop(){} } } +#endif // CARLA_ZYN_FULL + +rtosc_version rtosc_current_version() +{ + return ((rtosc_version) { 0, 0, 0 } ); +} + +void rtosc_version_print_to_12byte_str(const rtosc_version* v, + char* _12bytes) +{ + snprintf(_12bytes, 12, "%u.%u.%u", + (unsigned)v->major, (unsigned)v->minor, (unsigned)v->revision); +} diff --git a/source/native-plugins/zynaddsubfx/rtosc/pretty-format.c b/source/native-plugins/zynaddsubfx/rtosc/pretty-format.c index a34ed3512..529c0128a 100644 --- a/source/native-plugins/zynaddsubfx/rtosc/pretty-format.c +++ b/source/native-plugins/zynaddsubfx/rtosc/pretty-format.c @@ -23,8 +23,8 @@ static int asnprintf(char* str, size_t size, const char* format, ...) return written; } -static const rtosc_print_options* default_print_options - = &((rtosc_print_options) { true, 2, " ", 80}); +static const rtosc_print_options default_print_options + = ((rtosc_print_options) { true, 2, " ", 80}); /** * Return the char that represents the escape sequence @@ -73,7 +73,7 @@ size_t rtosc_print_arg_val(const rtosc_arg_val_t *arg, { size_t wrt = 0; if(!opt) - opt = default_print_options; + opt = &default_print_options; assert(arg); const rtosc_arg_t* val = &arg->val; @@ -301,7 +301,7 @@ size_t rtosc_print_arg_vals(const rtosc_arg_val_t *args, size_t n, size_t wrt=0; int args_written_this_line = (cols_used) ? 1 : 0; if(!opt) - opt = default_print_options; + opt = &default_print_options; size_t sep_len = strlen(opt->sep); char* last_sep = buffer - 1; for(size_t i = 0; i < n; ++i) From 1b8eaf84a86c3ebc505ef6050d8cc151b0cd13ba Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 22:32:57 +0000 Subject: [PATCH 25/37] Silence libpng warnings on macOS --- data/macos/build-deps.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/data/macos/build-deps.sh b/data/macos/build-deps.sh index bdab539d0..22ef35995 100755 --- a/data/macos/build-deps.sh +++ b/data/macos/build-deps.sh @@ -458,6 +458,7 @@ if [ ! -f qtbase-opensource-src-${QT5_VERSION}/build-done ]; then cd qtbase-opensource-src-${QT5_VERSION} if [ ! -f configured ]; then if [ ! -f carla-patched ]; then + sed -i -e "s|PNG_WARNINGS_SUPPORTED|PNG_WARNINGS_NOT_SUPPORTED|" src/3rdparty/libpng/pnglibconf.h sed -i -e "s|AWK=.*|AWK=/opt/local/bin/gawk|" configure patch -p1 -i ../patches/qt55-newosx-fix.patch touch carla-patched From de1a514e49210e39f2f256ae455650323aa6d007 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 23:09:46 +0000 Subject: [PATCH 26/37] Try to stop rtmidi from crashing on start; Fix typo --- source/backend/engine/CarlaEngineRtAudio.cpp | 13 +++++++++++-- source/modules/rtmidi/RtMidi.cpp | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/source/backend/engine/CarlaEngineRtAudio.cpp b/source/backend/engine/CarlaEngineRtAudio.cpp index c866899e4..94c9269e9 100644 --- a/source/backend/engine/CarlaEngineRtAudio.cpp +++ b/source/backend/engine/CarlaEngineRtAudio.cpp @@ -789,7 +789,12 @@ protected: newRtMidiPortName += ":"; newRtMidiPortName += portName; - RtMidiIn* const rtMidiIn(new RtMidiIn(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), newRtMidiPortName.buffer(), 512)); + RtMidiIn* rtMidiIn; + + try { + rtMidiIn = new RtMidiIn(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), newRtMidiPortName.buffer(), 512); + } CARLA_SAFE_EXCEPTION_RETURN("new RtMidiIn", false); + rtMidiIn->ignoreTypes(); rtMidiIn->setCallback(carla_rtmidi_callback, this); @@ -836,7 +841,11 @@ protected: newRtMidiPortName += ":"; newRtMidiPortName += portName; - RtMidiOut* const rtMidiOut(new RtMidiOut(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), newRtMidiPortName.buffer())); + RtMidiOut* rtMidiOut; + + try { + rtMidiOut = new RtMidiOut(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), newRtMidiPortName.buffer()); + } CARLA_SAFE_EXCEPTION_RETURN("new RtMidiOut", false); bool found = false; uint rtMidiPortIndex; diff --git a/source/modules/rtmidi/RtMidi.cpp b/source/modules/rtmidi/RtMidi.cpp index a3c9dcd85..b9b323732 100644 --- a/source/modules/rtmidi/RtMidi.cpp +++ b/source/modules/rtmidi/RtMidi.cpp @@ -931,7 +931,7 @@ void MidiOutCore :: initialize( const std::string& clientName ) OSStatus result = MIDIClientCreate(name, NULL, NULL, &client ); if ( result != noErr ) { std::ostringstream ost; - ost << "MidiInCore::initialize: error creating OS-X MIDI client object (" << result << ")."; + ost << "MidiOutCore::initialize: error creating OS-X MIDI client object (" << result << ")."; errorString_ = ost.str(); error( RtMidiError::DRIVER_ERROR, errorString_ ); return; From dd34da6c36d0c0f78880fbe7fb71b8b1f4a58e51 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 23:15:10 +0000 Subject: [PATCH 27/37] Fix crash when discovering midi ports using rtmidi --- source/backend/engine/CarlaEngineRtAudio.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/backend/engine/CarlaEngineRtAudio.cpp b/source/backend/engine/CarlaEngineRtAudio.cpp index 94c9269e9..1f56ffc6f 100644 --- a/source/backend/engine/CarlaEngineRtAudio.cpp +++ b/source/backend/engine/CarlaEngineRtAudio.cpp @@ -478,6 +478,7 @@ public: } // MIDI In + try { RtMidiIn midiIn(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), "carla-discovery-in"); @@ -488,9 +489,10 @@ public: extGraph.midiPorts.ins.append(portNameToId); } - } + } CARLA_SAFE_EXCEPTION("RtMidiIn discovery"); // MIDI Out + try { RtMidiOut midiOut(getMatchedAudioMidiAPI(fAudio.getCurrentApi()), "carla-discovery-out"); @@ -501,7 +503,7 @@ public: extGraph.midiPorts.outs.append(portNameToId); } - } + } CARLA_SAFE_EXCEPTION("RtMidiOut discovery"); // --------------------------------------------------------------- // now refresh From 8e854d44d8db27075ad78f4952dcd8f9ee84de66 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 22 Jan 2018 00:21:15 +0100 Subject: [PATCH 28/37] Enable back commented out code --- data/windows/build-deps.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/windows/build-deps.sh b/data/windows/build-deps.sh index 129dc244f..29755de2e 100755 --- a/data/windows/build-deps.sh +++ b/data/windows/build-deps.sh @@ -412,11 +412,11 @@ fi # --------------------------------------------------------------------------------------------------------------------- # build base libs -# cleanup_prefix +cleanup_prefix -# export ARCH=32 -# build_base -# cleanup_pkgs +export ARCH=32 +build_base +cleanup_pkgs export ARCH=64 build_base From f80f91b8a25194d13ec0396132ea420a3a0248e2 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 21 Jan 2018 23:28:12 +0000 Subject: [PATCH 29/37] Update READMEs --- README.md | 6 +++--- data/linux/README | 6 +++--- data/macos/README | 6 +++--- data/windows/README.txt | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6c0b913e2..5d09e6421 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ Features * GIG, SF2 and SFZ sound banks * Internal audio and midi file player * Automation of plugin parameters via MIDI CC -* Full OSC control -* Rack and Patchbay engine modes, plus Single and Multi-Client if using JACK -* Native audio drivers (ALSA, DirectSound, CoreAudio) and low-latency (ASIO and JACK) +* Remote control over OSC +* Rack and Patchbay processing modes, plus Single and Multi-Client if using JACK +* Native audio drivers (ALSA, DirectSound, CoreAudio, etc) and JACK In experimental phase / work in progress: * Export any Carla loadable plugin or sound bank as an LV2 plugin diff --git a/data/linux/README b/data/linux/README index 579aae124..a99d1da7f 100644 --- a/data/linux/README +++ b/data/linux/README @@ -13,9 +13,9 @@ Features * GIG, SF2 and SFZ sound banks * Internal audio and midi file player * Automation of plugin parameters via MIDI CC -* Full OSC control -* Rack and Patchbay engine modes, plus Single and Multi-Client if using JACK -* Native audio drivers (ALSA, DirectSound, CoreAudio) and low-latency (ASIO and JACK) +* Remote control over OSC +* Rack and Patchbay processing modes, plus Single and Multi-Client if using JACK +* Native audio drivers (ALSA, DirectSound, CoreAudio, etc) and JACK In experimental phase / work in progress: * Export any Carla loadable plugin or sound bank as an LV2 plugin diff --git a/data/macos/README b/data/macos/README index d598d713f..f7b5bd92d 100644 --- a/data/macos/README +++ b/data/macos/README @@ -13,9 +13,9 @@ Features * GIG, SF2 and SFZ sound banks * Internal audio and midi file player * Automation of plugin parameters via MIDI CC -* Full OSC control -* Rack and Patchbay engine modes, plus Single and Multi-Client if using JACK -* Native audio drivers (ALSA, DirectSound, CoreAudio) and low-latency (ASIO and JACK) +* Remote control over OSC +* Rack and Patchbay processing modes, plus Single and Multi-Client if using JACK +* Native audio drivers (ALSA, DirectSound, CoreAudio, etc) and JACK In experimental phase / work in progress: * Export any Carla loadable plugin or sound bank as an LV2 plugin diff --git a/data/windows/README.txt b/data/windows/README.txt index 3b36f030f..757fced7c 100644 --- a/data/windows/README.txt +++ b/data/windows/README.txt @@ -13,9 +13,9 @@ Features * GIG, SF2 and SFZ sound banks * Internal audio and midi file player * Automation of plugin parameters via MIDI CC -* Full OSC control -* Rack and Patchbay engine modes, plus Single and Multi-Client if using JACK -* Native audio drivers (ALSA, DirectSound, CoreAudio) and low-latency (ASIO and JACK) +* Remote control over OSC +* Rack and Patchbay processing modes, plus Single and Multi-Client if using JACK +* Native audio drivers (ALSA, DirectSound, CoreAudio, etc) and JACK In experimental phase / work in progress: * Export any Carla loadable plugin or sound bank as an LV2 plugin From 4bf8e3b9920d568cba9f3c39cd6171331037703a Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 22 Jan 2018 00:43:06 +0100 Subject: [PATCH 30/37] Fix libjack make clean --- source/libjack/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/libjack/Makefile b/source/libjack/Makefile index 4e6985f60..fe29759ce 100644 --- a/source/libjack/Makefile +++ b/source/libjack/Makefile @@ -27,11 +27,8 @@ LINK_FLAGS += -lpthread -lrt # ---------------------------------------------------------------------------------------------------------------------- -OBJS = -TARGETS = - ifeq ($(LINUX),true) -OBJS = \ +OBJS = \ $(OBJDIR)/libjack.cpp.o \ $(OBJDIR)/libjack_base.cpp.o \ $(OBJDIR)/libjack_callbacks.cpp.o \ @@ -49,6 +46,8 @@ OBJS = \ $(OBJDIR)/libjack_transport.cpp.o \ $(OBJDIR)/ringbuffer.c.o TARGET = $(BINDIR)/jack/libjack.so.0 +else +OBJS = endif # ---------------------------------------------------------------------------------------------------------------------- @@ -58,7 +57,7 @@ all: $(TARGET) # ---------------------------------------------------------------------------------------------------------------------- clean: - rm -f $(OBJDIR)/*.o $(TARGETS) + rm -f $(OBJDIR)/*.o $(TARGET) debug: $(MAKE) DEBUG=true From c9e0919184d3e67af245998f71e7292caf9db89d Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 22 Jan 2018 00:14:05 +0000 Subject: [PATCH 31/37] Disable link on macOS, for now --- source/carla_host.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/carla_host.py b/source/carla_host.py index 91fbae39d..f8506e788 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -309,6 +309,9 @@ class HostWindow(QMainWindow): self.ui.cb_transport_link.setEnabled(False) self.ui.dsb_transport_bpm.setEnabled(False) + if MACOS: + self.ui.cb_transport_link.setEnabled(False) + self.ui.w_transport.setEnabled(False) # ---------------------------------------------------------------------------------------------------- From 51766b5452bc05073843831471945eaeaf49ace4 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 22 Jan 2018 21:36:12 +0100 Subject: [PATCH 32/37] Fix path to deps inside linux chroot in build script --- data/linux/build-all.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/data/linux/build-all.sh b/data/linux/build-all.sh index 761056adb..96ebcdc2e 100755 --- a/data/linux/build-all.sh +++ b/data/linux/build-all.sh @@ -176,6 +176,7 @@ chroot_build_carla() { CHROOT_DIR=${TARGETDIR}/chroot${ARCH} +CHROOT_TARGET_DIR=/root/builds cat < Date: Mon, 22 Jan 2018 21:47:49 +0100 Subject: [PATCH 33/37] Make it possible to skip zyn-synth as plugin --- data/linux/build-all.sh | 1 + source/native-plugins/_all.all.c | 3 +-- source/native-plugins/_all.base.c | 3 +-- source/native-plugins/_data.all.cpp | 3 +-- source/native-plugins/_data.base.cpp | 3 +-- source/native-plugins/external/Makefile | 2 +- source/native-plugins/external/Makefile.mk | 5 +++++ source/native-plugins/external/_all.c | 4 ++-- source/native-plugins/external/_data.cpp | 6 +++--- 9 files changed, 16 insertions(+), 14 deletions(-) diff --git a/data/linux/build-all.sh b/data/linux/build-all.sh index 96ebcdc2e..77390dddd 100755 --- a/data/linux/build-all.sh +++ b/data/linux/build-all.sh @@ -25,6 +25,7 @@ source common.env CHROOT_CARLA_DIR="/tmp/carla-src" PKG_FOLDER="Carla_2.0-beta6-linux" +export MAKE_ARGS="${MAKE_ARGS} SKIP_ZYN_SYNTH=true" # --------------------------------------------------------------------------------------------------------------------- # function to remove old stuff diff --git a/source/native-plugins/_all.all.c b/source/native-plugins/_all.all.c index fd3043c40..1d102bca7 100644 --- a/source/native-plugins/_all.all.c +++ b/source/native-plugins/_all.all.c @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2012-2017 Filipe Coelho + * Copyright (C) 2012-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -19,7 +19,6 @@ #include "CarlaNative.h" #ifdef CARLA_OS_WIN -# define DISABLE_PLUGINS_FOR_WINDOWS_BUILD # undef HAVE_PYQT #endif diff --git a/source/native-plugins/_all.base.c b/source/native-plugins/_all.base.c index 44edcc844..24f80c4a8 100644 --- a/source/native-plugins/_all.base.c +++ b/source/native-plugins/_all.base.c @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2012-2017 Filipe Coelho + * Copyright (C) 2012-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -19,7 +19,6 @@ #include "CarlaNative.h" #ifdef CARLA_OS_WIN -# define DISABLE_PLUGINS_FOR_WINDOWS_BUILD # undef HAVE_PYQT #endif diff --git a/source/native-plugins/_data.all.cpp b/source/native-plugins/_data.all.cpp index f0380acdb..ecbf9fac6 100644 --- a/source/native-plugins/_data.all.cpp +++ b/source/native-plugins/_data.all.cpp @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2012-2017 Filipe Coelho + * Copyright (C) 2012-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,7 +20,6 @@ #include "CarlaUtils.hpp" #ifdef CARLA_OS_WIN -# define DISABLE_PLUGINS_FOR_WINDOWS_BUILD # undef HAVE_PYQT #endif diff --git a/source/native-plugins/_data.base.cpp b/source/native-plugins/_data.base.cpp index 37056c40d..0956d3514 100644 --- a/source/native-plugins/_data.base.cpp +++ b/source/native-plugins/_data.base.cpp @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2012-2017 Filipe Coelho + * Copyright (C) 2012-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,7 +20,6 @@ #include "CarlaUtils.hpp" #ifdef CARLA_OS_WIN -# define DISABLE_PLUGINS_FOR_WINDOWS_BUILD # undef HAVE_PYQT #endif diff --git a/source/native-plugins/external/Makefile b/source/native-plugins/external/Makefile index c20660420..6a31bf2c6 100644 --- a/source/native-plugins/external/Makefile +++ b/source/native-plugins/external/Makefile @@ -37,7 +37,7 @@ OBJS_all += \ $(OBJDIR)/zynaddsubfx-fx.cpp.o \ $(OBJDIR)/zynaddsubfx-src.cpp.o -ifneq ($(MACOS_OR_WIN32),true) +ifneq ($(SKIP_ZYN_SYNTH),true) OBJS_all += \ $(OBJDIR)/zynaddsubfx-synth.cpp.o endif diff --git a/source/native-plugins/external/Makefile.mk b/source/native-plugins/external/Makefile.mk index 296db656a..58028bf46 100644 --- a/source/native-plugins/external/Makefile.mk +++ b/source/native-plugins/external/Makefile.mk @@ -12,6 +12,7 @@ endif ifeq ($(MACOS_OR_WIN32),true) HAVE_DGL = true +SKIP_ZYN_SYNTH = true else HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true) endif @@ -125,6 +126,9 @@ ZYN_DSP_FLAGS += $(shell pkg-config --cflags fftw3 zlib) ZYN_DSP_LIBS = $(ZYN_BASE_LIBS) ZYN_DSP_LIBS += $(shell pkg-config --libs fftw3 zlib) +ifeq ($(SKIP_ZYN_SYNTH),true) +ZYN_DSP_LIBS += -DSKIP_ZYN_SYNTH +else # UI flags ifeq ($(HAVE_ZYN_UI_DEPS),true) @@ -156,6 +160,7 @@ else # HAVE_ZYN_UI_DEPS ZYN_DSP_FLAGS += -DNO_UI +endif # SKIP_ZYN_SYNTH endif # HAVE_ZYN_UI_DEPS endif # HAVE_ZYN_DEPS diff --git a/source/native-plugins/external/_all.c b/source/native-plugins/external/_all.c index 2bd3e300f..bd096fdd1 100644 --- a/source/native-plugins/external/_all.c +++ b/source/native-plugins/external/_all.c @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2012-2017 Filipe Coelho + * Copyright (C) 2012-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -62,7 +62,7 @@ void carla_register_all_native_external_plugins(void) #ifdef HAVE_ZYN_DEPS // ZynAddSubFX carla_register_native_plugin_zynaddsubfx_fx(); -# ifndef DISABLE_PLUGINS_FOR_WINDOWS_BUILD +# ifndef SKIP_ZYN_SYNTH carla_register_native_plugin_zynaddsubfx_synth(); # endif #endif diff --git a/source/native-plugins/external/_data.cpp b/source/native-plugins/external/_data.cpp index 6e71e7198..9e20f6a36 100644 --- a/source/native-plugins/external/_data.cpp +++ b/source/native-plugins/external/_data.cpp @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2012-2017 Filipe Coelho + * Copyright (C) 2012-2018 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -356,7 +356,7 @@ static const NativePluginDescriptor sNativePluginDescriptors[] = { /* copyright */ "GNU GPL v2+", DESCFUNCS }, -# ifndef DISABLE_PLUGINS_FOR_WINDOWS_BUILD +# ifndef SKIP_ZYN_SYNTH { /* category */ NATIVE_PLUGIN_CATEGORY_SYNTH, /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH @@ -381,7 +381,7 @@ static const NativePluginDescriptor sNativePluginDescriptors[] = { /* copyright */ "GNU GPL v2+", DESCFUNCS }, -# endif // ! DISABLE_PLUGINS_FOR_WINDOWS_BUILD +# endif // ! SKIP_ZYN_SYNTH #endif // HAVE_ZYN_DEPS // -------------------------------------------------------------------------------------------------------------------- From 19dcd42531c1733c156543f30ecd28a76b2d65f9 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 22 Jan 2018 21:50:25 +0100 Subject: [PATCH 34/37] Fix chroot linux build --- source/native-plugins/zynaddsubfx-src.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/native-plugins/zynaddsubfx-src.cpp b/source/native-plugins/zynaddsubfx-src.cpp index ee6520e40..fc7ded22b 100644 --- a/source/native-plugins/zynaddsubfx-src.cpp +++ b/source/native-plugins/zynaddsubfx-src.cpp @@ -39,7 +39,7 @@ #include "zynaddsubfx/tlsf/tlsf.h" #include "zynaddsubfx/rtosc/rtosc.h" -#ifdef CARLA_OS_WIN +#ifdef SKIP_ZYN_SYNTH # define PRId64 P_INT64 # define PRIi64 P_INT64 # define PRIx64 P_UINT64 From 82e7e1a46f60b3c46574aecf7fc2a6194c69bb00 Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 22 Jan 2018 21:54:19 +0100 Subject: [PATCH 35/37] Cleanup --- source/native-plugins/zynaddsubfx-src.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/source/native-plugins/zynaddsubfx-src.cpp b/source/native-plugins/zynaddsubfx-src.cpp index fc7ded22b..c85364612 100644 --- a/source/native-plugins/zynaddsubfx-src.cpp +++ b/source/native-plugins/zynaddsubfx-src.cpp @@ -48,10 +48,6 @@ # define PRIx32 "%x" #endif -#if ! (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) -# define CARLA_ZYN_FULL -#endif - // C-code includes extern "C" { #include "zynaddsubfx/tlsf/tlsf.c" @@ -88,7 +84,7 @@ extern "C" { // zynaddsubfx includes #include "zynaddsubfx/version.cpp" -#ifdef CARLA_ZYN_FULL +#ifndef SKIP_ZYN_SYNTH #include "zynaddsubfx/Containers/MultiPseudoStack.cpp" #undef rBegin #undef rObject @@ -354,7 +350,7 @@ extern "C" { #define rChangeCb #include "zynaddsubfx/globals.cpp" -#endif // CARLA_ZYN_FULL +#endif // ! SKIP_ZYN_SYNTH #include "zynaddsubfx/DSP/AnalogFilter.cpp" #undef rBegin @@ -566,7 +562,7 @@ extern "C" { # pragma GCC diagnostic pop #endif -#ifdef CARLA_ZYN_FULL +#ifndef SKIP_ZYN_SYNTH // Dummy variables and functions for linking purposes namespace zyncarla { class WavFile; @@ -583,7 +579,7 @@ namespace Nio { void waveStop(){} } } -#endif // CARLA_ZYN_FULL +#endif // ! SKIP_ZYN_SYNTH rtosc_version rtosc_current_version() { From 0aadc15c16478dc23d3949d2ff45dbf571d364cb Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 22 Jan 2018 22:02:28 +0100 Subject: [PATCH 36/37] Only build zyn pretty format on windows, for its symbols --- source/native-plugins/zynaddsubfx-src.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/native-plugins/zynaddsubfx-src.cpp b/source/native-plugins/zynaddsubfx-src.cpp index c85364612..4161ba34b 100644 --- a/source/native-plugins/zynaddsubfx-src.cpp +++ b/source/native-plugins/zynaddsubfx-src.cpp @@ -64,8 +64,10 @@ extern "C" { #undef tlsf_insist #include "zynaddsubfx/rtosc/dispatch.c" -#include "zynaddsubfx/rtosc/pretty-format.c" #include "zynaddsubfx/rtosc/rtosc.c" +#ifdef CARLA_OS_WIN +# include "zynaddsubfx/rtosc/pretty-format.c" +#endif } // rtosc includes @@ -581,6 +583,7 @@ namespace Nio { } #endif // ! SKIP_ZYN_SYNTH +#ifdef CARLA_OS_WIN rtosc_version rtosc_current_version() { return ((rtosc_version) { 0, 0, 0 } ); @@ -592,3 +595,4 @@ void rtosc_version_print_to_12byte_str(const rtosc_version* v, snprintf(_12bytes, 12, "%u.%u.%u", (unsigned)v->major, (unsigned)v->minor, (unsigned)v->revision); } +#endif From 8d2cde3041cae6889e78ee13901a6bdb9533e6ed Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 22 Jan 2018 22:05:35 +0100 Subject: [PATCH 37/37] Fix chroot build --- source/native-plugins/external/Makefile.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/native-plugins/external/Makefile.mk b/source/native-plugins/external/Makefile.mk index 58028bf46..36e9123a7 100644 --- a/source/native-plugins/external/Makefile.mk +++ b/source/native-plugins/external/Makefile.mk @@ -127,7 +127,7 @@ ZYN_DSP_LIBS = $(ZYN_BASE_LIBS) ZYN_DSP_LIBS += $(shell pkg-config --libs fftw3 zlib) ifeq ($(SKIP_ZYN_SYNTH),true) -ZYN_DSP_LIBS += -DSKIP_ZYN_SYNTH +BASE_FLAGS += -DSKIP_ZYN_SYNTH else # UI flags ifeq ($(HAVE_ZYN_UI_DEPS),true)