diff --git a/carla b/carla index 1e3b910..0b250a0 160000 --- a/carla +++ b/carla @@ -1 +1 @@ -Subproject commit 1e3b910d014f7f7d44e8b3b76eb47efad2121e4f +Subproject commit 0b250a0cb73e4967ca9db0e2065b430c0530c128 diff --git a/dpf b/dpf index ce3f6c1..7040dfc 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit ce3f6c1147a82efd50107aa3ae9f4f99df6f2e53 +Subproject commit 7040dfce1a4e270e79468c0ced0cd9de63cda999 diff --git a/plugins/Common/IldaeilPlugin.cpp b/plugins/Common/IldaeilPlugin.cpp index e10861c..af982fc 100644 --- a/plugins/Common/IldaeilPlugin.cpp +++ b/plugins/Common/IldaeilPlugin.cpp @@ -1,6 +1,6 @@ /* * DISTRHO Ildaeil Plugin - * Copyright (C) 2021-2023 Filipe Coelho + * Copyright (C) 2021-2024 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 @@ -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 } /* -------------------------------------------------------------------------------------------------------- diff --git a/plugins/Common/IldaeilUI.cpp b/plugins/Common/IldaeilUI.cpp index a7012de..6e2356a 100644 --- a/plugins/Common/IldaeilUI.cpp +++ b/plugins/Common/IldaeilUI.cpp @@ -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) diff --git a/plugins/Common/Makefile.mk b/plugins/Common/Makefile.mk index 578d710..35955fe 100644 --- a/plugins/Common/Makefile.mk +++ b/plugins/Common/Makefile.mk @@ -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 diff --git a/plugins/Common/PluginHostWindow.cpp b/plugins/Common/PluginHostWindow.cpp index 3c25197..9dfb4dd 100644 --- a/plugins/Common/PluginHostWindow.cpp +++ b/plugins/Common/PluginHostWindow.cpp @@ -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 diff --git a/plugins/Common/PluginHostWindow.hpp b/plugins/Common/PluginHostWindow.hpp index 8566557..ce8d428 100644 --- a/plugins/Common/PluginHostWindow.hpp +++ b/plugins/Common/PluginHostWindow.hpp @@ -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 diff --git a/plugins/FX/DistrhoPluginInfo.h b/plugins/FX/DistrhoPluginInfo.h index c9dc377..402932c 100644 --- a/plugins/FX/DistrhoPluginInfo.h +++ b/plugins/FX/DistrhoPluginInfo.h @@ -1,6 +1,6 @@ /* * DISTRHO Ildaeil Plugin - * Copyright (C) 2021-2023 Filipe Coelho + * Copyright (C) 2021-2024 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 @@ -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; diff --git a/plugins/Synth/DistrhoPluginInfo.h b/plugins/Synth/DistrhoPluginInfo.h index 340f00a..d2034fc 100644 --- a/plugins/Synth/DistrhoPluginInfo.h +++ b/plugins/Synth/DistrhoPluginInfo.h @@ -1,6 +1,6 @@ /* * DISTRHO Ildaeil Plugin - * Copyright (C) 2021-2023 Filipe Coelho + * Copyright (C) 2021-2024 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 @@ -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;