libmusicbrainz3  3.0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MusicBrainz::Release Class Reference

Represents a Release. More...

Inheritance diagram for MusicBrainz::Release:
MusicBrainz::Entity

Public Member Functions

 Release (const std::string &id=std::string(), const std::string &title=std::string())
 Constructor. More...
 
 ~Release ()
 Destructor. More...
 
std::string getTitle () const
 Returns the track's title. More...
 
void setTitle (const std::string &title)
 Sets the release's title. More...
 
std::string getTextLanguage () const
 Returns the language used in release and track titles. More...
 
void setTextLanguage (const std::string &language)
 Sets the language used in releaes and track titles. More...
 
std::string getTextScript () const
 Returns the script used in release and track titles. More...
 
void setTextScript (const std::string &script)
 Sets the script used in releaes and track titles. More...
 
ArtistgetArtist ()
 Returns the main artist of this release. More...
 
void setArtist (Artist *artist)
 Sets this release's main artist. More...
 
ReleaseGroupgetReleaseGroup ()
 Returns the release group of this release. More...
 
void setReleaseGroup (ReleaseGroup *releaseGroup)
 Sets this release's group. More...
 
std::string getAsin () const
 Returns the Amazon shop identifier (ASIN). More...
 
void setAsin (const std::string &asin)
 Sets the Amazon shop identifier (ASIN). More...
 
TrackListgetTracks ()
 Returns the tracks this release contains. More...
 
int getNumTracks () const
 Returns number of tracks. More...
 
TrackgetTrack (int index)
 Returns an track specified by index. More...
 
int getTracksOffset () const
 Returns the offset of the track list. More...
 
void setTracksOffset (const int offset)
 Sets the offset of the track list. More...
 
int getTracksCount () const
 Returns the number of tracks on this release. More...
 
void setTracksCount (const int count)
 Sets the count of the track list. More...
 
DiscListgetDiscs ()
 Returns the discs associated with this release. More...
 
int getNumDiscs () const
 Returns number of discs. More...
 
DiscgetDisc (int index)
 Returns an disc specified by index. More...
 
ReleaseEventListgetReleaseEvents ()
 Returns the list of release events. More...
 
int getNumReleaseEvents () const
 Returns number of release events. More...
 
ReleaseEventgetReleaseEvent (int index)
 Returns an release event specified by index. More...
 
void setTypes (const std::vector< std::string > &types)
 Sets the list of release types. More...
 
std::vector< std::string > & getTypes ()
 Returns the list of release types. More...
 
int getNumTypes () const
 Returns the number of release types. More...
 
std::string getType (int index) const
 Returns the type specified by index. More...
 
- Public Member Functions inherited from MusicBrainz::Entity
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...
 
RelationgetRelation (int index)
 Returns an relation specified by index. More...
 
TagListgetTags ()
 
int getNumTags () const
 
TaggetTag (int index)
 
float getRating () const
 
void setRating (float rating)
 
int getRatingVoteCount () const
 
void setRatingVoteCount (int count)
 

Static Public Attributes

static const std::string TYPE_NONE
 
static const std::string TYPE_ALBUM
 
static const std::string TYPE_SINGLE
 
static const std::string TYPE_EP
 
static const std::string TYPE_COMPILATION
 
static const std::string TYPE_SOUNDTRACK
 
static const std::string TYPE_SPOKENWORD
 
static const std::string TYPE_INTERVIEW
 
static const std::string TYPE_AUDIOBOOK
 
static const std::string TYPE_LIVE
 
static const std::string TYPE_REMIX
 
static const std::string TYPE_OTHER
 
static const std::string TYPE_OFFICIAL
 
static const std::string TYPE_PROMOTION
 
static const std::string TYPE_BOOTLEG
 
static const std::string TYPE_PSEUDO_RELEASE
 

Additional Inherited Members

- Protected Member Functions inherited from MusicBrainz::Entity
 Entity (const std::string &id)
 Constructor. More...
 

Detailed Description

Represents a Release.

A release within MusicBrainz is an Entity which contains Track objects. Releases may be of more than one type: There can be albums, singles, compilations, live recordings, official releases, bootlegs etc.

Note
: The current MusicBrainz server implementation supports only a limited set of types.

Constructor & Destructor Documentation

MusicBrainz::Release::Release ( const std::string &  id = std::string(),
const std::string &  title = std::string() 
)

Constructor.

Parameters
ida string containing an absolute URI
titlea string containing the title
MusicBrainz::Release::~Release ( )

Destructor.

Member Function Documentation

Artist* MusicBrainz::Release::getArtist ( )

Returns the main artist of this release.

Returns
a pointer to Artist object, or NULL
std::string MusicBrainz::Release::getAsin ( ) const

Returns the Amazon shop identifier (ASIN).

The ASIN is a 10-letter code (except for books) assigned by Amazon, which looks like 'B000002IT2' or 'B00006I4YD'.

Returns
a string containing the ASIN
Disc* MusicBrainz::Release::getDisc ( int  index)

Returns an disc specified by index.

This is equivalent to getDiscs()[index]

Warning
index must be always lower than the result of getNumDiscs()
Returns
a pointer to Disc instance
See Also
getDiscs
DiscList& MusicBrainz::Release::getDiscs ( )

Returns the discs associated with this release.

Discs are currently containers for MusicBrainz DiscIDs. Note that under rare circumstances (identical TOCs), a DiscID could be associated with more than one release.

Returns
a list of pointers to Disc objects
Todo:
make the returned vector const
int MusicBrainz::Release::getNumDiscs ( ) const

Returns number of discs.

This is equivalent to getDiscs().size()

Returns
an int containing number of discs
See Also
getDiscs
int MusicBrainz::Release::getNumReleaseEvents ( ) const

Returns number of release events.

This is equivalent to getReleaseEvents().size()

Returns
an int containing number of release events
See Also
getReleaseEvents
int MusicBrainz::Release::getNumTracks ( ) const

Returns number of tracks.

This is equivalent to getTracks().size()

Returns
an int containing number of tracks
See Also
getTracks
int MusicBrainz::Release::getNumTypes ( ) const

Returns the number of release types.

Returns
an int
ReleaseEvent* MusicBrainz::Release::getReleaseEvent ( int  index)

Returns an release event specified by index.

This is equivalent to getReleaseevents()[index]

Warning
index must be always lower than the result of getNumReleaseEvents()
Returns
a pointer to ReleaseEvent instance
See Also
getReleaseEvents
ReleaseEventList& MusicBrainz::Release::getReleaseEvents ( )

Returns the list of release events.

A Release may contain a list of so-called release events, each represented using a ReleaseEvent object. Release evens specify where and when this release was, well, released.

Returns
a list of pointers to ReleaseEvent objects
ReleaseGroup* MusicBrainz::Release::getReleaseGroup ( )

Returns the release group of this release.

Returns
a pointer to ReleaseGroup object, or NULL
std::string MusicBrainz::Release::getTextLanguage ( ) const

Returns the language used in release and track titles.

To represent the language, the ISO-639-2/T standard is used, which provides three-letter terminological language codes like "ENG", "DEU", "JPN", "KOR", "ZHO" or "YID".

Note that this refers to release and track titles, not lyrics.

Returns
a string containing the language code
See Also
getLanguageName
std::string MusicBrainz::Release::getTextScript ( ) const

Returns the script used in release and track titles.

To represent the script, ISO-15924 script codes are used. Valid codes are, among others: "Latn", "Cyrl", "Hans", "Hebr"

Note that this refers to release and track titles, not lyrics.

Returns
: a string containing the script code
See Also
: getScriptName
std::string MusicBrainz::Release::getTitle ( ) const

Returns the track's title.

The style and format of this attribute is specified by the style guide.

Returns
a string containing an absolute URI
See Also
The MusicBrainz Style Guidelines
Track* MusicBrainz::Release::getTrack ( int  index)

Returns an track specified by index.

This is equivalent to getTracks()[index]

Warning
index must be always lower than the result of getNumTracks()
Returns
a pointer to Track instance
See Also
getTracks
TrackList& MusicBrainz::Release::getTracks ( )

Returns the tracks this release contains.

Returns
a list containing pointers to Track objects
See Also
getTracksOffset
int MusicBrainz::Release::getTracksCount ( ) const

Returns the number of tracks on this release.

This may or may not match with the number of elements that getTracks and getNumTracks returns. If the count is higher than the list, it indicates that the list is incomplete.

Returns
an integer containing the count
See Also
getTracks
int MusicBrainz::Release::getTracksOffset ( ) const

Returns the offset of the track 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.

Returns
an integer containing the offset
See Also
getTracks
std::string MusicBrainz::Release::getType ( int  index) const

Returns the type specified by index.

This is an equivalent to getTypes()[index]

Warning
index must be always lower than the result of getNumTypes()
Parameters
indexindex
Returns
a string
See Also
getTypes
std::vector<std::string>& MusicBrainz::Release::getTypes ( )

Returns the list of release types.

Returns
a vector of strings string
See Also
getType
void MusicBrainz::Release::setArtist ( Artist artist)

Sets this release's main artist.

Parameters
artista pointer to Artist object
void MusicBrainz::Release::setAsin ( const std::string &  asin)

Sets the Amazon shop identifier (ASIN).

Parameters
asina string containing the ASIN
See Also
getAsin
void MusicBrainz::Release::setReleaseGroup ( ReleaseGroup releaseGroup)

Sets this release's group.

Parameters
releaseGroupa pointer to ReleaseGroup object
void MusicBrainz::Release::setTextLanguage ( const std::string &  language)

Sets the language used in releaes and track titles.

Parameters
languagea string containing a language code
See Also
getTextLanguage
void MusicBrainz::Release::setTextScript ( const std::string &  script)

Sets the script used in releaes and track titles.

Parameters
scripta string containing a script code
See Also
getTextScript
void MusicBrainz::Release::setTitle ( const std::string &  title)

Sets the release's title.

Parameters
title,:a string containing the release's title
See Also
getTitle
void MusicBrainz::Release::setTracksCount ( const int  count)

Sets the count of the track list.

Parameters
countan integer containing the count
See Also
getTracksCount
void MusicBrainz::Release::setTracksOffset ( const int  offset)

Sets the offset of the track list.

Parameters
offsetan integer containing the offset
See Also
getTracksOffset
void MusicBrainz::Release::setTypes ( const std::vector< std::string > &  types)

Sets the list of release types.

Parameters
typesa vector of strings string

Member Data Documentation

const std::string MusicBrainz::Release::TYPE_ALBUM
static
const std::string MusicBrainz::Release::TYPE_AUDIOBOOK
static
const std::string MusicBrainz::Release::TYPE_BOOTLEG
static
const std::string MusicBrainz::Release::TYPE_COMPILATION
static
const std::string MusicBrainz::Release::TYPE_EP
static
const std::string MusicBrainz::Release::TYPE_INTERVIEW
static
const std::string MusicBrainz::Release::TYPE_LIVE
static
const std::string MusicBrainz::Release::TYPE_NONE
static
const std::string MusicBrainz::Release::TYPE_OFFICIAL
static
const std::string MusicBrainz::Release::TYPE_OTHER
static
const std::string MusicBrainz::Release::TYPE_PROMOTION
static
const std::string MusicBrainz::Release::TYPE_PSEUDO_RELEASE
static
const std::string MusicBrainz::Release::TYPE_REMIX
static
const std::string MusicBrainz::Release::TYPE_SINGLE
static
const std::string MusicBrainz::Release::TYPE_SOUNDTRACK
static
const std::string MusicBrainz::Release::TYPE_SPOKENWORD
static