Browse Source

Set custom carla namespace; fix macOS resizing

tags/v1.0
falkTX 3 years ago
parent
commit
ce6e878277
7 changed files with 41 additions and 37 deletions
  1. +1
    -1
      Makefile
  2. +1
    -1
      carla
  3. +1
    -1
      dpf
  4. +1
    -1
      plugins/Common/IldaeilPlugin.cpp
  5. +1
    -1
      plugins/Common/IldaeilUI.cpp
  6. +1
    -0
      plugins/Common/Makefile.mk
  7. +35
    -32
      plugins/Common/PluginHostWindow.cpp

+ 1
- 1
Makefile View File

@@ -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 \


+ 1
- 1
carla

@@ -1 +1 @@
Subproject commit c6ca5ca23da7a38b749bf08979eada555bc04e45
Subproject commit 1f5e44c4bb4926298e4a9d666436671f2d12e5ff

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit 96d5def58d97dc4e68c0682b7d2cf718a7c393b0
Subproject commit af042cb682d693e9ce5b87a145e6c704be31adf8

+ 1
- 1
plugins/Common/IldaeilPlugin.cpp View File

@@ -44,7 +44,7 @@ static intptr_t host_dispatcher(NativeHostHandle handle, NativeHostDispatcherOpc
// --------------------------------------------------------------------------------------------------------------------
using namespace CarlaBackend;
using namespace CARLA_BACKEND_NAMESPACE;
class IldaeilPlugin : public IldaeilBasePlugin
{


+ 1
- 1
plugins/Common/IldaeilUI.cpp View File

@@ -47,7 +47,7 @@ START_NAMESPACE_DISTRHO

// --------------------------------------------------------------------------------------------------------------------

using namespace CarlaBackend;
using namespace CARLA_BACKEND_NAMESPACE;

class IldaeilUI : public UI,
public Thread,


+ 1
- 0
plugins/Common/Makefile.mk View File

@@ -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


+ 35
- 32
plugins/Common/PluginHostWindow.cpp View File

@@ -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)
{


Loading…
Cancel
Save