예제 #1
0
 /**
  * Liefert Informationen über einen Song aus der aktuelle Wiedergabeliste.
  *
  * @param integer $Index
  * $Index für die absolute Position des Titels in der Wiedergabeliste.
  * 0 für den aktuellen Titel
  *  
  * @return array
  *  ["duration"]=>string
  *  ["id"]=>string
  *  ["title"]=>string
  *  ["genre"]=>string
  *  ["album"]=>string
  *  ["artist"]=>string
  *  ["disc"]=> string
  *  ["disccount"]=>string
  *  ["bitrate"]=>string
  *  ["tracknum"]=>string
  * @exception 
  */
 public function GetSongInfoByTrackIndex(integer $Index)
 {
     if (!$this->init()) {
         return false;
     }
     if (is_int($Index)) {
         $Index--;
     } else {
         throw new Exception("Index must be integer.");
     }
     if ($Index == -1) {
         $Index = '-';
     }
     $Data = $this->SendLSQData(new LSQData(array('status', (string) $Index, '1'), 'tags:gladiqrRtueJINpsy'));
     $SongInfo = new LSMSongInfo($Data);
     $SongArray = $SongInfo->GetSong();
     if (count($SongArray) == 1) {
         throw new Exception("Index not valid.");
     }
     return $SongArray;
 }
예제 #2
0
 public function GetSongInfoByFileURL(string $FileURL)
 {
     if (!is_string($FileURL)) {
         trigger_error("FileURL must be string.", E_USER_NOTICE);
         return false;
     }
     $Data = $this->SendLMSData(new LMSData(array('songinfo', '0', '20'), array('url:' . rawurlencode($FileURL), 'tags:gladiqrRtueJINpsy')));
     if ($Data === false) {
         return FALSE;
     }
     $SongInfo = new LSMSongInfo($Data);
     $Song = $SongInfo->GetSong();
     if (count($Song) == 1) {
         trigger_error("FileURL not valid.", E_USER_NOTICE);
         return false;
     }
     return $Song;
 }