Net_MPD
[ class tree: Net_MPD ] [ index: Net_MPD ] [ all elements ]

Class: Net_MPD_Playlist

Source Location: /Net_MPD-1.0.2/Net/MPD/Playlist.php

Class Overview

Net_MPD_Common
   |
   --Net_MPD_Playlist

API for the playlist portion of Music Player Daemon commands


Author(s):

Version:

  • CVS: $ID:$

Copyright:

  • 2006 Graham Christensen

Methods


Inherited Variables

Inherited Methods

Class: Net_MPD_Common

Net_MPD_Common::__construct()
Set connection params
Net_MPD_Common::connect()
Connect to MPD
Net_MPD_Common::disconnect()
Disconnect from MPD
Net_MPD_Common::getCommands()
Used to discover which commands are available
Net_MPD_Common::getErrorData()
Get the current error data
Net_MPD_Common::getErrors()
A method to access errors
Net_MPD_Common::getNotCommands()
Used to discover commands that are not available
Net_MPD_Common::getStats()
Get various statistics about the MPD server
Net_MPD_Common::getStatus()
Get the status of the MPD server
Net_MPD_Common::isConnected()
Check connection status
Net_MPD_Common::parseOutput()
Parse MPD output on a line-by-line basis creating output that is easy to work with
Net_MPD_Common::ping()
Ping the MPD server to keep the connection running
Net_MPD_Common::read()
Read data from the socket
Net_MPD_Common::runCommand()
Run command
Net_MPD_Common::write()
Write data to the socket

Class Details

[line 45]
API for the playlist portion of Music Player Daemon commands

Used for maintaining, creating, and utilizing playlists in MPD



[ Top ]


Method Detail

addSong   [line 67]

bool addSong( $file $file)

Add file to playlist
  • Access: public

Parameters:

$file   $file   —  string filename

[ Top ]

clear   [line 80]

bool clear( )

Clear the playlist
  • Access: public

[ Top ]

deletePlaylist   [line 227]

true deletePlaylist( $playlist $playlist)

Delete a playlist
  • Access: public

Parameters:

$playlist   $playlist   —  string playlist name

[ Top ]

deleteSong   [line 110]

bool deleteSong( $song $song)

Delete song from playlist
  • Access: public

Parameters:

$song   $song   —  int song position in playlist

[ Top ]

deleteSongId   [line 124]

bool deleteSongId( $id $id)

Delete song from playlist by song Id
  • Access: public

Parameters:

$id   $id   —  int song Id

[ Top ]

getChanges   [line 212]

array getChanges( $version $version, [$limit $limit = false])

Get playlist changes
  • Return: of changes
  • Access: public

Parameters:

$version   $version   —  int playlist version
$limit   $limit   —  boolean true to limit return to only position and id

[ Top ]

getCurrentSong   [line 93]

array getCurrentSong( )

Gets the current song and related information
  • Return: of data
  • Access: public

[ Top ]

getPlaylistInfo   [line 182]

array getPlaylistInfo( [$song $song = null])

Displays metadata for songs in the playlist by position Id
  • Return: of song metadata
  • Access: public

Parameters:

$song   $song   —  int song position, optional

[ Top ]

getPlaylistInfoId   [line 196]

array getPlaylistInfoId( [$song $song = null])

Displays metadata for songs in the playlist
  • Return: of song metadata
  • Access: public

Parameters:

$song   $song   —  int song Id, optional

[ Top ]

getPlaylists   [line 53]

bool getPlaylists( [$dir $dir = ''])

List playlists in specified directory
  • Return: true on success int on failure
  • Access: public

Parameters:

$dir   $dir   —  string directory path, optional

[ Top ]

loadPlaylist   [line 138]

bool loadPlaylist( $playlist $playlist)

Loads a playlist into the current playlist
  • Access: public

Parameters:

$playlist   $playlist   —  string playlist name

[ Top ]

moveSong   [line 153]

bool moveSong( $from $from, $to $to)

Move song in the playlist
  • Access: public

Parameters:

$from   $from   —  int song position in the playlist
$to   $to   —  int song position to move it to

[ Top ]

moveSongId   [line 168]

bool moveSongId( $from $fromId, $to $toId)

Move song in the playlist by Id
  • Access: public

Parameters:

$from   $fromId   —  int song Id
$to   $toId   —  int song Id to move it to

[ Top ]

savePlaylist   [line 241]

bool savePlaylist( $playlist $playlist)

Save the playlist
  • Access: public

Parameters:

$playlist   $playlist   —  string playlist name

[ Top ]

shuffle   [line 254]

true shuffle( )

Shuffle the playlist
  • Access: public

[ Top ]

swapSong   [line 269]

bool swapSong( $song1 $song1, $song2 $song2)

Swap song by position in the playlist
  • Access: public

Parameters:

$song1   $song1   —  int song position from
$song2   $song2   —  int song position to

[ Top ]

swapSongId   [line 284]

true swapSongId( $song1 $songId1, $song2 $songId2)

Swaps a song with another song, by Id
  • Access: public

Parameters:

$song1   $songId1   —  int Id of the first song
$song2   $songId2   —  int Id of the second song

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:21:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.