Members
- 
    
raw_buffer
 - 
    
    
running string of partial responces from MPD
- Source:
 
 - 
    
raw_lines
 - 
    
    
running list of lines we have gotten from the server
- Source:
 
 - 
    
inited
 - 
    
    
false if we are disconnected or have not completed out initial data load yet
- Source:
 
 - 
    
queued_events
 - 
    
    
events that have been held until we are consistent
- Source:
 
 - 
    
tag_types
 - 
    
    
list of tags that are acceptable for this server
- Source:
 
 - 
    
outputs
 - 
    
    
list of available outputs
- Source:
 
 - 
    
responceProcessor
 - 
    
    
method called when we get a responce from MPD
- Source:
 
 - 
    
command_queue
 - 
    
    
commands that are yet to be processed
- Source:
 
 - 
    
last_error
 - 
    
    
last error we had
- Source:
 
 
Type Definitions
- 
    
state
 - 
    
    
Our understanding of what the server looks like
Type:
- Object
 
- Source:
 
Properties:
Name Type Description versionString server protocol version
connectedBoolean if we are currently connected to the server or not
playstateString enum, PLAYING, STOPPED, PAUSED
actual MPD attribute: state (int 0,1,2)volumeInteger 0 to 1 the current volume
repeatBoolean true if the server is configured to repeat the current song
singleBoolean true if the server is configured to just play one song then quit
consumeBoolean true if the server is configured to not repeat songs in a playlist
randomBoolean true if the server is configured to play music in a random order
crossfadeInteger nonnegitive integer representing number of seconds to crossfade songs
mix_ramp_thresholdFloat not sure what this is, but it's reported
actual MPD attribute: mixrampdbcurrent_songObject info about the currently playing song
Properties
Name Type Description queue_idxInteger which song in the current playlist is active
actual MPD attribute: songelapsed_timeFloat time into the currently playing song in seconds
actual MPD attribute: elapsedidInteger the id of the current song
actual MPD attribute: songidnext_songObject info about the song next to play on the queue
Properties
Name Type Description queue_idxInteger which song in the current playlist is active
actual attribute: songidInteger the id of the current song
actual attribute: songidcurrent_queueQueue the songs that are currently in rotation for playing, in the order they are to play (unless random is set to true)
queue_versionInteger a number associated with the queue that changes every time the queue changes
playlistsArray.<String> names of all of the saved playlists
 - 
    
song_metadata
 - 
    
    
Object representation of a song. This is a direct translation of the data that MPD returns, if MPD does not think a particular
song should have a property it won't return one. What is documented here are the properties I have seen MPD return, not all of
these will be returned all of the time. The properties file, date, and time appear to be consistently returned, but MPD makes
no promises. All other properties I frequently find missing, you will need to check to make sure they are present before using.Type:
- Object
 
- Source:
 
Properties:
Name Type Argument Description fileString the full path to the music file in MPD's music directory. relative path.
last_modifiedDate last time the file was altered
timeInteger duration of song in seconds
artistString <optional> 
optional metadata
titleString <optional> 
optional metadata
albumString <optional> 
optional metadata
trackString <optional> 
optional metadata
genreString <optional> 
optional metadata
diskString <optional> 
optional metadata
idInteger ( queue songs only @see QueueSong ) a persistent identifer for this song on the queue, is only relevent to the queue, is not associated with the song it's self
posInteger ( queue songs only @see QueueSong ) the position of the song on the queue. the queue index.
 - 
    
directory_metadata
 - 
    
    
metadata returned about a directory from MPD
- Source:
 
Properties:
Name Type Description directoryString file path relative to MPD's music folders
last_modifiedDate last time this directory was modified
 - 
    
output_metadata
 - 
    
    
metadata returned about an output from MPD
- Source:
 
Properties:
Name Type Description outputenabledInteger outputidInteger outputnameString  - 
    
playlistCallback(playlist)
 - 
    
    
    
Is passed a playlist
Parameters:
Name Type Description playlistPlaylist a playlist
- Source:
 
 - 
    
searchResultsCallback(directory_contents, search_results)
 - 
    
    
    
