Queue

Subclass to control the Queue.

MphpD::queue() : Queue

Methods

__construct

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

Queue::__construct(FloFaber\MphpD\MphpD $mphpd) : mixed

Parameters

Returns mixed

add

Adds the file $uri to the queue (directories add recursively). $uri can also be a single file.

Queue::add(string $uri,  $pos = -1) : bool

Parameters

Returns bool

bool true on success and false on failure.

add_id

Adds a song to the playlist (non-recursive) and returns the song id.

Queue::add_id(string $uri,  $pos = -1) : mixed

Parameters

Returns mixed

int|false The song ID on success or false on failure.

add_search

Same as search() but adds the songs into the Queue at position $pos.

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

Parameters

Returns bool

bool true on success and false on failure.

add_find

Same as find() but this adds the matching song to the Queue.

Queue::add_find(FloFaber\MphpD\Filter $filter, string $sort = '', array $window = [], int $pos = -1) : bool

Parameters

Returns bool

bool true on success and false on failure.

clear

Clears the queue

Queue::clear() : bool

Parameters

Returns bool

bool true on success and false on failure.

delete

Deletes a song or a range of songs from the queue

Queue::delete( $p) : bool

Parameters

Returns bool

bool true on success and false on failure.

delete_id

Deletes the song with ID $songid from the Queue

Queue::delete_id(int $songid) : bool

Parameters

Returns bool

bool true on success and false on failure.

move

Moves the song at $from to $to in the queue

Queue::move( $from, string $to) : bool

Parameters

Returns bool

bool true on success and false on failure.

move_id

Moves the song with $from (songid) to $to (playlist index) in the queue.

Queue::move_id(int $from, string $to) : bool

Parameters

Returns bool

bool true on success and false on failure.

find

Same as Queue::search but case-sensitive

Queue::find(FloFaber\MphpD\Filter $filter, string $sort = '', array $window = []) : mixed

Parameters

Returns mixed

array|false array on success or false on failure.

get_id

Returns an associative arrays containing information about the song with ID $songid.

Queue::get_id(int $songid) : mixed

Parameters

Returns mixed

array|false Associative array containing song information or false on failure.

get

Returns information about all or specific songs in the Queue.

Queue::get( $p = -1) : mixed

Parameters

Returns mixed

array|false array on success or false on failure. An empty array is returned if the queue is empty.

search

Search the queue for matching songs.

Queue::search(FloFaber\MphpD\Filter $filter, string $sort = '', array $window = []) : mixed

Parameters

Returns mixed

array|false array on success or false on failure.

changes

Returns an array of changed songs currently in the playlist since $version.

Queue::changes(int $version,  $range = -1, bool $metadata = ) : mixed

Parameters

Returns mixed

array|false array on success or false on failure.

prio

Sets the priority of given songs to $priority. This only has effect when the random-mode is enabled. A higher priority means that it will be played first when random is enabled.

Queue::prio(int $priority,  $range = -1) : bool

Parameters

Returns bool

bool true on success or false on failure.

prio_id

Sets the priority of Song ID $id to $priority. This only has effect when the random-mode is enabled. A higher priority means that it will be played first when random is enabled.

Queue::prio_id(int $priority, int $id) : bool

Parameters

Returns bool

bool true on success or false on failure.

range_id

Set's the portion of the song that should be played. You can't edit the currently playing song!

Queue::range_id(int $songid, array $range = []) : bool

Parameters

Returns bool

bool true on success or false on failure.

shuffle

Shuffle the Queue.

Queue::shuffle(array $range = []) : bool

Parameters

Returns bool

bool true on success or false on failure.

swap

Swap two songs in Queue. By Position.

Queue::swap(int $songpos_1, int $songpos_2) : bool

Parameters

Returns bool

bool true on success or false on failure.

swap_id

Swap two songs in Queue. By ID.

Queue::swap_id(int $songid_1, int $songid_2) : bool

Parameters

Returns bool

bool true on success or false on failure.

add_tag_id

Adds a tag to the specified song

Queue::add_tag_id(int $songid, string $tag, string $value) : bool

Parameters

Returns bool

bool true on success or false on failure.

clear_tag_id

Removes a tag from the specified song

Queue::clear_tag_id(int $songid, string $tag) : bool

Parameters

Returns bool

bool true on success or false on failure.

© 2023 Florian Faber