-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibrary.h
72 lines (50 loc) · 1.76 KB
/
Library.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//Created by Elon Skolnik on 11/28/18.
#ifndef LIBRARY_H
#define LIBRARY_H
#include "Song.h"
#include "Playlist.h"
#include "List.h"
#include <iostream>
class Library {
private:
List* songList;
Playlist** playlists;
int playlistCount;
int playlistCapacity;
int playlistsize;
void doubleCapacity();
public:
//Constructor
Library(int playlistCapacity);
//Destructor
~Library();
//imports a song
void importSong(std::string title, std::string artist, float duration);
//imports a playlist
void newPlaylist(std::string name);
//creates a new playlist of the given length composed of randomly selected songs
void genRandomPlaylist(std::string name, float duration);
//removes the given song from the library of songs
void discontinue(std::string name, std::string artist);
//save the current library to a file
void saveLib();
//return info about all the songs in the library
std::string songsInfo();
//return info for all songs by the given artist
std::string artistInfo(std::string artist);
//return the names of all playlists and their durations
std::string playlistsInfo();
//return the contents of the given playlist
std::string playlistInfo(std::string title);
//returns a playlist pointer
Playlist** getPlaylist();
//finds a playlist
Playlist* findPlaylist(std::string title);
//finds a song
Song* findSong(std::string title, std::string artist);
void emptyLibrary();
void removeFromPlaylist(int index, std::string title, std::string artist);
void addToPlaylist(int index, Song* SongToAdd);
void deletePlaylist(std::string title);
};
#endif //LIBRARY_H