paracusia v0.2.1 Paracusia.MpdClient.Playback

Functions related to MPD’s playback.

See also: https://musicpd.org/doc/protocol/playback_commands.html and https://musicpd.org/doc/protocol/playback_option_commands.html

Summary

Functions

Sets consume state to true or false

Sets crossfading between songs

Sets the threshold at which songs will be overlapped

Plays next song in the queue

Pauses or resumes playback

Continues playing the current song

Begins playing the queue at song songid

Begins playing the queue at the given position

Plays previous song in the queue

Sets random state to true or false

Sets repeat state to true or false

Sets the replay gain mode

Prints replay gain options. Currently, only the variable replay_gain_mode is returned

Seeks to the position seconds within the current song

Seeks seconds seconds backward within the current song

Seeks seconds seconds forward within the current song

Seeks to the position seconds of song id

Seeks the current song to percent percent

Seeks to the position seconds at entry songpos in the queue

Sets volume to vol (value between 0 and 100)

Sets single state to true or false

Stops playing

Changes volume by amount change

Functions

consume(state)
consume(boolean) :: :ok | Paracusia.MpdTypes.mpd_error

Sets consume state to true or false.

crossfade(seconds)
crossfade(integer) :: :ok | Paracusia.MpdTypes.mpd_error

Sets crossfading between songs.

mixrampdb(decibels)
mixrampdb(integer) :: :ok | Paracusia.MpdTypes.mpd_error

Sets the threshold at which songs will be overlapped.

Like crossfading but doesn’t fade the track volume, just overlaps. The songs need to have MixRamp tags added by an external tool. 0dB is the normalized maximum volume so use negative values. In the absence of mixramp tags, crossfading will be used.

next()

Plays next song in the queue.

pause(bool)
pause(true | false) :: :ok | Paracusia.MpdTypes.mpd_error

Pauses or resumes playback.

play()

Continues playing the current song.

play_id(songid)

Begins playing the queue at song songid.

play_pos(position)

Begins playing the queue at the given position.

previous()
previous :: :ok | Paracusia.MpdTypes.mpd_error

Plays previous song in the queue.

random(state)
random(boolean) :: :ok | Paracusia.MpdTypes.mpd_error

Sets random state to true or false.

repeat(state)
repeat(boolean) :: :ok | Paracusia.MpdTypes.mpd_error

Sets repeat state to true or false.

replay_gain_mode(atom)
replay_gain_mode(:off | :track | :album | :auto) ::
  :ok |
  Paracusia.MpdTypes.mpd_error

Sets the replay gain mode.

Changing the mode during playback may take several seconds, because the new setting does not affect the buffered data.

replay_gain_status()
replay_gain_status ::
  {:ok, String.t} |
  Paracusia.MpdTypes.mpd_error

Prints replay gain options. Currently, only the variable replay_gain_mode is returned.

seek_current(seconds)
seek_current(number) :: :ok | Paracusia.MpdTypes.mpd_error

Seeks to the position seconds within the current song.

seek_current_backward(seconds)
seek_current_backward(number) ::
  :ok |
  Paracusia.MpdTypes.mpd_error

Seeks seconds seconds backward within the current song.

seek_current_forward(seconds)
seek_current_forward(number) :: :ok | Paracusia.MpdTypes.mpd_error

Seeks seconds seconds forward within the current song.

seek_id(id, seconds)

Seeks to the position seconds of song id.

seek_percent(percent)
seek_percent(number) :: :ok | Paracusia.MpdTypes.mpd_error

Seeks the current song to percent percent.

seek_pos(songpos, seconds)

Seeks to the position seconds at entry songpos in the queue.

set_volume(vol)
set_volume(integer) :: :ok | Paracusia.MpdTypes.mpd_error

Sets volume to vol (value between 0 and 100).

single(state)
single(boolean) :: :ok | Paracusia.MpdTypes.mpd_error

Sets single state to true or false.

stop()

Stops playing.

volume(change)
volume(integer) :: :ok | Paracusia.MpdTypes.mpd_error

Changes volume by amount change.

Note: the MPD command used by this function is deprecated, use set_volume/1 instead.