Exemplo n.º 1
0
 /**
  * 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);
 }
Exemplo n.º 2
0
 /**
  * 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;
 }
Exemplo n.º 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;
 }