Skip to main content

DevServerHost

Struct DevServerHost 

Source
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

Source

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.

Source

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).

Source

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).

Source

pub fn set_latest_meter_frame(&self, update: &MeterUpdateNotification)

Store the latest metering snapshot for polling-based consumers.

Source

pub fn set_latest_oscilloscope_frame(&self, frame: OscilloscopeFrame)

Store the latest oscilloscope frame for polling-based consumers.

Source

pub fn set_audio_status(&self, status: AudioRuntimeStatus)

Update the shared audio runtime status.

Trait Implementations§

Source§

impl ParameterHost for DevServerHost

Source§

fn get_parameter(&self, id: &str) -> Option<ParameterInfo>

Get information about a single parameter. Read more
Source§

fn set_parameter(&self, id: &str, value: f32) -> Result<(), BridgeError>

Set a parameter value. Read more
Source§

fn get_all_parameters(&self) -> Vec<ParameterInfo>

Get all parameters with their current values and metadata. Read more
Source§

fn get_meter_frame(&self) -> Option<MeterFrame>

Get the latest meter frame for UI visualization. Read more
Source§

fn get_oscilloscope_frame(&self) -> Option<OscilloscopeFrame>

Get the latest oscilloscope frame for UI visualization. Read more
Source§

fn request_resize(&self, _width: u32, _height: u32) -> bool

Request resize of the editor window. Read more
Source§

fn get_audio_status(&self) -> Option<AudioRuntimeStatus>

Get the current audio runtime status for browser/dev hosts. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,