コード例 #1
0
ファイル: Song.php プロジェクト: monstergfx/pi-music
 public static function getList()
 {
     // get the list
     $result = Music::send('listallinfo');
     // return the values
     return Music::buildSongList($result['values']);
 }
コード例 #2
0
ファイル: Artist.php プロジェクト: monstergfx/pi-music
 /**
  * Get all the songs for an artist
  * 
  * @param string $artist 
  * 
  * @return array
  */
 public static function getSongs($artist)
 {
     // query the MPD database
     $result = Music::send('search', 'artist', $artist);
     // get the list of songs
     return Music::buildSongList($result['values']);
 }
コード例 #3
0
ファイル: Playlist.php プロジェクト: monstergfx/pi-music
 public static function getSongs($playlist)
 {
     // send the command to MPD
     $results = Music::send('listplaylistinfo', $playlist);
     // return the list of songs
     return Music::buildSongList($results['values']);
 }
コード例 #4
0
ファイル: Genre.php プロジェクト: monstergfx/pi-music
 /**
  * Get the list of songs for a genre, artist, and album
  *
  * @param string $genre
  * @param string $artist
  * @param string $album
  * @return array
  */
 public static function getSongs($genre, $artist, $album)
 {
     // query the MPD database
     if ($album) {
         $result = Music::send('search', 'genre', $genre, 'artist', $artist, 'album', $album);
     } else {
         $result = Music::send('search', 'genre', $genre, 'artist', $artist);
     }
     // get the list of songs
     return Music::buildSongList($result['values']);
 }