コード例 #1
0
ファイル: module.php プロジェクト: Nall-chan/IPSSqueezeBox
 /**
  * Liefert Informationen über alle Songs aus der aktuelle Wiedergabeliste.
  *
  * @return array[index]
  *      ["duration"]=>string
  *      ["id"]=>string
  *      ["title"]=>string
  *      ["genre"]=>string
  *      ["album"]=>string
  *      ["artist"]=>string
  *      ["disc"]=> string
  *      ["disccount"]=>string
  *      ["bitrate"]=>string
  *      ["tracknum"]=>string
  * @exception 
  */
 public function GetSongInfoOfCurrentPlaylist()
 {
     $max = GetValueInteger($this->GetIDForIdent('Tracks'));
     $Data = $this->SendLSQData(new LSQData(array('status', '0', (string) $max), 'tags:gladiqrRtueJINpsy'));
     $SongInfo = new LSMSongInfo($Data);
     return $SongInfo->GetAllSongs();
 }
コード例 #2
0
ファイル: module.php プロジェクト: Nall-chan/IPSSqueezeBox
 public function GetPlaylists()
 {
     $ret = $this->SendLMSData(new LMSData('playlists', array(0, 10000, 'tags:u')));
     if ($ret === false) {
         return false;
     }
     $SongInfo = new LSMSongInfo($ret);
     $Playlists = $SongInfo->GetAllSongs();
     foreach ($Playlists as $Key => $Playlist) {
         $raw = @$this->SendLMSData(new LMSData(array('playlists', 'tracks'), array(0, 10000, 'playlist_id:' . $Playlist['Id'], 'tags:d'), true));
         if ($raw === false) {
             trigger_error("Error read Playlist " . $Playlist['Id'] . ".", E_USER_NOTICE);
             $Playlists[$Key]['Playlist'] = $Playlists[$Key]['Playlist'] . " (ERROR ON READ DATA)";
             $Playlists[$Key]['Tracks'] = "";
             $Playlists[$Key]['Duration'] = "";
             continue;
         }
         $SongInfo = new LSMSongInfo($raw);
         $Playlists[$Key]['Tracks'] = $SongInfo->CountAllSongs();
         $Playlists[$Key]['Duration'] = $SongInfo->GetTotalDuration();
     }
     return $Playlists;
 }