diff --git a/Makefile b/Makefile index 04a8af9..b98f8e9 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ all: carla dgl plugins gen # -------------------------------------------------------------- # Carla config -CARLA_EXTRA_ARGS = \ +CARLA_EXTRA_ARGS = CARLA_BACKEND_NAMESPACE=Ildaeil \ HAVE_FFMPEG=false \ HAVE_FLUIDSYNTH=false \ HAVE_PROJECTM=false \ diff --git a/carla b/carla index c6ca5ca..1f5e44c 160000 --- a/carla +++ b/carla @@ -1 +1 @@ -Subproject commit c6ca5ca23da7a38b749bf08979eada555bc04e45 +Subproject commit 1f5e44c4bb4926298e4a9d666436671f2d12e5ff diff --git a/dpf b/dpf index 96d5def..af042cb 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 96d5def58d97dc4e68c0682b7d2cf718a7c393b0 +Subproject commit af042cb682d693e9ce5b87a145e6c704be31adf8 diff --git a/plugins/Common/IldaeilPlugin.cpp b/plugins/Common/IldaeilPlugin.cpp index 35127be..6e2bde8 100644 --- a/plugins/Common/IldaeilPlugin.cpp +++ b/plugins/Common/IldaeilPlugin.cpp @@ -44,7 +44,7 @@ static intptr_t host_dispatcher(NativeHostHandle handle, NativeHostDispatcherOpc // -------------------------------------------------------------------------------------------------------------------- -using namespace CarlaBackend; +using namespace CARLA_BACKEND_NAMESPACE; class IldaeilPlugin : public IldaeilBasePlugin { diff --git a/plugins/Common/IldaeilUI.cpp b/plugins/Common/IldaeilUI.cpp index 03269d8..afe32b1 100644 --- a/plugins/Common/IldaeilUI.cpp +++ b/plugins/Common/IldaeilUI.cpp @@ -47,7 +47,7 @@ START_NAMESPACE_DISTRHO // -------------------------------------------------------------------------------------------------------------------- -using namespace CarlaBackend; +using namespace CARLA_BACKEND_NAMESPACE; class IldaeilUI : public UI, public Thread, diff --git a/plugins/Common/Makefile.mk b/plugins/Common/Makefile.mk index 9ee289d..9c034fe 100644 --- a/plugins/Common/Makefile.mk +++ b/plugins/Common/Makefile.mk @@ -60,6 +60,7 @@ BUILD_CXX_FLAGS += -I../Common BUILD_CXX_FLAGS += -I../../dpf-widgets/generic BUILD_CXX_FLAGS += -I../../dpf-widgets/opengl +BUILD_CXX_FLAGS += -DCARLA_BACKEND_NAMESPACE=Ildaeil BUILD_CXX_FLAGS += -DREAL_BUILD BUILD_CXX_FLAGS += -DSTATIC_PLUGIN_TARGET BUILD_CXX_FLAGS += -I../../carla/source/backend diff --git a/plugins/Common/PluginHostWindow.cpp b/plugins/Common/PluginHostWindow.cpp index 61b6630..64c9a2a 100644 --- a/plugins/Common/PluginHostWindow.cpp +++ b/plugins/Common/PluginHostWindow.cpp @@ -32,18 +32,6 @@ #include "PluginHostWindow.hpp" -#ifdef DISTRHO_OS_MAC -@interface IldaeilPluginView : NSView -- (void)resizeWithOldSuperviewSize:(NSSize)oldSize; -@end -@implementation IldaeilPluginView -- (void)resizeWithOldSuperviewSize:(NSSize)oldSize -{ - [super resizeWithOldSuperviewSize:oldSize]; -} -@end -#endif - START_NAMESPACE_DGL #if defined(DISTRHO_OS_HAIKU) @@ -67,7 +55,8 @@ struct PluginHostWindow::PrivateData #if defined(DISTRHO_OS_HAIKU) #elif defined(DISTRHO_OS_MAC) - IldaeilPluginView* view; + NSView* view; + NSView* subview; #elif defined(DISTRHO_OS_WINDOWS) ::HWND pluginWindow; #else @@ -85,6 +74,7 @@ struct PluginHostWindow::PrivateData #if defined(DISTRHO_OS_HAIKU) #elif defined(DISTRHO_OS_MAC) view(nullptr), + subview(nullptr), #elif defined(DISTRHO_OS_WINDOWS) pluginWindow(nullptr), #else @@ -97,11 +87,10 @@ struct PluginHostWindow::PrivateData { #if defined(DISTRHO_OS_HAIKU) #elif defined(DISTRHO_OS_MAC) - view = [[IldaeilPluginView new]retain]; + view = [[NSView new]retain]; DISTRHO_SAFE_ASSERT_RETURN(view != nullptr,) - [view setAutoresizingMask:NSViewNotSizable]; - [view setAutoresizesSubviews:YES]; + [view setAutoresizesSubviews:NO]; [view setHidden:YES]; [(NSView*)parentWindowId addSubview:view]; #elif defined(DISTRHO_OS_WINDOWS) @@ -130,6 +119,7 @@ struct PluginHostWindow::PrivateData #if defined(DISTRHO_OS_HAIKU) return nullptr; #elif defined(DISTRHO_OS_MAC) + subview = nullptr; return view; #elif defined(DISTRHO_OS_WINDOWS) pluginWindow = nullptr; @@ -167,27 +157,21 @@ struct PluginHostWindow::PrivateData if (view == nullptr) return; - for (NSView* subview in [view subviews]) + if (subview == nullptr) { - const double scaleFactor = [[[view window] screen] backingScaleFactor]; - const NSSize size = [subview frame].size; - const double width = size.width; - const double height = size.height; - - if (width <= 1 || height <= 1) + for (NSView* subview2 in [view subviews]) + { + subview = subview2; break; - - lookingForChildren = false; - [view setFrameSize:size]; - [view setHidden:NO]; - [view setNeedsDisplay:YES]; - pluginWindowCallbacks->pluginWindowResized(width * scaleFactor, height * scaleFactor); - break; + } } #elif defined(DISTRHO_OS_WINDOWS) if (pluginWindow == nullptr) pluginWindow = FindWindowExA((::HWND)parentWindowId, nullptr, nullptr, nullptr); #else + if (display == nullptr) + return; + if (pluginWindow == 0) { ::Window rootWindow, parentWindow; @@ -207,6 +191,25 @@ struct PluginHostWindow::PrivateData #if defined(DISTRHO_OS_HAIKU) #elif defined(DISTRHO_OS_MAC) + if (subview != nullptr) + { + const double scaleFactor = [[[view window] screen] backingScaleFactor]; + const NSSize size = [subview frame].size; + const double width = size.width; + const double height = size.height; + + if (lookingForChildren) + d_stdout("child window bounds %f %f | offset %u %u", width, height, xOffset, yOffset); + + if (width > 1.0 && height > 1.0) + { + lookingForChildren = false; + [view setFrameSize:size]; + [view setHidden:NO]; + [view setNeedsDisplay:YES]; + pluginWindowCallbacks->pluginWindowResized(width * scaleFactor, height * scaleFactor); + } + } #elif defined(DISTRHO_OS_WINDOWS) if (pluginWindow != nullptr) { @@ -221,7 +224,7 @@ struct PluginHostWindow::PrivateData } if (lookingForChildren) - d_stdout("child window bounds %u %u | offset %u %u", width, height, xOffset, yOffset); + d_stdout("child window bounds %i %i | offset %u %u", width, height, xOffset, yOffset); if (width > 1 && height > 1) { @@ -274,7 +277,7 @@ struct PluginHostWindow::PrivateData } if (lookingForChildren) - d_stdout("child window bounds %u %u | offset %u %u", width, height, xOffset, yOffset); + d_stdout("child window bounds %i %i | offset %u %u", width, height, xOffset, yOffset); if (width > 1 && height > 1) {