pianod2
multisource multiuser scriptable networked music player
Public Member Functions | Private Attributes | Friends | List of all members
MusicLibrary::Artist Class Reference

A PianodArtist that contains a vector of albums. More...

#include <musiclibrary.h>

Inheritance diagram for MusicLibrary::Artist:
Inheritance graph
[legend]
Collaboration diagram for MusicLibrary::Artist:
Collaboration graph
[legend]

Public Member Functions

 Artist (Foundation *const library, const std::string &id, const std::string &name)
 Create a new artist. More...
 
virtual ~Artist (void) override
 
Foundation *const parent (void) const
 
Foundation *const library (void) const
 
virtual Media::Source *const source (void) const override final
 MediaSource from which this thingie originates. More...
 
virtual const std::string & artistId (void) const override final
 Item's artist ID. More...
 
virtual const std::string & artist (void) const override final
 Get artist name. More...
 
virtual SongList songs () override
 Get all songs belonging to all albums by this artist. More...
 
virtual bool canQueue () const override
 Indicate if specific item can be queued/requested. More...
 
virtual Parsnip::Data persist () const
 
virtual void restore (const Parsnip::Data &data)
 
bool empty () const
 
const std::vector< Album * > & getAlbums ()
 
- Public Member Functions inherited from PianodArtist
virtual const std::string id (void) const override
 Get primary ID with media manager ID on it. More...
 
virtual const std::string id (MusicThingie::Type type) const override
 Return the complete ID when used in a specific context. More...
 
virtual const std::string & internalId (MusicThingie::Type type) const override
 Return the inner ID when used in a specific context. More...
 
virtual const std::string & name (void) const override
 Return the most specific name of this, whatever type it is. More...
 
virtual Type type (void) const override
 Return the type letter for a thingie. More...
 
virtual Football::ThingietransmitCommon (Football::Thingie &recipient) const override
 Typecode for artist type. More...
 
virtual PianodConnectiontransmitPrivate (PianodConnection &recipient) const override
 Transmit the thingie's user-specific data on a connection. More...
 
virtual Parsnip::Data serialize () const override
 Assemble the thingie's data for JSON tranmission. More...
 
virtual void serializePrivate (Parsnip::Data &, const User *user) const override
 Add the thingie's user-specific data for JSON transmission. More...
 
virtual bool matches (const Filter &filter) const override
 Check if a filter matches this item. More...
 
virtual PianodArtistasArtist () override
 
virtual const PianodArtistasArtist () const override
 
virtual bool operator== (const std::string &compare) const override
 See if the artist has a certain name. More...
 
virtual bool operator== (const MusicThingie &compare) const override
 Compare artist's name to that of an artist/album/song. More...
 
- Public Member Functions inherited from MusicThingie
 MusicThingie (void)
 When allocated, use count starts at 1 and the object is put in the release pool, justifying its existence. More...
 
bool isPrimary (void) const
 
bool isSuggestion (void) const
 
bool isSeed (void) const
 
bool isPlaylist (void) const
 
bool isSong (void) const
 
bool isAlbum (void) const
 
bool isArtist (void) const
 
bool isValidType (void) const
 
Type primaryType (void) const
 
virtual PianodAlbumasAlbum ()
 
virtual PianodSongasSong ()
 
virtual PianodPlaylistasPlaylist ()
 
virtual const PianodAlbumasAlbum () const
 
virtual const PianodSongasSong () const
 
virtual const PianodPlaylistasPlaylist () const
 
std::string operator() (void) const
 
void retain (void) const
 Claim an instance. More...
 
void release (void)
 Abandon an instance. More...
 
int getUseCount (void) const
 
virtual OwnershipparentOwner (void) const
 Defer the ownership to the source. More...
 
void serializeCommon (Parsnip::Data &) const
 Insert common items into the serialization dictionary. More...
 
bool operator!= (const std::string &compare)
 
bool operator!= (const MusicThingie &compare)
 
- Public Member Functions inherited from SubordinateOwnership
virtual bool isOwnedBy (const User *user) const override
 
virtual bool hasPermission (const User *user, Action action) const override
 
- Public Member Functions inherited from Ownership
bool isVisibleBy (const User *user) const
 
bool isUsableBy (const User *user) const
 
bool isDecendableBy (const User *user) const
 
bool isReadableBy (const User *user) const
 
bool isEditableBy (const User *user) const
 

Private Attributes

Foundation *const _library
 
const std::string _id
 
const std::string _name
 
std::vector< Album * > albums
 

Friends

class Album
 
class Song
 
