new Songlist(client, source)
Generic playlist like interface. The Songlist function takes an object and returns
a Songlist object which representing a list of songs. This can be used to represent
the queue or a playlist
Parameters:
| Name | Type | Description | 
|---|---|---|
client | 
            
            MPD | the MPD client object that owns this Songlist  | 
        
source | 
            
            Object | configuration object that contains a list of songs  | 
        
- Source:
 
Methods
- 
    
getMetadata() → {directory_metadata}
 - 
    
    
    
get the MPD reported metadata, raw
- Source:
 
Returns:
gets the all of the raw metadata MPD provided
- Type
 - directory_metadata
 
 - 
    
getPath() → {String}
 - 
    
    
    
get the path to (including) this directory. relative to the MPD server's media root
- Source:
 
Returns:
path to this directory. relative to the MPD server's media root
- Type
 - String
 
 - 
    
getLastModified() → {Date}
 - 
    
    
    
when was the directory last altered
- Source:
 
Returns:
when the song file last altered
- Type
 - Date
 
 - 
    
clone() → {Directory}
 - 
    
    
    
return a copy of this object. the point of this is to return an object that the used cannot use to mutate this one, but that has the exact same behaviour
- Source:
 
Returns:
- Type
 - Directory
 
 - 
    
<abstract> addSongByFile(pathname)
 - 
    
    
    
given a song filename add it to this Songlist
Parameters:
Name Type Description pathnameString relative path to the song file in the MPD database
- Source:
 
 - 
    
<abstract> clear()
 - 
    
    
    
remove all songs from this Songlist
- Source:
 
 - 
    
<abstract> removeSongByPosition(position)
 - 
    
    
    
remove a song as identified
Parameters:
Name Type Description positionInteger position on the list of the song you want to remove
- Source:
 
 - 
    
<abstract> moveSongByPosition(position, to)
 - 
    
    
    
remove a song as identified
Parameters:
Name Type Description positionInteger position on the list of the song you want to remove
toInteger position on the list where you want the song to to be
- Source:
 
 - 
    
<abstract> swapSongsByPosition(position_a, position_b)
 - 
    
    
    
swap two songs
Parameters:
Name Type Description position_aInteger position on the list of the song you want to move
position_bInteger position on the list of the other song you want to move
- Source:
 
 - 
    
getSongs() → {Array.<Song>}
 - 
    
    
    
get the list of songs
- Source:
 
Returns:
- Type
 - Array.<Song>
 
 - 
    
clone() → {Songlist}
 - 
    
    
    
return a copy of this object. the point of this is to return an object that the used cannot use to mutate this one, but that has the exact same behaviour
- Source:
 
Returns:
- Type
 - Songlist