pub struct Player { /* private fields */ }Expand description
One bounded actor owns the socket and device; no credential enters the UI or audio callback.
Implementations§
Source§impl Player
impl Player
Sourcepub fn is_cd(&self) -> Result<bool, String>
pub fn is_cd(&self) -> Result<bool, String>
Whether the retained selection comes from a physical CD, including Pause/Stop.
Sourcepub fn start_cd(
&self,
disc: Disc,
tracks: Vec<String>,
device: String,
index: usize,
permission: Option<Box<dyn Fn() -> Result<(), String> + Send>>,
) -> Result<(), String>
pub fn start_cd( &self, disc: Disc, tracks: Vec<String>, device: String, index: usize, permission: Option<Box<dyn Fn() -> Result<(), String> + Send>>, ) -> Result<(), String>
Start only discovered audio tracks, reusing the output, queue, repeat, shuffle and spectrum. Optional account checks run away from the output callback; guests require no server.
Source§impl Player
impl Player
Sourcepub fn devices(&self) -> Result<Value, String>
pub fn devices(&self) -> Result<Value, String>
Discover current native outputs only on an explicit client request.
Sourcepub fn snapshot(&self) -> Result<Value, String>
pub fn snapshot(&self) -> Result<Value, String>
Return public player state, never source paths, session credentials or buffered PCM.
Sourcepub fn start(
&self,
client: Client,
tracks: Vec<String>,
device: String,
index: usize,
policy: &str,
) -> Result<(), String>
pub fn start( &self, client: Client, tracks: Vec<String>, device: String, index: usize, policy: &str, ) -> Result<(), String>
Replace an explicit ordered selection after stopping its previous stream and device.
Sourcepub fn append(
&self,
id: u64,
expected_total: usize,
tracks: Vec<String>,
) -> Result<(), String>
pub fn append( &self, id: u64, expected_total: usize, tracks: Vec<String>, ) -> Result<(), String>
Append occurrences without touching the device, PCM buffers, consumption or visit. Both queue identity and expected size refuse delayed or repeated submissions.
Sourcepub fn halt(&self) -> Result<(), String>
pub fn halt(&self) -> Result<(), String>
Stop and join the native worker before revoking its authentication session.
Sourcepub fn clear(&self) -> Result<(), String>
pub fn clear(&self) -> Result<(), String>
Stop the worker and forget its selection, retaining device and audio configuration.