Lists all songs and directories in path (blank string for root). also returns song file metadata info
Parameters:
Name Type Argument Description directory_contentsArray.<directory> <optional> 
the contents of the directory, will be an array of objects representing director(y|ies) and/or song(s) interleived
/**
is given search results when the search is completesearch_resultsArray.<song> all of the songs that match the tag values you asked for
- Source:
 
 - 
    
searchCountCallback(search_result_count)
 - 
    
    
    
is passed the number of songs matching the given search criteria
Parameters:
Name Type Description search_result_countInteger number of songs matched by the tag values
- Source:
 
 - 
    
errorEventHandler(responce_event, client)
 - 
    
    
    
event handler for 'Error' events
error event hander callbackParameters:
Name Type Argument Description responce_eventObject <optional> 
-
clientMPD the client that this event happened on
- Source:
 
 - 
    
errorEventHandler(responce_event, client)
 - 
    
    
    
event handler for 'AuthFailure' events
when we get a responce from MPD that we aren't allowed to do somethingParameters:
Name Type Argument Description responce_eventObject <optional> 
-
clientMPD the client that this event happened on
- Source:
 
 - 
    
eventHandler(responce_event, client)
 - 
    
    
    
generic event hander callback called when any sort of event happens
Parameters:
Name Type Argument Description responce_eventObject <optional> 
{type:String:data:Object} data depends onf type, see the other event handlers
clientMPD the client that this event happened on
- Source:
 
 - 
    
unhandledEventHandler(responce_event, client)
 - 
    
    
    
generic event hander callback called when any sort of event happens that doesn't have any handler set for it
Parameters:
Name Type Argument Description responce_eventObject <optional> 
{type:String:data:Object} data depends onf type, see the other event handlers
clientMPD the client that this event happened on
- Source:
 
 - 
    
databaseChangingEventHandler(responce_event, client)
 - 
    
    
    
event handler for 'DatabaseChanging' events
event hander callback for when the music database has started changing, there will be a DataLoaded event following this (unless something goes HORRIBLY wrong)Parameters:
Name Type Argument Description responce_eventObject <optional> 
-
clientMPD the client that this event happened on
- Source:
 
 - 
    
dataLoadedEventHandler(state, client)
 - 
    
    
    
event handler for 'DataLoaded' events
called when a bulk dataload has completed and the mpd client's data is in a ocnsistent state. fired when a client has finished recovering from a reload which might be caused by a database change or (re)connectingParameters:
Name Type Description statestate state object, the same as is returned by getState
clientMPD the client that this event happened on
- Source:
 
 - 
    
stateChangedEventHandler(state, client)
 - 
    
    
    
event handler for 'StateChanged' events
called when the state of the player has changed. This can be an scalar value. Things like currently playing song changing, volume, settings (consume, repeat, etc)
NOT called when the current play time changes, because that changes continuusly, you will need to poll thatParameters:
Name Type Description statestate state object, the same as is returned by getState
clientMPD the client that this event happened on
- Source:
 
 - 
    
OutputChangedEventHandler(outputs, client)
 - 
    
    
    
event handler for 'OutputChanged' events
called when an output of the player has changed (enabled/disabled).Parameters:
Name Type Description outputsArray.<Output> state object, the same as is returned by getState
clientMPD the client that this event happened on
- Source:
 
 - 
    
queueChangedEventHandler(queue, client)
 - 
    
    
    
event handler for 'QueueChanged' events
something about the queue of playing songs changedParameters:
Name Type Description queueQueue the new queue
clientMPD the client that this event happened on
- Source:
 
 - 
    
playlistsChangedEventHandler(playlists, client)
 - 
    
    
    
event handler for 'PlaylistsChanged' events
some playlist somewhere changed. is an array of {playlist:String, last_modified:Date}Parameters:
Name Type Argument Description playlistsarray <optional> 
[string] array of names of all playlists. note: there doesn't seem to be a way to get just the changed ones, so you get the list of everything, you can tell if something was added or removed but you have no way of telling if any particular playlist has been changed. this is a limitation of MPD
clientMPD the client that this event happened on
- Source:
 
 - 
    
connectEventHandler(client)
 - 
    
    
    
event handler for 'Connect' events
the client has connected, but no data has yet loaded
you can use this to setup event handlers, or just do that before connectingParameters:
Name Type Description clientMPD the client that this event happened on
- Source:
 
 - 
    
disconnectEventHandler(client)
 - 
    
    
    
event handler for 'Disconnect' events
the client has disconnectedParameters:
Name Type Description clientMPD the client that this event happened on
- Source: