pub struct Controller { /* private fields */ }Expand description
One socket owner serializes all protocol requests and acknowledged transport changes.
Implementations§
Source§impl Controller
impl Controller
Sourcepub fn connect(&self, host: &str, port: u16) -> Result<Value, String>
pub fn connect(&self, host: &str, port: u16) -> Result<Value, String>
Explicit non-mutating connection probe. Never opens during ordinary navigation.
Sourcepub fn validate_mapping(value: &Value) -> Result<(), String>
pub fn validate_mapping(value: &Value) -> Result<(), String>
Validate mappings before attempting a connection or saving an active profile.
Sourcepub fn connected(&self) -> bool
pub fn connected(&self) -> bool
Expose verified availability without making a discovery network request.
Sourcepub fn active(&self) -> bool
pub fn active(&self) -> bool
Route audio controls only after an explicit selection has been accepted.
Sourcepub fn halt(&self) -> Result<(), String>
pub fn halt(&self) -> Result<(), String>
Stop only this controller’s queue; unrelated HQPlayer playback is untouched.
Sourcepub fn clear(&self) -> Result<(), String>
pub fn clear(&self) -> Result<(), String>
Stop an owned selection and drop its retained metadata without disconnecting the output.
Sourcepub fn disconnect(&self) -> Result<(), String>
pub fn disconnect(&self) -> Result<(), String>
Remove the optional endpoint after stopping an owned queue.
Sourcepub fn prepare(
client: &Client,
tracks: Vec<String>,
index: usize,
mappings: &Value,
current: impl Fn() -> bool,
) -> Result<Selection, String>
pub fn prepare( client: &Client, tracks: Vec<String>, index: usize, mappings: &Value, current: impl Fn() -> bool, ) -> Result<Selection, String>
Prepare source-confined files without touching the external playlist; cancelled sessions stop retrieval.
Sourcepub fn start(
&self,
selection: Selection,
current: impl Fn() -> bool,
) -> Result<(), String>
pub fn start( &self, selection: Selection, current: impl Fn() -> bool, ) -> Result<(), String>
Publish only an authenticated selection, checking admission between protocol commands. An in-flight command may finish; cancellation prevents subsequent queue/Play commands.