MusicBrainz::Release Class Reference

Represents a Release. More...

Inheritance diagram for MusicBrainz::Release:

MusicBrainz::Entity

List of all members.

Public Member Functions

 Release (const std::string &id=std::string(), const std::string &title=std::string())
 Constructor.
 ~Release ()
 Destructor.
std::string getTitle () const
 Returns the track's title.
void setTitle (const std::string &title)
 Sets the release's title.
std::string getTextLanguage () const
 Returns the language used in release and track titles.
void setTextLanguage (const std::string &language)
 Sets the language used in releaes and track titles.
std::string getTextScript () const
 Returns the script used in release and track titles.
void setTextScript (const std::string &script)
 Sets the script used in releaes and track titles.
ArtistgetArtist ()
 Returns the main artist of this release.
void setArtist (Artist *artist)
 Sets this release's main artist.
std::string getAsin () const
 Returns the Amazon shop identifier (ASIN).
void setAsin (const std::string &asin)
 Sets the Amazon shop identifier (ASIN).
TrackListgetTracks ()
 Returns the tracks this release contains.
int getNumTracks () const
 Returns number of tracks.
TrackgetTrack (int index)
 Returns an track specified by index.
int getTracksOffset () const
 Returns the offset of the track list.
void setTracksOffset (const int offset)
 Sets the offset of the track list.
int getTracksCount () const
 Returns the number of tracks on this release.
void setTracksCount (const int count)
 Sets the count of the track list.
DiscListgetDiscs ()
 Returns the discs associated with this release.
int getNumDiscs () const
 Returns number of discs.
DiscgetDisc (int index)
 Returns an disc specified by index.
ReleaseEventListgetReleaseEvents ()
 Returns the list of release events.
int getNumReleaseEvents () const
 Returns number of release events.
ReleaseEventgetReleaseEvent (int index)
 Returns an release event specified by index.
void setTypes (const std::vector< std::string > &types)
 Sets the list of release types.
std::vector< std::string > & getTypes ()
 Returns the list of release types.
int getNumTypes () const
 Returns the number of release types.
std::string getType (int index) const
 Returns the type specified by index.

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


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:
id a string containing an absolute URI
title a string containing the title

MusicBrainz::Release::~Release (  ) 

Destructor.


Member Function Documentation

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

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

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

void MusicBrainz::Release::setTextLanguage ( const std::string &  language  ) 

Sets the language used in releaes and track titles.

Parameters:
language a string containing a language code
See also:
getTextLanguage

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

void MusicBrainz::Release::setTextScript ( const std::string &  script  ) 

Sets the script used in releaes and track titles.

Parameters:
script a string containing a script code
See also:
getTextScript

Artist* MusicBrainz::Release::getArtist (  ) 

Returns the main artist of this release.

Returns:
a pointer to Artist object, or NULL

void MusicBrainz::Release::setArtist ( Artist artist  ) 

Sets this release's main artist.

Parameters:
artist a pointer to Artist object

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

void MusicBrainz::Release::setAsin ( const std::string &  asin  ) 

Sets the Amazon shop identifier (ASIN).

Parameters:
asin a string containing the ASIN
See also:
getAsin

TrackList& MusicBrainz::Release::getTracks (  ) 

Returns the tracks this release contains.

Returns:
a list containing pointers to Track objects
See also:
getTracksOffset

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

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

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

void MusicBrainz::Release::setTracksOffset ( const int  offset  ) 

Sets the offset of the track list.

Parameters:
offset an integer containing the offset
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

void MusicBrainz::Release::setTracksCount ( const int  count  ) 

Sets the count of the track list.

Parameters:
count an integer containing the count
See also:
getTracksCount

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

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

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

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

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

void MusicBrainz::Release::setTypes ( const std::vector< std::string > &  types  ) 

Sets the list of release types.

Parameters:
types a vector of strings string

std::vector<std::string>& MusicBrainz::Release::getTypes (  ) 

Returns the list of release types.

Returns:
a vector of strings string
See also:
getType

int MusicBrainz::Release::getNumTypes (  )  const

Returns the number of release types.

Returns:
an int

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:
index index
Returns:
a string
See also:
getTypes


Member Data Documentation

const std::string MusicBrainz::Release::TYPE_NONE [static]

const std::string MusicBrainz::Release::TYPE_ALBUM [static]

const std::string MusicBrainz::Release::TYPE_SINGLE [static]

const std::string MusicBrainz::Release::TYPE_EP [static]

const std::string MusicBrainz::Release::TYPE_COMPILATION [static]

const std::string MusicBrainz::Release::TYPE_SOUNDTRACK [static]

const std::string MusicBrainz::Release::TYPE_SPOKENWORD [static]

const std::string MusicBrainz::Release::TYPE_INTERVIEW [static]

const std::string MusicBrainz::Release::TYPE_AUDIOBOOK [static]

const std::string MusicBrainz::Release::TYPE_LIVE [static]

const std::string MusicBrainz::Release::TYPE_REMIX [static]

const std::string MusicBrainz::Release::TYPE_OTHER [static]

const std::string MusicBrainz::Release::TYPE_OFFICIAL [static]

const std::string MusicBrainz::Release::TYPE_PROMOTION [static]

const std::string MusicBrainz::Release::TYPE_BOOTLEG [static]

const std::string MusicBrainz::Release::TYPE_PSEUDO_RELEASE [static]


Generated on Wed Jan 21 10:39:53 2009 for libmusicbrainz3 by  doxygen 1.5.6