rockbox/playlist

The current/active playback queue (Mopidy-style “tracklist”).

For named, persisted playlists see rockbox/saved_playlists.

Types

Optional knobs for start.

pub opaque type StartOptions

Values

pub fn amount(client: rockbox.Client) -> Result(Int, error.Error)

Number of tracks currently queued.

pub fn at_elapsed(opts: StartOptions, value: Int) -> StartOptions
pub fn at_index(opts: StartOptions, value: Int) -> StartOptions
pub fn at_offset(opts: StartOptions, value: Int) -> StartOptions
pub fn clear(client: rockbox.Client) -> Result(Nil, error.Error)

Empty the active queue.

pub fn create(
  client: rockbox.Client,
  name: String,
  tracks: List(String),
) -> Result(Nil, error.Error)

Replace the queue with a new ad-hoc playlist and start playing it.

pub fn current(
  client: rockbox.Client,
) -> Result(types.Playlist, error.Error)

Snapshot of the active queue.

pub fn insert_album(
  client: rockbox.Client,
  album_id: String,
  position: types.InsertPosition,
) -> Result(Nil, error.Error)

Append every track on an album to the queue.

pub fn insert_directory(
  client: rockbox.Client,
  directory: String,
  position: types.InsertPosition,
  playlist_id: option.Option(String),
) -> Result(Nil, error.Error)

Append every track in a directory (optionally recursive) to the queue.

pub fn insert_tracks(
  client: rockbox.Client,
  paths: List(String),
  position: types.InsertPosition,
  playlist_id: option.Option(String),
) -> Result(Nil, error.Error)

Insert a list of paths or track IDs into the queue at the given position.

Pass option.None for playlist_id to target the active queue.

pub fn remove_track(
  client: rockbox.Client,
  index: Int,
) -> Result(Nil, error.Error)
pub fn resume(client: rockbox.Client) -> Result(Nil, error.Error)

Resume an interrupted queue from the saved position.

pub fn shuffle(
  client: rockbox.Client,
) -> Result(Nil, error.Error)

Shuffle the active queue in place.

pub fn start(
  client: rockbox.Client,
  options: StartOptions,
) -> Result(Nil, error.Error)

Start playing the active queue from the given position.

pub fn start_options() -> StartOptions
Search Document