Represents a hierarchical tree structure to store songs by artist, album, disc number, and track number.
More...
|
void | addSong (const Song &song) |
| Adds a song to the tree.
|
|
void | display () const |
| Displays all songs in the tree hierarchically.
|
|
std::vector< Song > | getSongsByArtist (const std::string &artist) const |
| Retrieves all songs by a specific artist.
|
|
std::vector< Song > | getSongsByAlbum (const std::string &artist, const std::string &album) const |
| Retrieves all songs from a specific album by a given artist.
|
|
std::map< std::string, std::map< std::string, std::map< unsigned int, std::map< unsigned int, Song > > > > | returnSongMap () |
| Returns the internal song map.
|
|
template<class Archive> |
void | serialize (Archive &ar) |
| Serializes the SongTree object.
|
|
void | saveToFile (const std::string &filename) const |
| Saves the SongTree to a file.
|
|
void | loadFromFile (const std::string &filename) |
| Loads a SongTree from a file.
|
|
Represents a hierarchical tree structure to store songs by artist, album, disc number, and track number.
The SongTree class organizes songs in a map structure where the keys are artist names, album titles, disc numbers, and track numbers. The tree structure allows for easy retrieval of songs by artist, album, and track number. Songs can be added to the tree, displayed, and serialized or deserialized from a file.
void SongTree::display |
( |
| ) |
const |
|
inline |
Displays all songs in the tree hierarchically.
This function prints the entire song tree to the console in a human-readable format, displaying the artist, album, disc number, track number, title, and other metadata for each song.