MphpD
v1.2.4 Documentation GitHub

# Versions

## Changelog

- CHANGELOG.md

# Guides

- Commandlist
- Configuration
- Range

# Classes

- Channel
- DB
- Filter
- MPDException
- MphpD
- Output
- Partition
- Player
- Playlist
- Queue
- Socket
- Sticker
- Utils

# Methods

- Channel::__construct - This class is not intended for direct usage.
- Channel::subscribe - Subscribe to the channel.
- Channel::unsubscribe - Unsubscribe the channel.
- Channel::read - Returns a list of the channel's messages.
- Channel::send - Send a message to the channel.
- DB::__construct - This class is not intended for direct usage.
- DB::albumart - Returns the albumart (binary!) for given song.
- DB::count - Counts the number of songs and their playtime matching the specified Filter.
- DB::fingerprint - Calculate the song's fingerprint
- DB::find - Case-sensitive search for songs matching Filter and return an array of associative array of found songs.
- DB::list - Lists unique tags values of the specified type. `$type` can be any tag supported by MPD.
- DB::ls - List files,directories and playlists in `$uri`
- DB::read_comments - Read "comments" from the specified file.
- DB::get_picture - Returns data and content of a picture embedded in `$uri`.
- DB::read_picture - Returns a picture of `$uri` by reading embedded pictures from binary tags.
- DB::search - Case-INsensitive search for matching songs and returns an array of associative arrays containing song information.
- DB::update - Update the Database and return the Job-ID.
- Filter::__construct - Creates a new filter.
- Filter::and - Used to chain multiple filters together with a logical AND.
- Filter::__toString - Generate and return the Filter string.
- MPDException::__construct
- MPDException::__toString - Returns all information as string
- MPDException::getCommand - Returns the command which caused the error.
- MPDException::getCommandlistNum - Returns the command's list-number in case a commandlist was used.
- MPDException::__wakeup
- MPDException::getMessage
- MPDException::getCode
- MPDException::getFile
- MPDException::getLine
- MPDException::getTrace
- MPDException::getPrevious
- MPDException::getTraceAsString
- MphpD::__construct
- MphpD::db - Return the DB instance
- MphpD::player - Return the Player instance
- MphpD::queue - Return the Queue instance
- MphpD::playlist - Returns a Playlist instance with the given name or null if the name is empty
- MphpD::playlists - Returns a list of playlists.
- MphpD::output - Return a new output instance
- MphpD::outputs - Returns an Array of associative arrays containing all available outputs
- MphpD::neighbors - Return neighbors on the network like available SMB servers
- MphpD::partition - Return a new Partition instance
- MphpD::partitions - Return a list of all available partitions
- MphpD::channel - Return a new Channel instance
- MphpD::channels - Return a list of available channels
- MphpD::clear_error - Clears the current error
- MphpD::status - Returns the value of the specified key(s) from MPD's status.
- MphpD::stats - Returns the value of the specified key from MPD's stats.
- MphpD::sticker - Returns a Sticker instance
- MphpD::mounts - Return a list of all mounts.
- MphpD::mount - Mount `$uri` to path
- MphpD::unmount - Unmount a path
- MphpD::bulk_start - Function to start a command-list.
- MphpD::bulk_end - Function to end a command-list and execute its commands.
- MphpD::bulk_abort - Function to abort the current command list.
- MphpD::bulk_add - Function to add a command to the bulk_list.
- MphpD::tagtypes - Return a list of all available tag types.
- MphpD::tagtypes_disable - Disable specified tag types.
- MphpD::tagtypes_enable - Enable specified tag types.
- MphpD::tagtypes_clear - Remove all tag types from responses.
- MphpD::tagtypes_all - Enable all available tag types.
- MphpD::ping - Ping.
- MphpD::config - Returns an associative array of configuration values.
- MphpD::commands - Returns a list of all available commands.
- MphpD::notcommands - Returns a list of all not-available commands.
- MphpD::urlhandlers - Returns a list of all available urlhandlers. Like smb://, sftp://, http://.
- MphpD::decoders - Returns a list of available decoder plugins and their supported suffixes and mimetypes.
- MphpD::cmd - Send `$command` with `$params` to the MPD server.
- MphpD::get_socket - Returns the socket resource.
- MphpD::get_version - Returns MPDs version as string
- MphpD::version_bte - Function to compare a given version string with the current version of MPD
- MphpD::idle - Waits until there is a noteworthy change in one or more of MPD’s subsystems.
- MphpD::close - Close the connection to the MPD socket
- MphpD::kill - Kill MPD.
- MphpD::get_binarylimit - Returns the current binarylimit
- MphpD::set_error - Function to set the last occurred error.
- MphpD::get_last_error - Return an array containing information about the last error.
- MphpD::connect - Initiate connection to MPD with the parameters given at instantiation.
- MphpD::disconnect - Disconnect from MPD
- Output::__construct - This class is not intended for direct usage.
- Output::disable - Disable the given output
- Output::enable - Enable the given output
- Output::toggle - Enable/Disable the given output depending on the current state.
- Output::set - Set a runtime attribute. Supported values can be retrieved from the `MphpD::outputs()` method.
- Partition::__construct - This class is not intended for direct usage.
- Partition::switch - Switch the client to the given partition
- Partition::create - Create a new partition with the given name.
- Partition::delete - Delete the given partition
- Partition::move_output - Move a specific output to the current partition
- Player::__construct - This class is not intended for direct usage.
- Player::consume - Enables/Disables the consume mode
- Player::crossfade - Sets crossfade to `$seconds` seconds.
- Player::mixramp_db - Sets the threshold at which songs will be overlapped.
- Player::mixramp_delay - Additional time subtracted from the overlap calculated by mixrampdb.
- Player::random - Specified if MPD should play the queue in random order
- Player::repeat - Specifies if MPD should start from the top again when reaching the end of the queue.
- Player::volume - Sets volume to `$volume` or returns the current volume if `$volume` is omitted.
- Player::single - Enables/Disables the single-mode. If enabled MPD will play the same song over and over.
- Player::replay_gain_mode - Specifies whether MPD shall adjust the volume of songs played using ReplayGain tags.
- Player::replay_gain_status - Get the current replay gain. Currently only the variable `replay_gain_mode` is returned by MPD.
- Player::current_song - Returns an associative `array` containing information about the currently playing song.
- Player::next - Plays the next song in the Queue
- Player::pause - Pause or resume playback.
- Player::play - Plays the song position `$pos` in the Queue
- Player::play_id - Begins playing the playlist at song `$id`
- Player::previous - Plays the previous song in the Queue
- Player::seek - Seeks to `$seconds` of song `$songpos` in the Queue.
- Player::seek_id - Seeks to `$seconds` of song `$songid`. Same as `Player::seek()` but with a song ID instead of a position.
- Player::seek_cur - Seeks to `$seconds` of the current song.
- Player::stop - Stops playing.
- Playlist::__construct - This class is not intended for direct usage.
- Playlist::exists - Function to determine if the specified playlist exists.
- Playlist::get_songs - Returns a list of all songs in the specified playlist.
- Playlist::load - Loads the specified playlist into the Queue.
- Playlist::add - Adds `$uri` to the specified playlist at position `$pos`.
- Playlist::add_search - Search for songs using Filter and add them into the Playlist at position `$pos`.
- Playlist::clear - Removes all songs from the specified playlist.
- Playlist::remove_song - Deletes `$songpos` from the specified playlist.
- Playlist::move_song - Moves the song at position `$from` in the specified playlist to the position `$to`.
- Playlist::rename - Renames the specified playlist to `$new_name`
- Playlist::delete - Removes the specified playlist from the playlist directory.
- Playlist::save - Saves the queue to the specified playlist in the playlist directory
- Queue::__construct - This class is not intended for direct usage.
- Queue::add - Adds the file `$uri` to the queue (directories add recursively). `$uri` can also be a single file.
- Queue::add_id - Adds a song to the playlist (non-recursive) and returns the song id.
- Queue::add_search - Same as `search()` but adds the songs into the Queue at position `$pos`.
- Queue::add_find - Same as `find()` but this adds the matching song to the Queue.
- Queue::clear - Clears the queue
- Queue::delete - Deletes a song or a range of songs from the queue
- Queue::delete_id - Deletes the song with ID `$songid` from the Queue
- Queue::move - Moves the song at `$from` to `$to` in the queue
- Queue::move_id - Moves the song with `$from` (songid) to `$to` (playlist index) in the queue.
- Queue::find - Same as Queue::search but case-sensitive
- Queue::get_id - Returns an associative arrays containing information about the song with ID `$songid`.
- Queue::get - Returns information about all or specific songs in the Queue.
- Queue::search - Search the queue for matching songs.
- Queue::changes - Returns an array of changed songs currently in the playlist since `$version`.
- Queue::prio - Sets the priority of given songs to `$priority`.
- Queue::prio_id - Sets the priority of Song ID `$id` to $priority.
- Queue::range_id - Set's the portion of the song that should be played.
- Queue::shuffle - Shuffle the Queue.
- Queue::swap - Swap two songs in Queue. By Position.
- Queue::swap_id - Swap two songs in Queue. By ID.
- Queue::add_tag_id - Adds a tag to the specified song
- Queue::clear_tag_id - Removes a tag from the specified song
- Socket::__construct
- Socket::cmd - Send `$command` with `$params` to the MPD server.
- Socket::get_socket - Returns the socket resource.
- Socket::get_version - Returns MPDs version as string
- Socket::version_bte - Function to compare a given version string with the current version of MPD
- Socket::idle - Waits until there is a noteworthy change in one or more of MPD’s subsystems.
- Socket::close - Close the connection to the MPD socket
- Socket::kill - Kill MPD.
- Socket::get_binarylimit - Returns the current binarylimit
- Socket::set_error - Function to set the last occurred error.
- Socket::get_last_error - Return an array containing information about the last error.
- Socket::connect - Initiate connection to MPD with the parameters given at instantiation.
- Socket::disconnect - Disconnect from MPD
- Sticker::__construct - This class is not intended for direct usage.
- Sticker::get - Returns the value of the specified sticker
- Sticker::set - Add a value to the specified sticker.
- Sticker::delete - Deletes the value from the specified sticker.
- Sticker::list - Returns an associative array containing sticker names and values of the specified object.
- Sticker::find - Search the sticker database for sticker with the specified name and/or value in the specified `$uri`
- Utils::escape_params - Function to parse an array of given parameters.
- Utils::pos_or_range - Function to "convert" int or array to a pos or range argument
- Utils::parse_error - Function to parse an MPD error string to an array

© 2023 Florian Faber