libmusicbrainz3
3.0.3
|
Represents a track. More...
Public Member Functions | |
Track (const std::string &id=std::string(), const std::string &title=std::string()) | |
Constructor. More... | |
virtual | ~Track () |
Destructor. More... | |
std::string | getTitle () const |
Returns the track's title. More... | |
void | setTitle (const std::string &title) |
Sets the track's title. More... | |
Artist * | getArtist () |
Returns the main artist of this track. More... | |
void | setArtist (Artist *artist) |
Sets this track's main artist. More... | |
int | getDuration () const |
Returns the duration of this track in milliseconds. More... | |
void | setDuration (const int duration) |
Sets the duration of this track in milliseconds. More... | |
ReleaseList & | getReleases () |
Returns a list of releases from this artist. More... | |
int | getNumReleases () const |
Returns number of releases. More... | |
Release * | getRelease (int index) |
Returns an release specified by index. More... | |
void | addRelease (Release *release) |
Adds a release to this artist's list of releases. More... | |
int | getReleasesOffset () const |
Returns the offset of the release list. More... | |
void | setReleasesOffset (const int offset) |
Sets the offset of the release list. More... | |
int | getReleasesCount () const |
Returns the number of existing releases. More... | |
void | setReleasesCount (const int count) |
Sets the count of the release list. More... | |
IsrcList & | getIsrcs () |
Returns the list of ISRCs for this track. More... | |
int | getNumIsrcs () const |
Returns number of ISRCs. More... | |
std::string | getIsrc (int index) |
Returns ISRC specified by index. More... | |
void | addIsrc (const std::string &isrc) |
Adds an ISRC for this track. More... | |
![]() | |
virtual | ~Entity () |
Destructor. More... | |
virtual std::string | getId () const |
Returns a MusicBrainz ID. More... | |
virtual void | setId (const std::string &value) |
Sets a MusicBrainz ID. More... | |
RelationList | getRelations (const std::string &targetType=std::string(), const std::string &relationType=std::string()) const |
Returns a list of relations. More... | |
void | addRelation (Relation *relation) |
Adds a relation. More... | |
int | getNumRelations () const |
Returns number of relations. More... | |
Relation * | getRelation (int index) |
Returns an relation specified by index. More... | |
TagList & | getTags () |
int | getNumTags () const |
Tag * | getTag (int index) |
float | getRating () const |
void | setRating (float rating) |
int | getRatingVoteCount () const |
void | setRatingVoteCount (int count) |
Additional Inherited Members | |
![]() | |
Entity (const std::string &id) | |
Constructor. More... | |
Represents a track.
This class represents a track which may appear on one or more releases. A track may be associated with exactly one artist (the I{main} artist).
Using getReleases, you can find out on which releases this track appears. To get the track number, too, use the Release::getTracksOffset method.
MusicBrainz::Track::Track | ( | const std::string & | id = std::string() , |
const std::string & | title = std::string() |
||
) |
Constructor.
id | a string containing an absolute URI |
title | a string containing the title |
|
virtual |
Destructor.
void MusicBrainz::Track::addIsrc | ( | const std::string & | isrc | ) |
Adds an ISRC for this track.
isrc |
void MusicBrainz::Track::addRelease | ( | Release * | release | ) |
Adds a release to this artist's list of releases.
release | a pointer to Release object |
Artist* MusicBrainz::Track::getArtist | ( | ) |
Returns the main artist of this track.
int MusicBrainz::Track::getDuration | ( | ) | const |
Returns the duration of this track in milliseconds.
std::string MusicBrainz::Track::getIsrc | ( | int | index | ) |
Returns ISRC specified by index.
This is equivalent to getIsrcs()
[index]
IsrcList& MusicBrainz::Track::getIsrcs | ( | ) |
Returns the list of ISRCs for this track.
int MusicBrainz::Track::getNumIsrcs | ( | ) | const |
Returns number of ISRCs.
This is equivalent to getIsrcs()
.size()
int MusicBrainz::Track::getNumReleases | ( | ) | const |
Returns number of releases.
This is equivalent to getReleases()
.size()
Release* MusicBrainz::Track::getRelease | ( | int | index | ) |
Returns an release specified by index.
This is equivalent to getReleases()
[index]
ReleaseList& MusicBrainz::Track::getReleases | ( | ) |
Returns a list of releases from this artist.
This may also include releases where this artist isn't the main artist but has just contributed one or more tracks (aka VA-Releases).
int MusicBrainz::Track::getReleasesCount | ( | ) | const |
Returns the number of existing releases.
This may or may not match with the number of elements that getReleases and getNumReleases returns. If the count is higher than the list, it indicates that the list is incomplete.
int MusicBrainz::Track::getReleasesOffset | ( | ) | const |
Returns the offset of the release list.
This is used if the track list is incomplete (ie. the web service only returned part of the tracks on this release). Note that the offset value is zero-based, which means track 0 is the first track.
std::string MusicBrainz::Track::getTitle | ( | ) | const |
Returns the track's title.
The style and format of this attribute is specified by the style guide.
void MusicBrainz::Track::setArtist | ( | Artist * | artist | ) |
Sets this track's main artist.
artist | a pointer to Artist object, or NULL |
void MusicBrainz::Track::setDuration | ( | const int | duration | ) |
Sets the duration of this track in milliseconds.
duration | an int containing the duration in milliseconds |
void MusicBrainz::Track::setReleasesCount | ( | const int | count | ) |
Sets the count of the release list.
count | an integer containing the count |
void MusicBrainz::Track::setReleasesOffset | ( | const int | offset | ) |
Sets the offset of the release list.
offset | an integer containing the offset |
void MusicBrainz::Track::setTitle | ( | const std::string & | title | ) |