Class Track

Description

Represents a track and provides different methods to query track information.

Located in /src/Track.php (line 9)

Media
   |
   --Track
Method Summary
static void addTags (string $artist, string $track,  $tags, Session $session)
static void ban (string $artist, string $track, Session $session)
static Track fromSimpleXMLElement ( $xml)
static array getInfo (string $artist, string $track, [string $mbid = null])
static mixed getPlaylist (string $artist, string $track)
static array getSimilar (string $artist, string $track, [string $mbid = null])
static array getTags (string $artist, string $track, Session $session)
static array getTopFans (string $artist, string $track, [string $mbid = null])
static array getTopTags (string $artist, string $track, [string $mbid = null])
static void love (string $artist, string $track, Session $session)
static void removeTag (string $artist, string $track, string $tag, Session $session)
static PaginatedResult search (string $track, [string $artist = null], [integer $limit = null], [integer $page = null])
static void share (string $artist, string $track,  $recipients, [string $message = null], Session $session)
Track __construct (mixed $artist, mixed $album, string $name, string $mbid, string $url,  $images, integer $listeners, integer $playCount, integer $duration,  $topTags, integer $id, string $location, boolean $streamable, boolean $fullTrack, string $wiki, integer $lastPlayed)
mixed getAlbum ()
mixed getArtist ()
integer getDuration ()
integer getId ()
integer getLastPlayed ()
string getLocation ()
array getTrackTopTags ()
string getWiki ()
boolean isFullTrack ()
boolean isStreamable ()
Methods
static method addTags (line 221)

Tag an album using a list of user supplied tags.

  • throws: Error
  • access: public
static void addTags (string $artist, string $track,  $tags, Session $session)
  • string $artist: The artist name in question. (Required)
  • string $track: The track name in question. (Required)
  • array $tags: A comma delimited list of user supplied tags to apply to this track. Accepts a maximum of 10 tags. (Required)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method ban (line 239)

Ban a track for a given user profile. This needs to be supplemented with a scrobbling submission containing the 'ban' rating (see the audioscrobbler API).

  • throws: Error
  • access: public
static void ban (string $artist, string $track, Session $session)
  • string $artist: An artist name. (Required)
  • string $track: A track name. (Required)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method fromSimpleXMLElement (line 498)

Create a Track object from a SimpleXMLElement.

  • return: A Track object.
  • access: public
static Track fromSimpleXMLElement ( $xml)
  • SimpleXMLElement $xml: A SimpleXMLElement.
static method getInfo (line 257)

Get the metadata for a track on last.fm using the artist/track name or a MusicBrainz id.

  • return: A Track object.
  • throws: Error
  • access: public
static array getInfo (string $artist, string $track, [string $mbid = null])
  • string $artist: The artist name in question. (Optional)
  • string $track: The track name in question. (Optional)
  • string $mbid: The MusicBrainz ID for the track. (Optional)
static method getPlaylist (line 480)

Get a track playlist for streaming. INOFFICIAL.

  • return: A Playlist object.
  • throws: Error
  • access: public
static mixed getPlaylist (string $artist, string $track)
  • string $artist: An artist name. (Required)
  • string $track: A track name. (Required)
static method getSimilar (line 278)

Get the similar tracks for this track on last.fm, based on listening data.

  • return: An array of Track objects.
  • throws: Error
  • access: public
static array getSimilar (string $artist, string $track, [string $mbid = null])
  • string $artist: The artist name in question. (Optional)
  • string $track: The track name in question. (Optional)
  • string $mbid: The MusicBrainz ID for the track. (Optional)
static method getTags (line 305)

Get the tags applied by an individual user to a track on last.fm.

  • return: An array of Tag objects.
  • throws: Error
  • access: public
static array getTags (string $artist, string $track, Session $session)
  • string $artist: The artist name in question. (Required)
  • string $track: The track name in question. (Required)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method getTopFans (line 331)

Get the top fans for this track on last.fm, based on listening data. Supply either track & artist name or MusicBrainz id.

  • return: An array of User objects.
  • throws: Error
  • access: public
static array getTopFans (string $artist, string $track, [string $mbid = null])
  • string $artist: The artist name in question. (Optional)
  • string $track: The track name in question. (Optional)
  • string $mbid: The MusicBrainz ID for the track. (Optional)
static method getTopTags (line 358)

Get the top tags for this track on last.fm, ordered by tag count. Supply either track & artist name or mbid.

  • return: An array of Tag objects.
  • throws: Error
  • access: public
