コード例 #1
0
ファイル: Deezer.php プロジェクト: Masterfion/plugin-sonos
 /**
  * Create a Deezer track object.
  *
  * @param string $uri The URI of the track or the Deezer ID of the track
  */
 public function __construct($uri)
 {
     # If this is a Deezer track ID and not a URI then convert it to a URI now
     if (substr($uri, 0, strlen(self::PREFIX)) !== self::PREFIX) {
         $uri = self::PREFIX . urlencode(":{$uri}.mp3");
     }
     parent::__construct($uri);
 }
コード例 #2
0
ファイル: State.php プロジェクト: duncan3dc/sonos
 /**
  * Update the track properties using an xml element.
  *
  * @param XmlElement $xml The xml element representing the track meta data.
  * @param Controller $controller A controller instance on the playlist's network
  *
  * @return static
  */
 public static function createFromXml(XmlElement $xml, Controller $controller)
 {
     $track = parent::createFromXml($xml, $controller);
     $track->trackNumber = $track->number;
     return $track;
 }
コード例 #3
0
 /**
  * Update the track properties using an xml element.
  *
  * @param XmlBase $xml The xml element representing the track meta data.
  * @param Controller $controller A controller instance on the playlist's network
  *
  * @return static
  */
 public static function createFromXml(XmlBase $xml, Controller $controller)
 {
     $track = parent::createFromXml($xml, $controller);
     $track->queueId = $xml->getAttribute("id");
     return $track;
 }