Playlist

Subclass to interact with stored Playlists.

MphpD::playlist(string $name) : Playlist

Methods

__construct

This class is not intended for direct usage. Use MphpD::playlist() instead to retrieve an instance of this class.

Playlist::__construct(FloFaber\MphpD\MphpD $mphpd, string $name) : mixed

Parameters

Returns mixed

exists

Function to determine if the specified playlist exists.

Playlist::exists() : bool

Parameters

Returns bool

bool true if it exists, otherwise false.

get_songs

Returns a list of all songs in the specified playlist.

Playlist::get_songs(bool $metadata = ) : mixed

Parameters

Returns mixed

array|false array of associative Arrays containing song information on success or false on failure.

load

Loads the specified playlist into the Queue.

Playlist::load(array $range = [],  $pos = '') : bool

Parameters

Returns bool

bool true on success and false on failure.

add

Adds $uri to the specified playlist at position $pos.

Playlist::add(string $uri,  $pos = '') : bool

Parameters

Returns bool

bool true on success and false on failure.

add_search

Search for songs using Filter and add them into the Playlist at position $pos.

Playlist::add_search(FloFaber\MphpD\Filter $filter, string $sort = '', array $window = [], int $position = -1) : bool

Parameters

Returns bool

bool

clear

Removes all songs from the specified playlist.

Playlist::clear() : bool

Parameters

Returns bool

bool true on success and false on failure.

remove_song

Deletes $songpos from the specified playlist.

Playlist::remove_song( $songpos = -1) : bool

Parameters

Returns bool

bool true on success and false on failure.

move_song

Moves the song at position $from in the specified playlist to the position $to.

Playlist::move_song(int $from, int $to) : bool

Parameters

Returns bool

bool true on success and false on failure.

rename

Renames the specified playlist to $new_name

Playlist::rename(string $new_name) : bool

Parameters

Returns bool

bool true on success and false on failure.

delete

Removes the specified playlist from the playlist directory.

Playlist::delete() : bool

Parameters

Returns bool

bool true on success and false on failure.

save

Saves the queue to the specified playlist in the playlist directory

Playlist::save(int $mode = 1) : bool

Parameters

Returns bool

bool true on success and false on failure.

© 2023 Florian Faber