-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlaylist.h
104 lines (89 loc) · 4.46 KB
/
Playlist.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**************************************************************
* Name of the file: Song.cpp *
* Group 6: Ra'Caria Burgess, Janei Elliston, *
* Michael Mondelice, Michael Parrish *
* Date last edited: 4/26/2020 *
* Purpose of Playlist.h: Is to manage the songs, by creating *
all of the normal functions of a playlist. *
**************************************************************/
#ifndef PLAYLIST_H
#define PLAYLIST_H
#include <string>
#include "Song.h"
#include <iomanip>
#include <iostream>
#include <vector>
#include <fstream>
class Playlist
{
private:
std::string name;
std::vector<Song> playlist;
static int mode;
void writeToFile();
int songnumber;
public:
/*******************************************************************************
* Constructors
******************************************************************************/
Playlist();
Playlist(std::string);
Playlist(const Playlist &p2);
friend std::ostream& operator<<(std::ostream& os, const Playlist& playlist);
/******************************************************************************
* output to file
******************************************************************************/
friend std::ofstream& operator<<(std::ofstream& os, const Playlist& playlist);
/****************************************************************************
* input the playlist in the format:
* title
****************************************************************************/
friend std::istream& operator>>(std::istream& is, Playlist& playlist);
/****************************************************************************
*input from file
****************************************************************************/
friend std::fstream& operator>>(std::fstream& is, Playlist& playlist);
void setTitle(std::string);
std::string getTitle() const;
/*****************************************************************************
* adds song to playlist
*****************************************************************************/
void addSong(Song song);
/*****************************************************************************
* deletes song from playlist
*****************************************************************************/
bool deleteSong(Song & song);
/*****************************************************************************
* Adds song to playlist current playlist
*****************************************************************************/
Playlist friend operator+(Playlist &p ,Song &s);
/*****************************************************************************
* concatenation of the two playlist objects
*****************************************************************************/
Playlist friend operator+(Playlist & playlist , Playlist & p2);
/*****************************************************************************
* removing a song(s) from a playlist
*****************************************************************************/
Playlist friend operator-(Playlist &p , Song & song);
Playlist intersect(Playlist & Playlist);
Playlist merge(Playlist & Playlist);
/******************************************************************************
* plays next indexed song
******************************************************************************/
void play();
/******************************************************************************
* sets the mode for play function
******************************************************************************/
static void setMode(char);
/******************************************************************************
* pull for checking play mode
******************************************************************************/
static int getMode();
std::vector<Song> getPlaylist();
/*******************************************************************************
* prints all songs in vector
*******************************************************************************/
void printPlaylist();
void appendToFile(Song song);
};
#endif