Commit Graph

13 Commits

Author SHA1 Message Date
Robin Gareus f2c309d7de Use std pointers in objective C files 2023-03-25 00:07:56 +01:00
Robin Gareus 9cbf3ae4ad
Who needs PIs for Plugin GUIs?
Use abstract base class for plugin UIs wherever possible
2022-04-14 16:35:03 +02:00
Robin Gareus b6c75ef42a
Fix Mac Plugin re/sizing
Some plugin UIs, particularly those that cannot be resized
unset `autoresizesSubviews`. Since the plugin-view is re-parented,
the host has to directly set the view's size.

However some plugins have multiple child views, apparently
for off-screen pixmaps (e.g. UAD plugins). Those additional
should not be resized (or re-stacked).

e.g.

Reason-Rack
  view 0x7fe27e44e570 @ 0, 33 834 x 804
    view 0x7fe288aa3770 @ 278, 268 278 x 268

UAD Tube-tech
  view 0x7fe270a9cbf0 @ 0, 33 1160 x 374
    view 0x7fe28883d030 @ 0, 0 1160 x 374
    view 0x7fe2888546e0 @ 0, 0 1160 x 24


see also aef366c156
https://discourse.ardour.org/t/uad-plugin-will-not-load-shows-as-expired-when-its-not/105756/5?u=x42
2021-04-27 23:50:59 +02:00
Robin Gareus 9f3fba6988
VST3: Prevent recursive endless resizing
Skip call to onSize() when the plugin's size already matches.

https://github.com/Ardour/ardour/pull/599
https://github.com/juce-framework/JUCE/pull/867
https://discourse.ardour.org/t/sonobus-vst3-gui-hogs-cpu-only-when-ran-inside-ardour-on-linux-but-not-windows/105573
2021-03-11 18:19:21 +01:00
Robin Gareus bbc54873ae
VST3: GUI d'tor re-order
We have to call close_view(), which calls IPlugView::removed()
before destroying the parent widget.

Previously ~VST3PluginUI() was called after the derived class
destroyed the owned private `_gui_widget`, `_ns_view` or x11 parent.

On windows that may lead to the hwnd of the window becoming invalid
before the call to ::removed().
2020-12-14 19:29:53 +01:00
Robin Gareus 62a62eaeb3
VST3 resize quirks (Reason, macOS) 2020-11-20 00:05:34 +01:00
Robin Gareus 1effa1d888
Remove debug message (mac VST3 resizing) 2020-11-20 00:00:37 +01:00
Robin Gareus 7e2bb01ff1
VST3: ignore GUI size allocations before realizing the view
This fixes crashes with some VST3s when calling `onSize()` before
attaching thew view (e.g. Reason Rack Plug on macOS).
2020-11-19 23:12:52 +01:00
Robin Gareus 1321999aec
VST3: macOS key forwarding 2020-11-03 12:09:31 +01:00
Robin Gareus b7c9917467
VST3: Fix initial GUI display and window-size 2020-09-23 18:14:57 +02:00
Robin Gareus 2288279e57
No-OP: prefer constants from API header 2020-09-22 22:17:09 +02:00
Robin Gareus 67b1481c12
VST3: work-around endless/recursive resize requests
Some plugins correct their own size when resized which can lead
to endlessly growing GUIs. In particular this issue exists
if Ardour's plugin-toolbar forces a plugin to grow in size to fill
the allocated space. While the plugin aims for fixed aspect-ratio.

This will need a proper solution involving VST's checkSizeConstraint,
however GTK+2 does not have an appropriate API...
2020-09-18 02:11:25 +02:00
Robin Gareus 1759ba96b6
VST3: Plugin GUI support 2020-09-17 00:10:21 +02:00