|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
One embedded WebView editor instance for plugin class P. Owned by the format backends (the VST3 IPlugView object, the CLAP gui extension); plugin authors never touch this class - they only provide editorHtml() and friends.
More...
#include <DSParkWebViewEditor.h>
Public Member Functions | |
| void | pump () noexcept |
| Editor ()=default | |
| ~Editor () | |
| Editor (const Editor &)=delete | |
| Editor & | operator= (const Editor &)=delete |
| bool | create (void *parentWindow, const std::atomic< double > *shadows, const HostCallbacks &host) noexcept |
| void | destroy () noexcept |
| void | setBounds (int width, int height) noexcept |
| void | setVisible (bool visible) noexcept |
| bool | queryParentSize (int &width, int &height) const noexcept |
| bool | created () const noexcept |
Static Public Member Functions | |
| static bool | available () noexcept |
Static Public Attributes | |
| static constexpr bool | kAvailable = (DSPARK_WEBVIEW_BACKEND != 0) |
One embedded WebView editor instance for plugin class P. Owned by the format backends (the VST3 IPlugView object, the CLAP gui extension); plugin authors never touch this class - they only provide editorHtml() and friends.
Lifecycle (all on the host's main thread): create(parent, ...) builds the platform web engine inside the host window and loads the page; setBounds follows host resizes; destroy tears everything down. While alive, the page polls the wrapper's normalized shadows for DSP -> UI sync and pushes edits through HostCallbacks for UI -> DSP.
Definition at line 681 of file DSParkWebViewEditor.h.
|
default |
|
inline |
Definition at line 722 of file DSParkWebViewEditor.h.
|
delete |
|
inlinestaticnoexcept |
Runtime availability: kAvailable AND the platform engine can actually run here. On Linux that means WebKitGTK/GTK3 resolved through dlopen (first call loads it, later calls are free); elsewhere it equals kAvailable. The format backends gate their editor offer on this, so hosts on bare systems fall back to their generic UI cleanly.
Definition at line 697 of file DSParkWebViewEditor.h.
|
inlinenoexcept |
Builds the web engine inside parentWindow (HWND on Windows, NSView* on macOS), loads the user page and starts the bridge. shadows is the wrapper's normalized shadow array (read-only here); host receives UI edits. Returns false when the engine is unavailable (the host then falls back to its generic editor).
Definition at line 734 of file DSParkWebViewEditor.h.
|
inlinenoexcept |
Definition at line 783 of file DSParkWebViewEditor.h.
|
inlinenoexcept |
Tears the web engine down. Safe to call twice; never touches the host window.
Definition at line 746 of file DSParkWebViewEditor.h.
|
delete |
|
inlinenoexcept |
Gives the engine main-loop time from the HOST's run loop. On Linux the format backends call this at ~30 Hz (VST3 IRunLoop timer / CLAP timer-support) to iterate the GLib main context - a plugin must never spin its own GTK loop inside a host. No-op on Windows/macOS, where the host's native message loop already drives the engine.
Definition at line 713 of file DSParkWebViewEditor.h.
|
inlinenoexcept |
Reads the CURRENT size of the host window we are embedded in (physical pixels on Windows). Lets the backends fit the page to whatever box the host actually created, even when its negotiation calls arrived in an unexpected order. Returns false where the parent cannot be queried (then the negotiated size is used as-is).
Note on DPI: the web engine applies the window's scale factor itself (CSS pixels are device-independent), so the page never needs zooming - the wrapper only converts logical <-> physical for host negotiation.
Definition at line 778 of file DSParkWebViewEditor.h.
|
inlinenoexcept |
Resizes the embedded view to the host-given box (origin stays 0,0).
Definition at line 754 of file DSParkWebViewEditor.h.
|
inlinenoexcept |
Shows/hides the embedded view (CLAP hosts drive this explicitly).
Definition at line 761 of file DSParkWebViewEditor.h.
|
staticconstexpr |
True when this platform can embed a WebView editor (see file docs).
Definition at line 688 of file DSParkWebViewEditor.h.