static array getTopTags (string $artist, string $track, [string $mbid = null])
  • string $artist: The artist name in question. (Optional)
  • string $track: The track name in question. (Optional)
  • string $mbid: The MusicBrainz ID for the track. (Optional)
static method love (line 384)

Love a track for a user profile. This needs to be supplemented with a scrobbling submission containing the 'love' rating (see the audioscrobbler API).

  • throws: Error
  • access: public
static void love (string $artist, string $track, Session $session)
  • string $artist: An artist name. (Required)
  • string $track: A track name. (Required)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method removeTag (line 404)

Remove a user's tag from a track.

  • throws: Error
  • access: public
static void removeTag (string $artist, string $track, string $tag, Session $session)
  • string $artist: The artist name in question. (Required)
  • string $track: The track name in question. (Required)
  • string $tag: A single user tag to remove from this track. (Required)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method search (line 424)

Search for a track by track name. Returns track matches sorted by relevance.

  • return: A PaginatedResult object.
  • throws: Error
  • access: public
static PaginatedResult search (string $track, [string $artist = null], [integer $limit = null], [integer $page = null])
  • string $track: The track name in question. (Required)
  • string $artist: Narrow your search by specifying an artist. (Optional)
  • integer $limit: Limit the number of tracks returned at one time. Default (maximum) is 30. (Optional)
  • integer $page: Scan into the results by specifying a page number. Defaults to first page. (Optional)
static method share (line 460)

Share a track twith one or more last.fm users or other friends.

  • throws: Error
  • access: public
static void share (string $artist, string $track,  $recipients, [string $message = null], Session $session)
  • string $artist: An artist name. (Required)
  • string $track: A track name. (Required)
  • array $recipients: A comma delimited list of email addresses or last.fm usernames. Maximum is 10. (Required)
  • string $message: An optional message to send with the recommendation. If not supplied a default message will be used. (Optional)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
Constructor __construct (line 101)

Create an album object.

  • access: public
Track __construct (mixed $artist, mixed $album, string $name, string $mbid, string $url,  $images, integer $listeners, integer $playCount, integer $duration,  $topTags, integer $id, string $location, boolean $streamable, boolean $fullTrack, string $wiki, integer $lastPlayed)
  • mixed $artist: An artist object or string.
  • mixed $album: An album object or string.
  • string $name: Name of this track.
  • string $mbid: MusicBrainz ID of this track.
  • string $url: Last.fm URL of this track.
  • array $images: An array of cover art images of different sizes.
  • integer $listeners: Number of listeners of this track.
  • integer $playCount: Play count of this album.
  • integer $duration: Duration of this track.
  • array $topTags: An array of top tags of this track.
  • integer $id: ID of this track.
  • string $location: Location of this track.
  • boolean $streamable: Track is streamable.
  • boolean $fullTrack: Track is a full streamable track.
  • string $wiki: Wiki data of this track.
  • integer $lastPlayed: When this track was last played.

Redefinition of:
Media::__construct()
Create a media object.
getAlbum (line 133)

Returns the album of this track.

  • return: An de.felixbruns.lastfm.Album object or the albums name.
  • access: public
mixed getAlbum ()
getArtist (line 124)

Returns the artist of this track.

  • return: An de.felixbruns.lastfm.Artist object or the artists name.
  • access: public
mixed getArtist ()
getDuration (line 142)

Returns the duration of this track.

  • return: The duration of this track.
  • access: public
integer getDuration ()
getId (line 161)

Returns the ID of this track.

  • return: The ID of this track.
  • access: public
integer getId ()
getLastPlayed (line 206)

Returns the unix timestamp indication when this track was last played.

  • return: A unix timestamp.
  • access: public
integer getLastPlayed ()
getLocation (line 170)

Returns the location of this track.

  • return: The location of this track.
  • access: public
string getLocation ()
getTrackTopTags (line 152)

Returns the tracks top tags.

array getTrackTopTags ()
getWiki (line 197)

Returns the wiki data of this track.

  • return: Wiki data.
  • access: public
string getWiki ()
isFullTrack (line 188)

Returns if this track is a full streamable track.

  • return: A boolean.
  • access: public
boolean isFullTrack ()
isStreamable (line 179)

Returns if this track is streamable.

  • return: A boolean.
  • access: public
boolean isStreamable ()

Inherited Methods

Inherited From Media

Media::__construct()
Media::getImage()
Media::getListeners()
Media::getMbid()
Media::getName()
Media::getPlayCount()
Media::getUrl()
Class Constants

Documentation generated on Mon, 22 Dec 2008 16:57:48 +0100 by phpDocumentor 1.4.1