Represents a record label. More...
Public Member Functions | |
Label (const std::string &id="", const std::string &type="", const std::string &name="", const std::string &sortName="") | |
Constructor. | |
virtual | ~Label () |
Destructor. | |
std::string | getType () const |
Returns the label's type. | |
void | setType (const std::string &type) |
Sets the label's type. | |
int | getCode () const |
Returns the label code. | |
void | setCode (int code) |
Sets the label code. | |
std::string | getName () const |
Returns the label's name. | |
void | setName (const std::string &name) |
Sets the label's name. | |
std::string | getSortName () const |
Returns the label's sort name. | |
void | setSortName (const std::string &sortName) |
Sets the label's sort name. | |
std::string | getDisambiguation () const |
Returns the disambiguation attribute. | |
void | setDisambiguation (const std::string &disambiguation) |
Sets the disambiguation attribute. | |
std::string | getUniqueName () const |
Returns a unique label name (using disambiguation). | |
std::string | getBeginDate () const |
Returns the birth/foundation date. | |
void | setBeginDate (const std::string &dateStr) |
Sets the begin/foundation date. | |
std::string | getEndDate () const |
Get the death/dissolving date. | |
void | setEndDate (const std::string &dateStr) |
Sets the death/dissolving date. | |
ReleaseList & | getReleases () |
Returns a list of releases from this label. | |
int | getNumReleases () const |
Returns number of releases. | |
Release * | getRelease (int index) |
Returns an release specified by index. | |
void | addRelease (Release *release) |
Adds a release to this label's list of releases. | |
int | getReleasesOffset () const |
Returns the offset of the release list. | |
void | setReleasesOffset (const int offset) |
Sets the offset of the release list. | |
int | getReleasesCount () const |
Returns the number of existing releases. | |
void | setReleasesCount (const int count) |
Sets the count of the release list. | |
LabelAliasList & | getAliases () |
Returns the list of aliases for this label. | |
int | getNumAliases () const |
Returns number of aliases. | |
LabelAlias * | getAlias (int index) |
Returns alias specified by index. | |
void | addAlias (LabelAlias *alias) |
Adds an alias for this label. | |
Static Public Attributes | |
static const std::string | TYPE_PERSON |
static const std::string | TYPE_GROUP |
Represents a record label.
MusicBrainz::Label::Label | ( | const std::string & | id = "" , |
|
const std::string & | type = "" , |
|||
const std::string & | name = "" , |
|||
const std::string & | sortName = "" | |||
) |
Constructor.
id | a string containing an absolute URI | |
type | a string containing an absolute URI | |
name | a string containing the label's name | |
sortName | a string containing the label's sort name |
virtual MusicBrainz::Label::~Label | ( | ) | [virtual] |
Destructor.
void MusicBrainz::Label::addAlias | ( | LabelAlias * | alias | ) |
Adds an alias for this label.
alias | a pointer to LabelAlias object |
void MusicBrainz::Label::addRelease | ( | Release * | release | ) |
Adds a release to this label's list of releases.
release | a pointer to Release object |
LabelAlias* MusicBrainz::Label::getAlias | ( | int | index | ) |
Returns alias specified by index.
This is equivalent to getAliases()
[index]
LabelAliasList& MusicBrainz::Label::getAliases | ( | ) |
Returns the list of aliases for this label.
std::string MusicBrainz::Label::getBeginDate | ( | ) | const |
Returns the birth/foundation date.
The definition of the begin date depends on the label'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.
int MusicBrainz::Label::getCode | ( | ) | const |
Returns the label code.
std::string MusicBrainz::Label::getDisambiguation | ( | ) | const |
Returns the disambiguation attribute.
This attribute may be used if there is more than one label with the same name. In this case, disambiguation attributes are added to the labels' 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'.
std::string MusicBrainz::Label::getEndDate | ( | ) | const |
Get the death/dissolving date.
The definition of the end date depends on the label's type. For persons, this is the day of death, for groups it is the day the group was dissolved.
std::string MusicBrainz::Label::getName | ( | ) | const |
Returns the label's name.
int MusicBrainz::Label::getNumAliases | ( | ) | const |
Returns number of aliases.
This is equivalent to getAliases()
.size()
int MusicBrainz::Label::getNumReleases | ( | ) | const |
Returns number of releases.
This is equivalent to getReleases()
.size()
Release* MusicBrainz::Label::getRelease | ( | int | index | ) |
Returns an release specified by index.
This is equivalent to getReleases()
[index]
ReleaseList& MusicBrainz::Label::getReleases | ( | ) |
Returns a list of releases from this label.
This may also include releases where this label isn't the main label but has just contributed one or more tracks (aka VA-Releases).
int MusicBrainz::Label::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::Label::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::Label::getSortName | ( | ) | const |
Returns the label's sort name.
The sort name is the label's name in a special format which is better suited for lexicographic sorting. The MusicBrainz style guide specifies this format.
std::string MusicBrainz::Label::getType | ( | ) | const |
Returns the label's type.
std::string MusicBrainz::Label::getUniqueName | ( | ) | const |
Returns a unique label name (using disambiguation).
This method returns the label name together with the disambiguation attribute in parenthesis if it exists. Example: 'Vixen (Hip-hop)'.
void MusicBrainz::Label::setBeginDate | ( | const std::string & | dateStr | ) |
void MusicBrainz::Label::setCode | ( | int | code | ) |
Sets the label code.
code | an int representing the label code |
void MusicBrainz::Label::setDisambiguation | ( | const std::string & | disambiguation | ) |
Sets the disambiguation attribute.
disambiguation | a disambiguation string |
void MusicBrainz::Label::setEndDate | ( | const std::string & | dateStr | ) |
Sets the death/dissolving date.
dateStr | a string containing a date |
void MusicBrainz::Label::setName | ( | const std::string & | name | ) |
Sets the label's name.
name | a string containing the label's name |
void MusicBrainz::Label::setReleasesCount | ( | const int | count | ) |
Sets the count of the release list.
count | an integer containing the count |
void MusicBrainz::Label::setReleasesOffset | ( | const int | offset | ) |
Sets the offset of the release list.
offset | an integer containing the offset |
void MusicBrainz::Label::setSortName | ( | const std::string & | sortName | ) |
Sets the label's sort name.
sortName,: | a string containing the label's sort name |
void MusicBrainz::Label::setType | ( | const std::string & | type | ) |
Sets the label's type.
type | a string containing an absolute URI |
const std::string MusicBrainz::Label::TYPE_GROUP [static] |
const std::string MusicBrainz::Label::TYPE_PERSON [static] |