Skip to content

feat(context): expose the host's mid-session render mode (AUD-1692) - #8

Open
unohee wants to merge 1 commit into
masterfrom
aud-1692-host-render-mode
Open

unohee wants to merge 1 commit into
masterfrom
aud-1692-host-render-mode

Conversation

@unohee

@unohee unohee commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Adds ProcessContext::host_render_mode() -> Option<ProcessMode>, defaulting to None. The CLAP wrapper overrides it to return the value last set through clap_plugin_render::set().

Why: the wrapper already stores that value, but only passes it to the plug-in through BufferConfig on the next initialize(). CLAP hosts can switch the render mode without re-activating. So can clap-wrapper's AAX wrapper once it forwards Pro Tools' EnteringOfflineMode (de-artifact AUD-1692). Without this method, a plug-in that polls a worker thread without blocking cannot tell that it should block for the length of a faster-than-real-time bounce.

  • Source-compatible: the default method keeps the VST3, AU and standalone wrappers and every existing implementor unchanged.
  • Audio-thread safe: a lock-free AtomicCell load, the same one activate already does.

Test plan

  • cargo check
  • cargo test --lib: 103 passed
  • de-artifact consumer on this rev (tagged pinned/de-artifact-aud1692)

Add ProcessContext::host_render_mode(), defaulting to None. The CLAP
wrapper returns the mode last set through clap_plugin_render::set().

nih-plug already stores that value, but only hands it to the plugin via
BufferConfig on the next initialize(). CLAP hosts - and clap-wrapper's
AAX wrapper when Pro Tools enters an offline bounce - may switch the
render mode without re-activating, so a plugin whose real-time path
polls a worker thread without blocking had no way to know it should
block for the length of a faster-than-real-time bounce.

The default implementation keeps every other wrapper and every existing
ProcessContext implementor source-compatible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant