libmusicbrainz3  3.0.2
MusicBrainz::Artist Class Reference

Represents an artist. More...

Inheritance diagram for MusicBrainz::Artist:
MusicBrainz::Entity

Public Member Functions

 Artist (const std::string &id="", const std::string &type="", const std::string &name="", const std::string &sortName="")
 Constructor. More...
 
virtual ~Artist ()
 Destructor. More...
 
std::string getType () const
 Returns the artist's type. More...
 
void setType (const std::string &type)
 Sets the artist's type. More...
 
std::string getName () const
 Returns the artist's name. More...
 
void setName (const std::string &name)
 Sets the artist's name. More...
 
std::string getSortName () const
 Returns the artist's sort name. More...
 
void setSortName (const std::string &sortName)
 Sets the artist's sort name. More...
 
std::string getDisambiguation () const
 Returns the disambiguation attribute. More...
 
void setDisambiguation (const std::string &disambiguation)
 Sets the disambiguation attribute. More...
 
std::string getUniqueName () const
 Returns a unique artist name (using disambiguation). More...
 
std::string getBeginDate () const
 Returns the birth/foundation date. More...
 
void setBeginDate (const std::string &dateStr)
 Sets the begin/foundation date. More...
 
std::string getEndDate () const
 Get the death/dissolving date. More...
 
void setEndDate (const std::string &dateStr)
 Sets the death/dissolving date. More...
 
ReleaseListgetReleases ()
 Returns a list of releases from this artist. More...
 
int getNumReleases () const
 Returns number of releases. More...
 
ReleasegetRelease (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...
 
ArtistAliasListgetAliases ()
 Returns the list of aliases for this artist. More...
 
int getNumAliases () const
 Returns number of aliases. More...
 
ArtistAliasgetAlias (int index)
 Returns alias specified by index. More...
 
void addAlias (ArtistAlias *alias)
 Adds an alias for this artist. 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)
 

Static Public Attributes

static const std::string TYPE_PERSON
 
static const std::string TYPE_GROUP
 

Additional Inherited Members

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

Detailed Description

Represents an artist.

Artists in MusicBrainz can have a type. Currently, this type can be either Person or Group for which the following URIs are assigned:

  • "http://musicbrainz.org/ns/mmd-1.0#Person"
  • "http://musicbrainz.org/ns/mmd-1.0#Group"

Use the Artist::TYPE_PERSON and Artist::TYPE_GROUP constants for comparison.

Constructor & Destructor Documentation

◆ Artist()

MusicBrainz::Artist::Artist ( const std::string &  id = "",
const std::string &  type = "",
const std::string &  name = "",
const std::string &  sortName = "" 
)

Constructor.

Parameters
ida string containing an absolute URI
typea string containing an absolute URI
namea string containing the artist's name
sortNamea string containing the artist's sort name

◆ ~Artist()

virtual MusicBrainz::Artist::~Artist ( )
virtual

Destructor.

Member Function Documentation

◆ addAlias()

void MusicBrainz::Artist::addAlias ( ArtistAlias alias)

Adds an alias for this artist.

Parameters
aliasa pointer to ArtistAlias object

◆ addRelease()

void MusicBrainz::Artist::addRelease ( Release release)

Adds a release to this artist's list of releases.

Parameters
releasea pointer to Release object

◆ getAlias()

ArtistAlias* MusicBrainz::Artist::getAlias ( int  index)

Returns alias specified by index.

This is equivalent to getAliases()[index]

Returns
a pointer to ArtistAlias instance
See also
getAliases

◆ getAliases()

ArtistAliasList& MusicBrainz::Artist::getAliases ( )

Returns the list of aliases for this artist.

Returns
a list of pointers to ArtistAlias objects

◆ getBeginDate()

std::string MusicBrainz::Artist::getBeginDate ( ) const

Returns the birth/foundation date.

The definition of the begin date depends on the artist's type. For persons, this is the day of birth, for groups it is the day the group was founded.

The returned date has the format "YYYY", "YYYY-MM", or "YYYY-MM-DD", depending on how much detail is known.

Returns
a string containing the date
See also
getType

◆ getDisambiguation()

std::string MusicBrainz::Artist::getDisambiguation ( ) const

Returns the disambiguation attribute.

This attribute may be used if there is more than one artist with the same name. In this case, disambiguation attributes are added to the artists' names to keep them apart.

For example, there are at least three bands named 'Vixen'. Each band has a different disambiguation in the MusicBrainz database, like 'Hip-hop' or 'all-female rock/glam band'.

Returns
a disambiguation string
See also
getUniqueName

◆ getEndDate()

std::string MusicBrainz::Artist::getEndDate ( ) const

Get the death/dissolving date.

The definition of the end date depends on the artist's type. For persons, this is the day of death, for groups it is the day the group was dissolved.

Returns
a string containing a date
See also
getBeginDate

◆ getName()

std::string MusicBrainz::Artist::getName ( ) const

Returns the artist's name.

Returns
a string containing the artist's name, or empty string

◆ getNumAliases()

int MusicBrainz::Artist::getNumAliases ( ) const

Returns number of aliases.

This is equivalent to getAliases().size()

Returns
an int containing number of aliases
See also
getAliases

◆ getNumReleases()

int MusicBrainz::Artist::getNumReleases ( ) const

Returns number of releases.

This is equivalent to getReleases().size()

Returns
an int containing number of releases
See also
getReleases

◆ getRelease()

Release* MusicBrainz::Artist::getRelease ( int  index)

Returns an release specified by index.

This is equivalent to getReleases()[index]

Returns
a pointer to Release instance
See also
getReleases

◆ getReleases()

ReleaseList& MusicBrainz::Artist::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).

Returns
: a list of pointers to Release objects

◆ getReleasesCount()

int MusicBrainz::Artist::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.

Returns
an integer containing the count
See also
getReleases

◆ getReleasesOffset()

int MusicBrainz::Artist::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.

Returns
an integer containing the offset
See also
getReleases

◆ getSortName()

std::string MusicBrainz::Artist::getSortName ( ) const

Returns the artist's sort name.

The sort name is the artist's name in a special format which is better suited for lexicographic sorting. The MusicBrainz style guide specifies this format.

See also
The MusicBrainz Style Guidelines

◆ getType()

std::string MusicBrainz::Artist::getType ( ) const

Returns the artist's type.

Returns
a string containing an absolute URI

◆ getUniqueName()

std::string MusicBrainz::Artist::getUniqueName ( ) const

Returns a unique artist name (using disambiguation).

This method returns the artist name together with the disambiguation attribute in parenthesis if it exists. Example: 'Vixen (Hip-hop)'.

Returns
a string containing the unique name
See also
getDisambiguation

◆ setBeginDate()

void MusicBrainz::Artist::setBeginDate ( const std::string &  dateStr)

Sets the begin/foundation date.

Parameters
dateStra date string
See also
getBeginDate

◆ setDisambiguation()

void MusicBrainz::Artist::setDisambiguation ( const std::string &  disambiguation)

Sets the disambiguation attribute.

Parameters
disambiguationa disambiguation string
See also
getDisambiguation, getUniqueName

◆ setEndDate()

void MusicBrainz::Artist::setEndDate ( const std::string &  dateStr)

Sets the death/dissolving date.

Parameters
dateStra string containing a date
See also
: setEndDate, getBeginDate

◆ setName()

void MusicBrainz::Artist::setName ( const std::string &  name)

Sets the artist's name.

Parameters
namea string containing the artist's name

◆ setReleasesCount()

void MusicBrainz::Artist::setReleasesCount ( const int  count)

Sets the count of the release list.

Parameters
countan integer containing the count
See also
getReleasesCount

◆ setReleasesOffset()

void MusicBrainz::Artist::setReleasesOffset ( const int  offset)

Sets the offset of the release list.

Parameters
offsetan integer containing the offset
See also
getReleasesOffset

◆ setSortName()

void MusicBrainz::Artist::setSortName ( const std::string &  sortName)

Sets the artist's sort name.

Parameters
sortNamea string containing the artist's sort name
See also
getSortName

◆ setType()

void MusicBrainz::Artist::setType ( const std::string &  type)

Sets the artist's type.

Parameters
typea string containing an absolute URI

Member Data Documentation

◆ TYPE_GROUP

const std::string MusicBrainz::Artist::TYPE_GROUP
static

◆ TYPE_PERSON

const std::string MusicBrainz::Artist::TYPE_PERSON
static