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

#include <tonegen.h>

Inheritance diagram for ToneGenerator::Library:
Inheritance graph
[legend]
Collaboration diagram for ToneGenerator::Library:
Collaboration graph
[legend]

Public Member Functions

 Library (Media::Source *const owner, const bool persistence)
 
void loadToneLibrary (bool restored)
 
Songadd (const TEST_SONG *item)
 
Songduplicate (const Song *song, const Channel channel)
 
- Public Member Functions inherited from MusicLibrary::Library
virtual bool removePlaylist (Playlist *play) override
 Remove a playlist from the library. More...
 
virtual ThingieList seedsForPlaylist (const Playlist *playlist) override
 Retrieve a list of seeds for a playlist. More...
 
virtual RetainedList< Song * > getAllSongs (void) override
 Get a list of all songs in the library. More...
 
virtual RetainedList< Song * > getMatchingSongs (const Filter &criteria) override
 Get a list of all songs matching a filter. More...
 
ThingieList getSuggestions (const Filter &criteria, SearchRange what)
 Retrieve suggestions from the library. More...
 
RetainedList< Song * > getMixSongs (void)
 Get a list of all songs belonging to enabled playlists. More...
 
virtual RetainedList< Song * > getPlaylistSongs (const Playlist *play, bool reassess=false) override
 Get a list of all songs assigned to a playlist. More...
 
PlaylistfindPlaylistForSong (Song *song, bool enabled=true)
 Find a playlist for a song, preferring enabled playlists. More...
 
virtual void populatePlaylist (Playlist *play, bool aggressive=false) override
 Review songs and assign them to a new candidate if they match. More...
 
void unpopulatePlaylist (Playlist *play)
 Reassign all a playlists' songs to some other playlist. More...
 
void mixRecalculate (void)
 Iterate over every song and replace its playlist assignment. More...
 
MusicThingiegetById (MusicThingie::Type type, const std::string &id)
 Retrieve anything stored in the library by its ID. More...
 
virtual RetainedList< Song * > getSongsForPlaylist (PianodPlaylist *playlist) override
 Retrieve all songs for a playlist, which may be a meta playlist. More...
 
PianodPlaylistcreatePlaylist (const std::string &name, MusicThingie::Type type, MusicThingie *from)
 Construct a playlist with an initial seed. More...
 
PianodPlaylistcreatePlaylist (const std::string &name, const Filter &filter)
 Construct a new smart playlist. More...
 
PianodPlaylistformTransientPlaylist (const Filter &criteria)
 Construct a temporary playlist. More...
 
virtual bool writeIndexToFile (const std::string &filename) const override
 Persist the library's index into a file. More...
 
virtual bool restoreIndexFromFile (const std::string &filename) override
 Restore the library's index, playlists, seeds and match criteria from a file. More...
 
- Public Member Functions inherited from MusicLibrary::Foundation
 Foundation (Media::Source *const owner, const bool persistence)
 Construct a new media library. More...
 
void markDirty (IMPORTANCE import=TRIVIAL) const
 
bool load ()
 Restore persisted library data from a file. More...
 
bool flush ()
 If memory is dirty, write library data to a file. More...
 
float periodic ()
 Do intermittent tasks, such as occasionally persisting the catalog to a file. More...
 
RetainedList< Song * > getRandomSongs (PianodPlaylist *playlist, const UserList &users, Media::SelectionMethod selectionMethod, const class LibraryParameters &settings)
 Retrieve some random selections from the library for queue/playback. More...
 

Private Attributes

friend Source
 

Additional Inherited Members

- Public Types inherited from MusicLibrary::Library
using ArtistAllocator = ArtistContainer::Allocator
 
using AlbumAllocator = AlbumContainer::Allocator
 
using SongAllocator = SongContainer::Allocator
 
using PlaylistAllocator = PlaylistContainer::Allocator
 
- Public Types inherited from MusicLibrary::Foundation
enum  IMPORTANCE { IMPORTANT = 300 , NOMINAL = 1800 , TRIVIAL = 60 * 60 * 6 }
 
- Public Attributes inherited from MusicLibrary::Foundation
Media::Source *const source
 
- Protected Member Functions inherited from MusicLibrary::Library
 Library (Media::Source *const owner, const bool persistence, const SongAllocator &song_allocator=SongAllocator {song_allocate}, const AlbumAllocator &album_allocator=AlbumAllocator {album_allocate}, const ArtistAllocator &artist_allocator=ArtistAllocator {artist_allocate}, const PlaylistAllocator &playlist_allocator=PlaylistAllocator {playlist_allocate})
 Construct a library. More...
 
void purge (void)
 Remove albums & artists from the library that don't have any songs & albums respectively. More...
 
- Protected Member Functions inherited from MusicLibrary::Foundation
virtual void persist (Parsnip::Data &into) const
 
virtual bool restore (const Parsnip::Data &data)
 
- Protected Attributes inherited from MusicLibrary::Library
ArtistContainer artists
 
AlbumContainer albums
 
SongContainer songs
 
PlaylistContainer playlists
 

Constructor & Destructor Documentation

◆ Library()

ToneGenerator::Library::Library ( Media::Source *const  owner,
const bool  persistence 
)
Here is the call graph for this function:

Member Function Documentation

◆ add()

Song * ToneGenerator::Library::add ( const TEST_SONG item)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ duplicate()

Song * ToneGenerator::Library::duplicate ( const Song song,
const Channel  channel 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadToneLibrary()

void ToneGenerator::Library::loadToneLibrary ( bool  restored)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ Source

friend ToneGenerator::Library::Source
private

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