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

Album customization for filesystem library & source. More...

#include <filesystem.h>

Inheritance diagram for Filesystem::Album:
Inheritance graph
[legend]
Collaboration diagram for Filesystem::Album:
Collaboration graph
[legend]

Public Member Functions

void path (std::string p)
 Set the path to the album. More...
 
std::string path () const
 Retrieve the path to the album. More...
 
virtual void makeCompilation (MusicLibrary::Artist *compilation_artist) override
 Mark an album as a compilation. More...
 
virtual Parsnip::Data persist () const override
 
virtual void restore (const Parsnip::Data &data) override
 
- Public Member Functions inherited from MusicLibrary::Album
 Album (Artist *const parent, const std::string &id, const std::string &name)
 Create a new album, and register itself with its parent. More...
 
virtual ~Album (void) override
 Destroy an album by unregistering from its parent artist. More...
 
Artist *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 the current artist, or list of artists if a compilation. More...
 
virtual const std::string & albumId (void) const override final
 Item's album ID. More...
 
virtual const std::string & albumTitle (void) const override final
 
virtual const std::string & coverArtUrl (void) const override final
 
virtual bool compilation () const override
 
void coverArtUrl (const std::string &a)
 
void calculateArtists (void) const
 (Re)calculate the current artists list for a compilation. More...
 
virtual SongList songs () override
 Get all songs belonging to the album. More...
 
virtual bool canQueue () const override
 Indicate if specific item can be queued/requested. More...
 
bool empty () const
 
const std::vector< Song * > & getSongs ()
 
- Public Member Functions inherited from PianodAlbum
virtual const std::string id (void) const override
 Primary ID is album ID. 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 album 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 PianodAlbumasAlbum () override final
 
virtual const PianodAlbumasAlbum () const override final
 
virtual bool operator== (const std::string &compare) const override
 Is album a compilation? 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 PianodSongasSong ()
 
virtual PianodPlaylistasPlaylist ()
 
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

friend Song
 
std::string _path
 If starting with /, path from library root; otherwise appends to artist path. More...
 

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 PianodAlbum
static Type typetype (void)
 Typecode for album objects. 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)
 
- Protected Attributes inherited from MusicLibrary::Album
Artist_artist
 

Detailed Description

Album customization for filesystem library & source.

Member Function Documentation

◆ makeCompilation()

void Filesystem::Album::makeCompilation ( MusicLibrary::Artist compilation_artist)
overridevirtual

Mark an album as a compilation.

Set all song artists the current artist. Detach the item from its artist and stick it into a special compilation artist.

Parameters
compilation_artistThe compilation artist to move the album to.

Reimplemented from MusicLibrary::Album.

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

◆ path() [1/2]

std::string Filesystem::Album::path ( ) const

Retrieve the path to the album.

  • If the path starts with '/', append it to the library path.
  • Otherwise, append it to the artist path.
    Returns
    The full path to an album.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ path() [2/2]

void Filesystem::Album::path ( std::string  p)

Set the path to the album.

If already set, do nothing. Otherwise:

  • Set the album path to that provided.
  • Try setting the artist path to the path, with the last component removed.
  • Truncate the path by stripping the artist off the front.
  • If the artist path can't be removed, strip off the library path instead, leaving a leading '/' to delineate.
    Parameters
    pThe path to adopt.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ persist()

Parsnip::Data Filesystem::Album::persist ( ) const
overridevirtual

Reimplemented from MusicLibrary::Album.

Here is the call graph for this function:

◆ restore()

void Filesystem::Album::restore ( const Parsnip::Data data)
overridevirtual

Reimplemented from MusicLibrary::Album.

Here is the call graph for this function:

Member Data Documentation

◆ _path

std::string Filesystem::Album::_path
private

If starting with /, path from library root; otherwise appends to artist path.

◆ Song

friend Filesystem::Album::Song
private

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