Advertisement
Guest User

Untitled

a guest
Dec 11th, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 KB | None | 0 0
  1. #ifndef ALBUM_H
  2. #define ALBUM_H
  3. #include <string>
  4. #include "Track.h"
  5. #include <vector>
  6.  
  7. using std::vector;
  8. using namespace std;
  9.  
  10.  
  11. class Album
  12. {
  13.     public:
  14.         Album();
  15.         Album(string a, string t);
  16.  
  17.         void setArtist(string a);
  18.  
  19.         void setTitle(string t);
  20.  
  21.         void setTracklist(vector<Track> tList);
  22.  
  23.         string getArtist() const;
  24.  
  25.         string getTitle() const;
  26.  
  27.         vector<Track>& getTrackList();
  28.  
  29.         void addTrack(Track t);
  30.  
  31.         bool compareAlbums(const Album* a1,const Album* a2);
  32.  
  33.  
  34.         Track getTrack(string title);
  35.  
  36.         friend ostream& operator<< (ostream& str, Album& a){
  37.             str << "Album: " << a.getTitle() << " Artist: " << a.getArtist() << "\n";
  38.             for (vector<Track>::iterator it = a.getTrackList().begin(); it != a.getTrackList().end(); it++){
  39.                 Track& t = *it;
  40.                 str << t <<"\n";
  41.             }
  42.             return str << endl;
  43.         }
  44.  
  45.         Duration totalTime();
  46.  
  47.     protected:
  48.     private:
  49.         std::string artist;
  50.         std::string title;
  51.         vector<Track> tracks;
  52. };
  53.  
  54.  
  55.  
  56. istream& operator>>(istream& is, Album& a);
  57.  
  58. bool compareAlbums(const Album* a1,const Album* a2);
  59.  
  60.  
  61. #endif // ALBUM_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement