|
| | ViewBridge (Processor &processor, state::StateStore &store) |
| | ViewBridge (Processor &processor, state::StateStore &store, Options options) |
| | ViewBridge (Processor &processor, state::StateStore &store, runtime::AliveToken::Handle owner_alive) |
| | ViewBridge (Processor &processor, state::StateStore &store, runtime::AliveToken::Handle owner_alive, Options options) |
| | ~ViewBridge () |
| | ViewBridge (const ViewBridge &)=delete |
| ViewBridge & | operator= (const ViewBridge &)=delete |
| bool | open (std::string *error=nullptr) |
| | Build the view.
|
| bool | prepare_first_frame (view::PluginViewHost &host) |
| | Content-first open: make host's first frame the settled document.
|
| void | notify_attached () |
| | Fire on_view_opened(view) — called by the adapter once the view has been attached to its native parent.
|
| std::unique_ptr< view::View > | release_view () |
| | Transfer ownership of the primary view to the caller while preserving the bridge's lifecycle dispatch.
|
| void | close () |
| | Destroy the view.
|
| void | resize (uint32_t width, uint32_t height) |
| | Notify the bridge that the host resized the editor.
|
| void | notify_processor_destroyed () noexcept |
| | The owning adapter MUST call this before the referenced Processor is destroyed when the two have independent lifetimes (AU: the audio unit and the view controller).
|
| bool | notify_owner_released () noexcept |
| | Tell every view in the editor tree that the plug-in instance owning it is gone, by calling EditorOwnerObserver::on_owner_released() on each view that implements it (editor_owner.hpp), root first.
|
| bool | owner_is_alive () const noexcept |
| | Whether the adapter instance that owns both Processor and StateStore is still alive.
|
| bool | set_preferred_size (uint32_t width, uint32_t height) |
| | Update the editor's PREFERRED size (and derived aspect ratio) after the plugin requested an editor-initiated resize to a new natural size (see Processor::request_editor_resize).
|
| bool | poll_editor_reload () |
| | Live editor reload (live-swap 1.9).
|
| bool | rebuild_primary_view () |
| | Force a rebuild of the open primary view from create_view() now, transplanting the fresh content (children + background) into the stable root View.
|
| bool | is_open () const |
| ViewRole | role () const |
| view::View * | view () |
| const view::View * | view () const |
| bool | uses_script_ui () const |
| view::HostParamSurface * | host_params () |
| | The runtime host-parameter surface installed on the open view tree.
|
| void | set_host_actions (view::HostActionSurface *actions) |
| | Install the command channel a routed view's Kind::action clicks reach (route_actions_to_host(true) → View::host_actions()).
|
| view::HostActionSurface * | host_actions () const |
| const std::shared_ptr< std::atomic< bool > > & | alive_token () const |
| | Cross-thread liveness token.
|
| view::ScriptedUiSession * | scripted_ui () |
| | Access the scripted UI session, if the primary view was built from a JS script.
|
| const view::ScriptedUiSession * | scripted_ui () const |
| void | visit_scripted_ui (const std::function< void(view::ScriptedUiSession *)> &visitor) |
| | Borrow the active scripted UI only for the duration of visitor.
|
| void | visit_scripted_ui (const std::function< void(const view::ScriptedUiSession *)> &visitor) const |
| uint32_t | width () const |
| uint32_t | height () const |
| const ViewSize & | size_hints () const |
| std::uint32_t | editor_background_rgb () const |
| | The editor's background as 0xRRGGBB, resolved when open() builds the view: Processor::editor_background() when the plug-in declares one, else the root view's theme bg.primary, else view::kEditorHostClearRgb.
|
| const std::string & | last_error () const |
| view::View * | attach_secondary_view (std::unique_ptr< view::View > view, ViewRole role) |
| | Attach a secondary inspector view to this bridge.
|
| bool | detach_secondary_view (view::View *view) |
| | Detach and destroy a previously-attached secondary view.
|
| size_t | view_count () const |
| | Total number of attached views (primary + secondary).
|
| view::View * | view_at (size_t index) |
| | Access an attached view by index.
|
| ViewRole | role_at (size_t index) const |
| | Role of the view at index. Returns Editor when out of range.
|
The runtime host-parameter surface installed on the open view tree.
A view built by create_view() — in particular an imported DesignFrameView with route_changes_to_host_params(true) — resolves its param_keys against View::host_params(). open() installs this StateStore-backed surface on the tree, so those views drive the processor's parameters with no per-plugin wiring: keys resolve to the store parameter whose ParamInfo::name matches (the convention the design-param generator already emits).
This is the ONLY writer the routed path uses. A consumer that ALSO forwards DesignFrameView::on_element_changed into the same store would deliver each gesture twice; wire one or the other, never both (see routes_changes_to_host_params()).
Null before open() / after close().
| bool pulp::format::ViewBridge::notify_owner_released |
( |
| ) |
|
|
noexcept |
Tell every view in the editor tree that the plug-in instance owning it is gone, by calling EditorOwnerObserver::on_owner_released() on each view that implements it (editor_owner.hpp), root first.
Delivered at most once per open editor, and only once the owner has retired: a no-op while it is alive, after the first delivery, and with no editor open. The editor idle pump calls this on its first tick after the owner retires, and notify_processor_destroyed() and close() call it as well, so a tree that outlives its instance hears it on the main thread before anything tears it down. Main thread only. Returns whether this call delivered the notification.
| bool pulp::format::ViewBridge::poll_editor_reload |
( |
| ) |
|
Live editor reload (live-swap 1.9).
When the processor supports editor reload (Processor::supports_editor_reload()), the editor idle tick calls this each frame; it compares Processor::editor_reload_generation() to the last seen value and, on a change, rebuilds the OPEN editor in place by re-calling create_view() on the (now hot-swapped) processor and transplanting its content into the SAME root View the host references — so a DAW sees the editor update live without re-instantiating the plugin. Returns true if a rebuild happened (the caller should then relayout + repaint the host). No-op (returns false) for processors that don't support editor reload, when not open, or when the generation is unchanged.
Content-first open: make host's first frame the settled document.
Every adapter calls this once its host exists, the GPU surface is bound and the view is attached (or, for AU v2, right before the factory returns the view). With Options::content_first_open it
- evaluates a document open() deferred (ScopedDeferredDocumentLoad) now, after the host and its GPU surface exist, so the document sees the same environment it would on its deferred idle tick;
- pumps the editor's idle work while the document asks for settle rounds (ScriptedUiSession::settling()), at most kFirstFrameSettleRounds rounds and kFirstFrameSettleBudgetMs;
- asks the host to present that frame now (PluginViewHost::present_first_frame()), so the view's layer holds the UI before the host composites it.
A document that fails to mount reports through its loaded callback as it would from the idle tick, and the host presents whatever the root holds (a fallback editor, or the editor's background). For an editor with no pending document only step 3 runs. Without the option it does nothing: the display link paints the first frame once the host shows the view, as before. Returns true when the host presented a frame. Main thread only.
| bool pulp::format::ViewBridge::set_preferred_size |
( |
uint32_t | width, |
|
|
uint32_t | height ) |
Update the editor's PREFERRED size (and derived aspect ratio) after the plugin requested an editor-initiated resize to a new natural size (see Processor::request_editor_resize).
Recomputes size_hints_'s preferred_width/height and aspect_ratio from (w, h), preserving the declared min/max resize envelope. Returns false (without mutation) when either dimension is zero or falls outside a non-zero bound. Per-format resize-hint reporting (CLAP gui_get_resize_hints / gui_get_size, VST3 checkSizeConstraint) then tracks the new aspect instead of snapping the window back to the old one. Zero min/max values retain their special meanings (fixed/unbounded). No-op when either dimension is zero. Does NOT fire on_view_resized (that is the host→plugin direction, dispatched by resize()).