pub enum PlayerCommand {
PlayUrl {
url: String,
duration: Option<Duration>,
gen: u64,
},
EnqueueNext {
url: String,
duration: Option<Duration>,
},
Pause,
Resume,
Stop,
SetVolume(f32),
Seek(Duration),
Quit,
}Expand description
Commands sent from the TUI to the player thread.
Variants§
PlayUrl
Start playing the track at url. duration is the expected total
duration (from Subsonic metadata), used for progress display.
gen is a monotonically increasing counter from the TUI; the engine
uses it to discard stale downloads when multiple skips arrive quickly.
EnqueueNext
Append the next track to the player queue for gapless playback.
Must only be sent in response to PlayerEvent::AboutToFinish.
Does NOT stop current playback.
Pause
Resume
Stop
SetVolume(f32)
Seek(Duration)
Seek to an absolute position in the current track.
Quit
Stop playback and shut down the player thread cleanly.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PlayerCommand
impl RefUnwindSafe for PlayerCommand
impl Send for PlayerCommand
impl Sync for PlayerCommand
impl Unpin for PlayerCommand
impl UnsafeUnpin for PlayerCommand
impl UnwindSafe for PlayerCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more