pub enum PlayerCommand {
Show 23 variants
Play(QueueItemId),
Pause,
Resume,
Stop,
Seek(u64),
NextTrack,
PrevTrack,
AddToPlaylist(Vec<PlaylistItem>),
RemoveFromPlaylist(QueueItemId),
RemoveFromPlaylistBatch(Vec<QueueItemId>),
MoveInPlaylist {
id: QueueItemId,
target: QueueItemId,
after: bool,
},
MoveItemsInPlaylist {
ids: Vec<QueueItemId>,
target: QueueItemId,
after: bool,
},
UpdatePaths(Vec<(QueueItemId, PathBuf)>),
InsertInPlaylist {
items: Vec<PlaylistItem>,
after: QueueItemId,
},
ClearPlaylist,
TrackReady(QueueItemId),
TrackStreamReady(QueueItemId),
Undo,
Redo,
BeginUndoBatch,
EndUndoBatch,
SetOutputDevice(String),
ClearOutputDevice,
}Expand description
Commands from the UI layer to the audio engine.
Variants§
Play(QueueItemId)
Set cursor + start playback. Replaces Play/SkipTo/SkipBack/PlayInterrupt.
Pause
Resume
Stop
Seek(u64)
NextTrack
PrevTrack
AddToPlaylist(Vec<PlaylistItem>)
RemoveFromPlaylist(QueueItemId)
RemoveFromPlaylistBatch(Vec<QueueItemId>)
Batch remove: delete multiple items as a single undoable operation.
MoveInPlaylist
MoveItemsInPlaylist
Batch move: extract ids and reinsert them at target position.
UpdatePaths(Vec<(QueueItemId, PathBuf)>)
Update file paths for playlist items after an organize operation. On Unix, rename() doesn’t invalidate open FDs so playback continues.
InsertInPlaylist
Insert items after a specific queue item (for drag/drop at cursor position).
ClearPlaylist
Clear the entire playlist (stop + remove all items).
TrackReady(QueueItemId)
Download complete — check if cursor is waiting on this item.
TrackStreamReady(QueueItemId)
Enough data buffered for streaming playback — check if cursor is waiting.
Undo
Undo the last reversible playlist operation.
Redo
Redo the last undone operation.
BeginUndoBatch
Begin collecting undo entries into a single batch (e.g. drag operations).
EndUndoBatch
End the batch — collapse collected entries into one undo step.
SetOutputDevice(String)
Switch output audio device by name. Restarts engine on current track.
ClearOutputDevice
Clear the configured output device, reverting to system default.
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more