Browse Source

Update carla and dpf, get macOS behaviour the same level as others

Signed-off-by: falkTX <falktx@falktx.com>
main
falkTX 1 year ago
parent
commit
4b7cdebaf2
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
9 changed files with 51 additions and 71 deletions
  1. +1
    -1
      carla
  2. +1
    -1
      dpf
  3. +6
    -6
      plugins/Common/IldaeilPlugin.cpp
  4. +3
    -10
      plugins/Common/IldaeilUI.cpp
  5. +5
    -2
      plugins/Common/Makefile.mk
  6. +24
    -48
      plugins/Common/PluginHostWindow.cpp
  7. +1
    -1
      plugins/Common/PluginHostWindow.hpp
  8. +5
    -1
      plugins/FX/DistrhoPluginInfo.h
  9. +5
    -1
      plugins/Synth/DistrhoPluginInfo.h

+ 1
- 1
carla

@@ -1 +1 @@
Subproject commit 1e3b910d014f7f7d44e8b3b76eb47efad2121e4f
Subproject commit 0b250a0cb73e4967ca9db0e2065b430c0530c128

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit ce3f6c1147a82efd50107aa3ae9f4f99df6f2e53
Subproject commit 7040dfce1a4e270e79468c0ced0cd9de63cda999

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

@@ -1,6 +1,6 @@
/*
* DISTRHO Ildaeil Plugin
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -585,15 +585,15 @@ protected:
int64_t getUniqueId() const override
{
#if ILDAEIL_STANDALONE
#if ILDAEIL_STANDALONE
return d_cconst('d', 'I', 'l', 'd');
#elif DISTRHO_PLUGIN_IS_SYNTH
#elif DISTRHO_PLUGIN_IS_SYNTH
return d_cconst('d', 'I', 'l', 'S');
#elif DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
#elif DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
return d_cconst('d', 'I', 'l', 'M');
#else
#else
return d_cconst('d', 'I', 'l', 'F');
#endif
#endif
}
/* --------------------------------------------------------------------------------------------------------


+ 3
- 10
plugins/Common/IldaeilUI.cpp View File

@@ -258,15 +258,12 @@ public:
{
setGeometryConstraints(kMinWidth * scaleFactor, kMinHeight * scaleFactor);
setSize(kInitialWidth * scaleFactor, kInitialHeight * scaleFactor);
fPluginHostWindow.setPositionAndSize(0, kButtonHeight * scaleFactor + paddingY,
kInitialWidth * scaleFactor,
(kInitialHeight - kButtonHeight) * scaleFactor - paddingY);
fPluginHostWindow.setOffset(0, kButtonHeight * scaleFactor + paddingY);
}
else
{
setGeometryConstraints(kMinWidth, kMinHeight);
fPluginHostWindow.setPositionAndSize(0, kButtonHeight + paddingY,
kInitialWidth, kInitialHeight - kButtonHeight - paddingY);
fPluginHostWindow.setOffset(0, kButtonHeight + paddingY);
}

const CarlaHostHandle handle = fPlugin->fCarlaHostHandle;
@@ -672,8 +669,6 @@ protected:
const CarlaHostHandle handle = fPlugin->fCarlaHostHandle;
DISTRHO_SAFE_ASSERT_RETURN(handle != nullptr,);

// carla_juce_idle();

if (fDrawingState == kDrawingPluginGenericUI && fPluginGenericUI != nullptr && fPluginHasOutputParameters)
{
updatePluginGenericUI(handle);
@@ -1028,9 +1023,7 @@ protected:
#elif DISTRHO_PLUGIN_IS_SYNTH
if (info->io.midiIns != 1)
return;
if (info->io.audioIns == 0)
return;
if ((info->metadata.hints & PLUGIN_IS_SYNTH) == 0x0)
if (info->io.audioOuts == 0)
return;
#elif DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
if ((info->io.midiIns != 1 && info->io.audioIns != 0 && info->io.audioOuts != 0) || info->io.midiOuts != 1)


+ 5
- 2
plugins/Common/Makefile.mk View File

@@ -126,9 +126,9 @@ else
TARGETS_BASE = lv2 vst2 clap
TARGETS_EXTRA = carlabins

# VST3 does not do MIDI filter plugins, by design
# Skip MIDI filter for AUv2 and VST3, which deal with pure MIDI plugins in a weird way
ifneq ($(NAME),Ildaeil-MIDI)
TARGETS_BASE += vst3
TARGETS_BASE += vst3 au
endif

endif
@@ -175,6 +175,9 @@ else
install -m 755 $(CARLA_BINARIES) $(shell dirname $(vst2))
install -m 755 $(CARLA_BINARIES) $(shell dirname $(clap))
ifneq ($(NAME),Ildaeil-MIDI)
ifeq ($(MACOS),true)
install -m 755 $(CARLA_BINARIES) $(shell dirname $(au))
endif
install -m 755 $(CARLA_BINARIES) $(shell dirname $(vst3))
endif
endif


+ 24
- 48
plugins/Common/PluginHostWindow.cpp View File

@@ -57,8 +57,7 @@ struct PluginHostWindow::PrivateData

#if defined(DISTRHO_OS_HAIKU)
#elif defined(DISTRHO_OS_MAC)
NSView* view;
NSView* subview;
NSView* pluginView;
#elif defined(DISTRHO_OS_WASM)
#elif defined(DISTRHO_OS_WINDOWS)
::HWND pluginWindow;
@@ -76,8 +75,7 @@ struct PluginHostWindow::PrivateData
pluginWindowCallbacks(cbs),
#if defined(DISTRHO_OS_HAIKU)
#elif defined(DISTRHO_OS_MAC)
view(nullptr),
subview(nullptr),
pluginView(nullptr),
#elif defined(DISTRHO_OS_WASM)
#elif defined(DISTRHO_OS_WINDOWS)
pluginWindow(nullptr),
@@ -91,12 +89,6 @@ struct PluginHostWindow::PrivateData
{
#if defined(DISTRHO_OS_HAIKU)
#elif defined(DISTRHO_OS_MAC)
view = [[NSView new]retain];
DISTRHO_SAFE_ASSERT_RETURN(view != nullptr,)
[view setAutoresizingMask:NSViewNotSizable];
[view setAutoresizesSubviews:NO];
[view setHidden:YES];
[(NSView*)parentWindowId addSubview:view];
#elif defined(DISTRHO_OS_WASM)
#elif defined(DISTRHO_OS_WINDOWS)
#else
@@ -109,8 +101,6 @@ struct PluginHostWindow::PrivateData
{
#if defined(DISTRHO_OS_HAIKU)
#elif defined(DISTRHO_OS_MAC)
if (view != nullptr)
[view release];
#elif defined(DISTRHO_OS_WASM)
#elif defined(DISTRHO_OS_WINDOWS)
#else
@@ -125,8 +115,8 @@ struct PluginHostWindow::PrivateData
#if defined(DISTRHO_OS_HAIKU)
return nullptr;
#elif defined(DISTRHO_OS_MAC)
subview = nullptr;
return view;
pluginView = nullptr;
return (void*)parentWindowId;
#elif defined(DISTRHO_OS_WASM)
return nullptr;
#elif defined(DISTRHO_OS_WINDOWS)
@@ -142,9 +132,10 @@ struct PluginHostWindow::PrivateData
{
#if defined(DISTRHO_OS_HAIKU)
#elif defined(DISTRHO_OS_MAC)
if (view != nullptr)
if (pluginView != nullptr)
{
[view setHidden:YES];
[pluginView setHidden:YES];
pluginView = nullptr;
[NSOpenGLContext clearCurrentContext];
return true;
}
@@ -174,14 +165,17 @@ struct PluginHostWindow::PrivateData
{
#if defined(DISTRHO_OS_HAIKU)
#elif defined(DISTRHO_OS_MAC)
if (view == nullptr)
return;

if (subview == nullptr)
if (pluginView == nullptr)
{
for (NSView* subview2 in [view subviews])
bool first = true;
for (NSView* view in [(NSView*)parentWindowId subviews])
{
subview = subview2;
if (first)
{
first = false;
continue;
}
pluginView = view;
break;
}
}
@@ -214,10 +208,10 @@ struct PluginHostWindow::PrivateData

#if defined(DISTRHO_OS_HAIKU)
#elif defined(DISTRHO_OS_MAC)
if (subview != nullptr)
if (pluginView != nullptr)
{
const double scaleFactor = [[[view window] screen] backingScaleFactor];
const NSSize size = [subview frame].size;
const double scaleFactor = [[[pluginView window] screen] backingScaleFactor];
const NSSize size = [pluginView frame].size;
const double width = size.width;
const double height = size.height;

@@ -227,9 +221,8 @@ struct PluginHostWindow::PrivateData
if (width > 1.0 && height > 1.0)
{
lookingForChildren = false;
[view setFrameSize:size];
[view setHidden:NO];
[view setNeedsDisplay:YES];
[pluginView setFrameOrigin:NSMakePoint(xOffset / scaleFactor, yOffset / scaleFactor)];
[pluginView setNeedsDisplay:YES];
pluginWindowCallbacks->pluginWindowResized(width * scaleFactor, height * scaleFactor);
}
}
@@ -317,25 +310,8 @@ struct PluginHostWindow::PrivateData
#endif
}

void setPositionAndSize(const uint x, const uint y, const uint width, const uint height)
void setOffset(const uint x, const uint y)
{
#if defined(DISTRHO_OS_HAIKU)
#elif defined(DISTRHO_OS_MAC)
if (view != nullptr)
{
const double scaleFactor = [[[view window] screen] backingScaleFactor];
[view setFrame:NSMakeRect(x / scaleFactor, y / scaleFactor, width / scaleFactor, height / scaleFactor)];
}
#elif defined(DISTRHO_OS_WASM)
#elif defined(DISTRHO_OS_WINDOWS)
// unused
(void)width;
(void)height;
#else
// unused
(void)width;
(void)height;
#endif
xOffset = x;
yOffset = y;
}
@@ -364,9 +340,9 @@ void PluginHostWindow::idle()
pData->idle();
}

void PluginHostWindow::setPositionAndSize(const uint x, const uint y, const uint width, const uint height)
void PluginHostWindow::setOffset(const uint x, const uint y)
{
pData->setPositionAndSize(x, y, width, height);
pData->setOffset(x, y);
}

END_NAMESPACE_DGL

+ 1
- 1
plugins/Common/PluginHostWindow.hpp View File

@@ -38,7 +38,7 @@ public:
void* attachAndGetWindowHandle();
bool hide();
void idle();
void setPositionAndSize(uint x, uint y, uint width, uint height);
void setOffset(uint x, uint y);
};

END_NAMESPACE_DGL

+ 5
- 1
plugins/FX/DistrhoPluginInfo.h View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Ildaeil Plugin
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -23,6 +23,8 @@
#define DISTRHO_PLUGIN_URI "https://distrho.kx.studio/plugins/ildaeil#fx"
#define DISTRHO_PLUGIN_CLAP_ID "studio.kx.distrho.ildaeil#fx"

#define DISTRHO_PLUGIN_BRAND_ID Dstr
#define DISTRHO_PLUGIN_UNIQUE_ID ilda
#define DISTRHO_PLUGIN_CLAP_FEATURES "audio-effect", "stereo"
#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:UtilityPlugin"
#define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Stereo"
@@ -45,6 +47,8 @@
#define DISTRHO_UI_DEFAULT_WIDTH kInitialWidth
#define DISTRHO_UI_DEFAULT_HEIGHT kInitialHeight

#define DPF_VST3_DONT_USE_BRAND_ID

#define ILDAEIL_STANDALONE 0

static constexpr const uint kInitialWidth = 520;


+ 5
- 1
plugins/Synth/DistrhoPluginInfo.h View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Ildaeil Plugin
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2021-2024 Filipe Coelho <falktx@falktx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -23,6 +23,8 @@
#define DISTRHO_PLUGIN_URI "https://distrho.kx.studio/plugins/ildaeil#synth"
#define DISTRHO_PLUGIN_CLAP_ID "studio.kx.distrho.ildaeil#synth"

#define DISTRHO_PLUGIN_BRAND_ID Dstr
#define DISTRHO_PLUGIN_UNIQUE_ID ilda
#define DISTRHO_PLUGIN_CLAP_FEATURES "instrument", "stereo"
#define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:InstrumentPlugin"
#define DISTRHO_PLUGIN_VST3_CATEGORIES "Instrument|Stereo"
@@ -45,6 +47,8 @@
#define DISTRHO_UI_DEFAULT_WIDTH kInitialWidth
#define DISTRHO_UI_DEFAULT_HEIGHT kInitialHeight

#define DPF_VST3_DONT_USE_BRAND_ID

#define ILDAEIL_STANDALONE 0

static constexpr const uint kInitialWidth = 520;


Loading…
Cancel
Save