|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
WebView editor layer: plugin GUIs written in HTML/CSS/JS, embedded in the host window through the platform web engine. More...
#include "../DSParkPlugin.h"#include <atomic>#include <cmath>#include <cstdarg>#include <cstdio>#include <cstdlib>#include <cstring>#include <string>
Go to the source code of this file.
Classes | |
| struct | dspark::plugin::webview_ui::PostArgs |
One decoded bridge message: [op, id?, value?]. More... | |
| struct | dspark::plugin::webview_ui::HostCallbacks |
| How the editor reaches back into the format wrapper. Plain function pointers + context (no std::function, no virtuals): the wrapper translates to its format's gesture/automation calls and to the user's setParameter. All calls arrive on the host's main/UI thread, in PLAIN parameter values. More... | |
| class | dspark::plugin::webview_ui::Editor< P > |
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... | |
Namespaces | |
| namespace | dspark |
| Main namespace for the DSPark framework. | |
| namespace | dspark::plugin |
| namespace | dspark::plugin::webview_ui |
Macros | |
| #define | DSPARK_PLUGIN_WEBVIEW 1 |
| #define | DSPARK_WEBVIEW_BACKEND 0 |
Functions | |
| void | dspark::plugin::webview_ui::debugLog (const char *format,...) noexcept |
| void | dspark::plugin::webview_ui::appendJsonString (std::string &out, const char *s) |
| Appends a JSON string literal (quotes included, control chars escaped). | |
| void | dspark::plugin::webview_ui::appendJsonNumber (std::string &out, double v) |
| Appends a JSON number, immune to the process locale. | |
| const char * | dspark::plugin::webview_ui::parseJsonNumber (const char *s, double &out) noexcept |
| Locale-independent number parse; returns the end pointer or nullptr. | |
| bool | dspark::plugin::webview_ui::parsePostArgs (const char *s, PostArgs &out) noexcept |
| Parses the bridge's JSON array of scalars (op + optional id/number). | |
Variables | |
| constexpr const char * | dspark::plugin::webview_ui::kBridgeJs |
WebView editor layer: plugin GUIs written in HTML/CSS/JS, embedded in the host window through the platform web engine.
Opt-in and additive: include this header BEFORE the format headers, set hasEditor = true and serve your page from editorHtml() - the VST3, CLAP and AU backends then embed it inside the window the host provides (AU through a Cocoa view factory announced via kAudioUnitProperty_CocoaUI). Nothing else in the plugin class changes; plugins without this header keep building exactly as before.
The page talks to the DSP through a tiny injected bridge (same stable text ids as state and automation):
Platform engines:
Threading: every editor call (create/destroy/resize/JS callbacks) runs on the host's main/UI thread. Values flow UI -> DSP through the wrapper's normalized shadows and the user's atomic setParameter (any-thread safe by contract), and DSP -> UI by polling those shadows at ~30 Hz from the page - no native timers, no locks, no allocation on the audio thread.
Definition in file DSParkWebViewEditor.h.
| #define DSPARK_PLUGIN_WEBVIEW 1 |
Definition at line 72 of file DSParkWebViewEditor.h.
| #define DSPARK_WEBVIEW_BACKEND 0 |
Definition at line 120 of file DSParkWebViewEditor.h.