Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

playlist.h

Go to the documentation of this file.
00001 #ifndef __PLAYLIST__H
00002 #define __PLAYLIST__H
00003 
00004 #include <qstring.h>
00005 #include <vector>
00006 
00011 class Playlist
00012 {
00013 public:
00014 
00019   class SongInfo
00020   {
00021   public:
00022     inline                      SongInfo(void) : filename(), artist(), album(), title(), songLength(0), songIndex(0) {} 
00023 
00024     inline void                 clear(unsigned index)                           { filename = ""; artist = ""; album = ""; title = ""; songLength = 0; songIndex = index; } 
00025     inline QString              getSongLength(void)                             { return QString::number(songLength/3600) + ":" + QString::number((songLength / 60) % 60) + ":" + QString::number(songLength % 60); } 
00026 
00027     QString                     filename;                                       
00028     QString                     artist;                                         
00029     QString                     album;                                          
00030     QString                     title;                                          
00031     int                         songLength;                                     
00032     unsigned                    songIndex;                                      
00033   };
00034 
00035   typedef std::vector<SongInfo *>::const_iterator iterator;                         
00036   inline iterator               begin() const             { return list.begin(); }  
00037   inline iterator               end() const               { return list.end(); }    
00038 
00039   inline Playlist::SongInfo * operator [](unsigned i)           { return list[i]; } 
00040 
00041 public:
00042                                 Playlist(void);                                                             
00043   inline void                   addPlaylistItem( SongInfo * item )              { list.push_back( item ); } 
00044   inline SongInfo *             getPlaylistItem( unsigned index )               { return list[index]; }     
00045   inline void                   clear()                                         { list.clear(); }           
00046   inline unsigned               size()                                          { return list.size(); }     
00047 
00048 protected:
00049   std::vector<SongInfo *>       list;                                           
00050 };
00051 
00052 #endif

Generated on Thu Mar 11 21:57:51 2004 for Music Playing Daemon client by doxygen1.2.15