pub struct DevServerHost { /* private fields */ }Expand description
Development server host for browser-based UI testing
This implementation stores parameter values locally and optionally
forwards updates to an AtomicParameterBridge for lock-free reads
on the audio thread. Meter data is provided externally via the audio
server’s meter channel (not generated synthetically).
§Thread Safety
Parameter state is protected by RwLock (in InMemoryParameterHost).
The AtomicParameterBridge uses lock-free atomics for audio thread.
Implementations§
Source§impl DevServerHost
impl DevServerHost
Sourcepub fn new(parameters: Vec<ParameterInfo>) -> Self
pub fn new(parameters: Vec<ParameterInfo>) -> Self
Create a new dev server host with parameter metadata.
§Arguments
parameters- Parameter metadata loaded from the plugin FFI
Used by tests and the non-audio build path. When audio is
enabled (default), production code uses with_param_bridge() instead.
Sourcepub fn with_param_bridge(
parameters: Vec<ParameterInfo>,
bridge: Arc<AtomicParameterBridge>,
) -> Self
pub fn with_param_bridge( parameters: Vec<ParameterInfo>, bridge: Arc<AtomicParameterBridge>, ) -> Self
Create a new dev server host with an AtomicParameterBridge.
When a bridge is provided, set_parameter() will write updates
to both the inner store and the bridge (for audio-thread reads).
Sourcepub fn replace_parameters(
&self,
new_params: Vec<ParameterInfo>,
) -> Result<(), String>
pub fn replace_parameters( &self, new_params: Vec<ParameterInfo>, ) -> Result<(), String>
Replace all parameters with new metadata from a hot-reload.
Preserves values for parameters with matching IDs. New parameters get their default values. This is used by the hot-reload pipeline to update parameter definitions without restarting the server.
§Errors
Returns an error if parameter replacement fails (e.g., unrecoverable lock poisoning).
Sourcepub fn set_latest_meter_frame(&self, update: &MeterUpdateNotification)
pub fn set_latest_meter_frame(&self, update: &MeterUpdateNotification)
Store the latest metering snapshot for polling-based consumers.
Sourcepub fn set_latest_oscilloscope_frame(&self, frame: OscilloscopeFrame)
pub fn set_latest_oscilloscope_frame(&self, frame: OscilloscopeFrame)
Store the latest oscilloscope frame for polling-based consumers.
Sourcepub fn set_audio_status(&self, status: AudioRuntimeStatus)
pub fn set_audio_status(&self, status: AudioRuntimeStatus)
Update the shared audio runtime status.