pub enum PlaybackCommand {
Show 23 variants
Play(Option<usize>),
Pause,
Stop,
TogglePlaying,
GetPlaybackState,
SetQueue(Vec<PathBuf>),
AppendToQueue(Vec<PathBuf>),
AppendPlaylist(String),
SetPlaylist(String),
GetCurrentTrack,
Next,
Previous,
SetLoopState(LoopState),
GetLoopState,
SetRate(f64),
GetRate,
SetShuffleState(ShuffleState),
GetShuffleState,
SetPlayerPosition(Duration),
Seek(SignedDuration),
GetPlayerPosition,
SetPlayerVolume(PlayerVolume),
GetPlayerVolume,
}Expand description
Subcommand of Command for managing audio playback in the daemon.
The expected response may be different depending on the command sent. If it isn’t specified in
the variant documentation, assume Response::Ok is the expected
response.
Variants§
Play(Option<usize>)
Play the current track or play a track at a specific index in the queue.
Pause
Pause the player.
Stop
Stop the player.
TogglePlaying
Toggle between play/pause.
GetPlaybackState
Get the PlaybackState of the player.
The daemon will respond with PlaybackResponse::PlaybackState if successful.
SetQueue(Vec<PathBuf>)
Set a new queue for the player.
If any of the provided tracks are not registered by chilen (added after last library
reload), the daemon will return
LibraryError::NoSuchTrack.
AppendToQueue(Vec<PathBuf>)
Append tracks to the queue.
If any of the provided tracks are not registered by chilen (added after last library
reload), the daemon will return
LibraryError::NoSuchTrack.
AppendPlaylist(String)
Load a playlist and append its tracks to the queue.
If there’s no playlist with the provided name present in the
music library,
LibraryError::NoSuchPlaylist will be
returned, and no changes to the queue will be made.
SetPlaylist(String)
Load a playlist and put its tracks in the queue.
If there’s no playlist with the provided name present in the
music library,
LibraryError::NoSuchPlaylist will be
returned, and no changes to the queue will be made.
GetCurrentTrack
Get the current track.
The daemon will respond to this with PlaybackResponse::Track if successful.
Next
Skip to the next track.
Previous
Skip to the previous track.
SetLoopState(LoopState)
Set the loop state of the player.
GetLoopState
Get the loop state of the player.
The daemon will respond to this with PlaybackResponse::LoopState if successful.
SetRate(f64)
Set the playback rate of the player.
This command will fail if the daemon is configured to not allow playback rate
modification or if the specified rate value was out of the acceptable range.
If the daemon is configured not to allow playback rate modification,
PlaybackError::FixedRate will be returned.
If the provided rate value is out of the allowed range, PlaybackError::RateOutOfRange
will be returned.
GetRate
Get the playback rate of the player.
The daemon will respond to this with PlaybackResponse::PlaybackRate if
successful.
SetShuffleState(ShuffleState)
Set the shuffle state of the player.
The daemon will always respond to this command with PlaybackError::ShuffleNotSupported
if it was built without shuffle support.
GetShuffleState
Get the shuffle state of the player.
If the daemon was built without shuffle support, it will always respond to this command with
ShuffleState::Off. Otherwise, it will return PlaybackResponse::ShuffleState.
SetPlayerPosition(Duration)
Set the position of the player.
Seek(SignedDuration)
Change the player position by a time delta.
GetPlayerPosition
Get the position of the player.
The daemon will respond to this with PlaybackResponse::PlayerPosition if
successful.
SetPlayerVolume(PlayerVolume)
Set the volume of the player.
GetPlayerVolume
Get the volume of the player.
The daemon will respond to this with PlaybackResponse::PlayerVolume if
successful.
Trait Implementations§
Source§impl Clone for PlaybackCommand
impl Clone for PlaybackCommand
Source§fn clone(&self) -> PlaybackCommand
fn clone(&self) -> PlaybackCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PlaybackCommand
impl Debug for PlaybackCommand
Source§impl<'de> Deserialize<'de> for PlaybackCommand
impl<'de> Deserialize<'de> for PlaybackCommand
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PlaybackCommand
impl PartialEq for PlaybackCommand
Source§fn eq(&self, other: &PlaybackCommand) -> bool
fn eq(&self, other: &PlaybackCommand) -> bool
self and other values to be equal, and is used by ==.