Player

This subclass is used to control MPDs playback. You may also want to have a look at the MPD documentation.

MphpD::player() : Player

Methods

__construct

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

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

Parameters

Returns mixed

consume

Enables/Disables the consume mode

Player::consume(int $state) : bool

Parameters

Returns bool

bool true on success and false on failure

crossfade

Sets crossfade to $seconds seconds.

Player::crossfade(int $seconds) : bool

Parameters

Returns bool

bool true on success or false on failure.

mixramp_db

Sets the threshold at which songs will be overlapped. See https://mpd.readthedocs.io/en/latest/user.html#mixramp for more information

Player::mixramp_db(int $dB) : bool

Parameters

Returns bool

bool true on success or false on failure.

mixramp_delay

Additional time subtracted from the overlap calculated by mixrampdb. A value of nan disables MixRamp overlapping and falls back to crossfading. See MixRamp.

Player::mixramp_delay(float $seconds) : bool

Parameters

Returns bool

bool true on success or false on failure.

random

Specified if MPD should play the queue in random order

Player::random(int $state) : bool

Parameters

Returns bool

bool true on success or false on failure.

repeat

Specifies if MPD should start from the top again when reaching the end of the queue.

Player::repeat(int $state) : bool

Parameters

Returns bool

bool true on success or false on failure.

volume

Sets volume to $volume or returns the current volume if $volume is omitted.

Player::volume(int $volume = -1) : mixed

Parameters

Returns mixed

int|bool true on success, false on failure and int if $volume was omitted.

single

Enables/Disables the single-mode. If enabled MPD will play the same song over and over.

Player::single(int $state) : bool

Parameters

Returns bool

bool true on success or false on failure.

replay_gain_mode

Specifies whether MPD shall adjust the volume of songs played using ReplayGain tags.

Player::replay_gain_mode(string $mode) : bool

Parameters

Returns bool

bool true on success or false on failure.

replay_gain_status

Get the current replay gain. Currently only the variable replay_gain_mode is returned by MPD.

Player::replay_gain_status() : mixed

Parameters

Returns mixed

array|false array on success or false on failure.

current_song

Returns an associative array containing information about the currently playing song.

Player::current_song() : mixed

Parameters

Returns mixed

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

next

Plays the next song in the Queue

Player::next() : bool

Parameters

Returns bool

bool true on success and false on failure.

pause

Pause or resume playback.

Player::pause(?int $state = null) : bool

Parameters

Returns bool

bool true on success and false on failure.

play

Plays the song position $pos in the Queue

Player::play(int $pos) : bool

Parameters

Returns bool

bool true on success and false on failure.

play_id

Begins playing the playlist at song $id

Player::play_id(int $id) : bool

Parameters

Returns bool

bool true on success and false on failure.

previous

Plays the previous song in the Queue

Player::previous() : bool

Parameters

Returns bool

bool true on success and false on failure.

seek

Seeks to $seconds of song $songpos in the Queue.

Player::seek(int $songpos, float $time) : bool

Parameters

Returns bool

bool true on success and false on failure.

seek_id

Seeks to $seconds of song $songid. Same as Player::seek() but with a song ID instead of a position.

Player::seek_id(int $songid, float $time) : bool

Parameters

Returns bool

bool true on success and false on failure.

seek_cur

Seeks to $seconds of the current song.

Player::seek_cur( $time) : bool

Parameters

Returns bool

bool true on success and false on failure.

stop

Stops playing.

Player::stop() : bool

Parameters

Returns bool

bool true on success and false on failure.

© 2023 Florian Faber