Subclass to control the Queue.
MphpD::queue() : Queue
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
@param \MphpD $mphpd
mixed
Adds the file $uri to the queue (directories add recursively). $uri can also be a single file.
Queue::add(string $uri, $pos = -1) : bool
@param string $uri Can be a single file or folder. If connected via Unix socket you may add arbitrary local files (absolute paths)
@param int|string $pos If set the song is inserted at the specified position. If the parameter starts with + or -, then it is relative to the current song. e.g. +0 inserts right after the current song and -0 inserts right before the current song (i.e. zero songs between the current song and the newly added song).
bool
bool Returns true on success and false on failure.
Adds a song to the playlist (non-recursive) and returns the song id.
Queue::add_id(string $uri, $pos = -1) : mixed
@param string $uri Is always a single file or URL
@param int|string $pos If set the song is inserted at the specified position. If the parameter starts with + or -, then it is relative to the current song. e.g. +0 inserts right after the current song and -0 inserts right before the current song (i.e. zero songs between the current song and the newly added song).
mixed
int|false Returns the song ID on success or false on failure.
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
@param \Filter $filter
@param string $sort
@param array $window
@param int $position
bool
bool
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
@param \Filter $filter
@param string $sort
@param array $window
@param int $pos Optional. If specified the matched songs will be added to this position in the Queue.
bool
bool
Clears the queue
Queue::clear() : bool
bool
bool Returns true on success and false on failure.
Deletes a song or a range of songs from the queue
Queue::delete( $p) : bool
@param int|array $p The song position or Range
bool
bool
Deletes the song with ID $songid from the Queue
Queue::delete_id(int $songid) : bool
@param int $songid
bool
bool
Moves the song at $from to $to in the queue
Queue::move( $from, string $to) : bool
@param int|array $from Song position or Range
@param string $to If starting with + or -, then it is relative to the current song e.g. +0 moves to right after the current song and -0 moves to right before the current song (i.e. zero songs between the current song and the moved range).
bool
bool
Moves the song with $from (songid) to $to (playlist index) in the queue
Queue::move_id(int $from, string $to) : bool
@param int $from
@param string $to If starting with + or -, then it is relative to the current song e.g. +0 moves to right after the current song and -0 moves to right before the current song (i.e. zero songs between the current song and the moved song).
bool
bool
Same as Queue::search but case-sensitive
Queue::find(FloFaber\MphpD\Filter $filter, string $sort = '', array $window = []) : mixed
@param \Filter $filter
@param string $sort
@param array $window
mixed
array|false
Returns an associative arrays containing information about the song with ID $songid.
Queue::get_id(int $songid) : mixed
@param int $songid
mixed
array|false Associative array containing song information or false on failure.
If $p is omitted returns an array of associative arrays containing information about songs in the Queue. If $p is specified returns an associative array containing the given songs information only.
Queue::get( $p = -1) : array
@param $p int|array Optional. Song Position or Range.
If omitted all songs in the queue will be returned.
array
array|false Array on success. False on failure.
Search the queue for matching songs.
Queue::search(FloFaber\MphpD\Filter $filter, string $sort = '', array $window = []) : mixed
@param \Filter $filter The Filter.
@param string $sort If specified the results are sorted by the specified tag.
@param array $window If specified returns only the given portion.
mixed
array|false Returns array on success and false on failure.
Returns an array of changed songs currently in the playlist since $version.
Queue::changes(int $version, $range = -1, bool $metadata = ) : mixed
@param int $version The current version can be retrieved with MphpD::status([ "playlist" ]).
@param int|array $range Position of song or Range
@param bool $metadata If set to true the metadata will be included.
If set to false only the position and ID of the changed songs will be returned.
mixed
array|false Returns array on success and false on failure.
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
@param int $priority Priority. 0-255.
@param int|array $range Position of song or Range
bool
bool
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
@param int $priority
@param int $id
bool
bool
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
@param int $songid
@param array $range Range. Start and End are offsets in seconds. If omitted the "play-range" will be removed from the song.
bool
bool
Shuffle the Queue.
Queue::shuffle(array $range = []) : bool
@param array $range If specified only this portion will be shuffled.
bool
bool
Swap two songs in Queue. By Position.
Queue::swap(int $songpos_1, int $songpos_2) : bool
@param int $songpos_1
@param int $songpos_2
bool
bool
Swap two songs in Queue. By ID.
Queue::swap_id(int $songid_1, int $songid_2) : bool
@param int $songid_1
@param int $songid_2
bool
bool
Adds a tag to the specified song
Queue::add_tag_id(int $songid, string $tag, string $value) : bool
@param int $songid
@param string $tag Tag name
@param string $value Tag value
bool
bool
Removes a tag from the specified song
Queue::clear_tag_id(int $songid, string $tag) : bool
@param int $songid
@param string $tag Tag name
bool
bool