Skip to main content

Player

Struct Player 

Source
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

Source

pub fn is_cd(&self) -> Result<bool, String>

Whether the retained selection comes from a physical CD, including Pause/Stop.

Source

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

Source

pub fn remove(&self, id: u64, occurrence: usize) -> Result<(), String>

Remove one captured occurrence, never all copies of the same track reference.

Source§

impl Player

Source

pub fn devices(&self) -> Result<Value, String>

Discover current native outputs only on an explicit client request.

Source

pub fn snapshot(&self) -> Result<Value, String>

Return public player state, never source paths, session credentials or buffered PCM.

Source

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.

Source

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.

Source

pub fn halt(&self) -> Result<(), String>

Stop and join the native worker before revoking its authentication session.

Source

pub fn clear(&self) -> Result<(), String>

Stop the worker and forget its selection, retaining device and audio configuration.

Source

pub fn seek(&self, position: u64) -> Result<u64, String>

Queue a seek and return its ticket; snapshots acknowledge it only after the actor applies it.

Source

pub fn control(&self, action: &str, value: Value) -> Result<(), String>

Narrow transport controls; unsupported values are explicit errors.

Trait Implementations§

Source§

impl Default for Player

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for Player

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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
§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

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.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

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

§

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.