Skip to content

Commit

Permalink
remove/rename remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
photovoltex committed Jan 23, 2025
1 parent 23c154f commit fd6de96
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 31 deletions.
51 changes: 21 additions & 30 deletions connect/src/spirc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,24 +283,21 @@ impl Spirc {

/// Resumes the playback
///
/// ## Remarks:
/// Does nothing if not active, or it isn't paused.
/// Does nothing if we are not the active device, or it isn't paused.
pub fn play(&self) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Play)?)
}

/// Resumes or pauses the playback
///
/// ## Remarks:
/// Does nothing if not active.
/// Does nothing if we are not the active device.
pub fn play_pause(&self) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::PlayPause)?)
}

/// Pauses the playback
///
/// ## Remarks:
/// Does nothing if not active, or if it isn't playing.
/// Does nothing if we are not the active device, or if it isn't playing.
pub fn pause(&self) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Pause)?)
}
Expand All @@ -310,32 +307,28 @@ impl Spirc {
/// Seeks to the beginning when the current track position
/// is greater than 3 seconds.
///
/// ## Remarks:
/// Does nothing if not active.
/// Does nothing if we are not the active device.
pub fn prev(&self) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Prev)?)
}

/// Skips to the next track.
///
/// ## Remarks:
/// Does nothing if not active.
/// Does nothing if we are not the active device.
pub fn next(&self) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Next)?)
}

/// Increases the volume by configured steps of [ConnectConfig].
///
/// ## Remarks:
/// Does nothing if not active.
/// Does nothing if we are not the active device.
pub fn volume_up(&self) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::VolumeUp)?)
}

/// Decreases the volume by configured steps of [ConnectConfig].
///
/// ## Remarks:
/// Does nothing if not active.
/// Does nothing if we are not the active device.
pub fn volume_down(&self) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::VolumeDown)?)
}
Expand All @@ -346,65 +339,63 @@ impl Spirc {
/// nothing (if not shuffled) or unshuffles the playback while
/// resuming at the position of the current track.
///
/// ## Remarks:
/// Does nothing if not active.
/// Does nothing if we are not the active device.
pub fn shuffle(&self, shuffle: bool) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Shuffle(shuffle))?)
}

/// Repeats the playback context according to the value.
///
/// ## Remarks:
/// Does nothing if not active.
/// Does nothing if we are not the active device.
pub fn repeat(&self, repeat: bool) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Repeat(repeat))?)
}

/// Repeats the current track if true.
///
/// ## Remarks:
/// Does nothing if not active. Skipping to the next track disables the repeating.
/// Does nothing if we are not the active device.
///
/// Skipping to the next track disables the repeating.
pub fn repeat_track(&self, repeat: bool) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::RepeatTrack(repeat))?)
}

/// Update the volume to the given value.
///
/// ## Remarks:
/// Does nothing if not active.
/// Does nothing if we are not the active device.
pub fn set_volume(&self, volume: u16) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::SetVolume(volume))?)
}

/// Updates the position to the given value.
///
/// ## Remarks:
/// Does nothing if not active. If value is greater than the track duration,
/// Does nothing if we are not the active device.
///
/// If value is greater than the track duration,
/// the update is ignored.
pub fn set_position_ms(&self, position_ms: u32) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::SetPosition(position_ms))?)
}

/// Load a new context and replace the current.
///
/// ## Remarks:
/// Does nothing if not active. Does not overwrite the queue.
/// Does nothing if we are not the active device.
///
/// Does not overwrite the queue.
pub fn load(&self, command: LoadRequest) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Load(command))?)
}

/// Disconnects the current device and pauses the playback according the value.
///
/// ## Remarks:
/// Does nothing if not active.
/// Does nothing if we are not the active device.
pub fn disconnect(&self, pause: bool) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Disconnect { pause })?)
}

/// Acquires the control as active connect device.
///
/// ## Remarks:
/// Does nothing if active.
/// Does nothing if we are not the active device.
pub fn activate(&self) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Activate)?)
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/spclient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ impl SpClient {
/// ## Query params found in the wild:
/// - include_video=true
///
/// ## Remarks:
/// ## Known results of uri types:
/// - uris of type `track`
/// - returns a single page with a single track
/// - when requesting a single track with a query in the request, the returned track uri
Expand Down

0 comments on commit fd6de96

Please sign in to comment.