class Playlist
 

Additional Inherited Members

- Public Types inherited from MusicThingie
enum class  Type : char {
  Playlist = 'p' , Artist = 'a' , Album = 'l' , Song = 's' ,
  PlaylistSuggestion = 'e' , ArtistSuggestion = 't' , AlbumSuggestion = 'b' , SongSuggestion = 'n' ,
  PlaylistSeed = 'y' , ArtistSeed = 'd' , AlbumSeed = 'u' , SongSeed = 'g' ,
  SongRating = 'i'
}
 
- Public Types inherited from Ownership
enum class  Type {
  DISOWNED , PRIVATE , SHARED , PUBLISHED ,
  PUBLIC
}
 Access levels for an object. More...
 
enum class  Action { SEE , USE , READ , ALTER }
 Access actions for an object. More...
 
- Static Public Member Functions inherited from PianodArtist
static Type typetype (void)
 Typecode for artist objects. More...
 
- Static Public Member Functions inherited from MusicThingie
static std::string TypeName (Type type)
 Get the type name of a music thingie. More...
 
static Type TypeFromName (const std::string &name)
 
static constexpr bool isPrimary (Type t)
 
static constexpr bool isSuggestion (const Type t)
 
static constexpr bool isSeed (const Type t)
 
static constexpr bool isPlaylist (const Type t)
 
static constexpr bool isSong (const Type t)
 
static constexpr bool isAlbum (const Type t)
 
static constexpr bool isArtist (const Type t)
 
static constexpr bool isValidType (const Type t)
 
static Type primaryType (const Type t)
 
- Protected Member Functions inherited from MusicThingie
virtual ~MusicThingie (void)
 

Detailed Description

A PianodArtist that contains a vector of albums.

Constructor & Destructor Documentation

◆ Artist()

MusicLibrary::Artist::Artist ( Foundation *const  library,
const std::string &  id,
const std::string &  name 
)

Create a new artist.

Parameters
libraryThe library in which the artist will reside.
idA unique ID for the artist.
nameThe name of the artist.

◆ ~Artist()

MusicLibrary::Artist::~Artist ( void  )
overridevirtual

Member Function Documentation

◆ artist()

virtual const std::string& MusicLibrary::Artist::artist ( void  ) const
inlinefinaloverridevirtual

Get artist name.

Implements PianodArtist.

Here is the caller graph for this function:

◆ artistId()

virtual const std::string& MusicLibrary::Artist::artistId ( void  ) const
inlinefinaloverridevirtual

Item's artist ID.

Implements PianodArtist.

◆ canQueue()

virtual bool MusicLibrary::Artist::canQueue ( ) const
inlineoverridevirtual

Indicate if specific item can be queued/requested.

Reimplemented from MusicThingie.

◆ empty()

bool MusicLibrary::Artist::empty ( ) const
inline
Here is the caller graph for this function:

◆ getAlbums()

const std::vector<Album *>& MusicLibrary::Artist::getAlbums ( )
inline

◆ library()

Foundation* const MusicLibrary::Artist::library ( void  ) const
inline
Here is the caller graph for this function:

◆ parent()

Foundation* const MusicLibrary::Artist::parent ( void  ) const
inline

◆ persist()

Parsnip::Data MusicLibrary::Artist::persist ( void  ) const
virtual

Reimplemented in Filesystem::Artist.

Here is the caller graph for this function:

◆ restore()

void MusicLibrary::Artist::restore ( const Parsnip::Data data)
virtual

Reimplemented in Filesystem::Artist.

Here is the caller graph for this function:

◆ songs()

SongList MusicLibrary::Artist::songs ( )
overridevirtual

Get all songs belonging to all albums by this artist.

However, since compilation albums don't belong to the artist, this does not return the artist's songs that are on complations.

Returns
All songs on albums belonging to this artist.

Reimplemented from MusicThingie.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ source()

virtual Media::Source* const MusicLibrary::Artist::source ( void  ) const
inlinefinaloverridevirtual

MediaSource from which this thingie originates.

Implements MusicThingie.

Friends And Related Function Documentation

◆ Album

friend class Album
friend

◆ Playlist

friend class Playlist
friend

◆ Song

friend class Song
friend

Member Data Documentation

◆ _id

const std::string MusicLibrary::Artist::_id
private

◆ _library

Foundation* const MusicLibrary::Artist::_library
private

◆ _name

const std::string MusicLibrary::Artist::_name
private

◆ albums

std::vector<Album *> MusicLibrary::Artist::albums
private

The documentation for this class was generated from the following files: