Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

playlist.h

Go to the documentation of this file.
00001 /*
00002                             This file is part of the Opie Project
00003 
00004                              Copyright (c)  2002 Max Reiss <harlekin@handhelds.org>
00005                              Copyright (c)  2002 L. Potter <ljp@llornkcor.com>
00006                              Copyright (c)  2002 Holger Freyther <zecke@handhelds.org>
00007               =.
00008             .=l.
00009            .>+-=
00010  _;:,     .>    :=|.         This program is free software; you can
00011 .> <`_,   >  .   <=          redistribute it and/or  modify it under
00012 :`=1 )Y*s>-.--   :           the terms of the GNU General Public
00013 .="- .-=="i,     .._         License as published by the Free Software
00014  - .   .-<_>     .<>         Foundation; either version 2 of the License,
00015      ._= =}       :          or (at your option) any later version.
00016     .%`+i>       _;_.
00017     .i_,=:_.      -<s.       This program is distributed in the hope that
00018      +  .  -:.       =       it will be useful,  but WITHOUT ANY WARRANTY;
00019     : ..    .:,     . . .    without even the implied warranty of
00020     =_        +     =;=|`    MERCHANTABILITY or FITNESS FOR A
00021   _.=:.       :    :=>`:     PARTICULAR PURPOSE. See the GNU
00022 ..}^=.=       =       ;      Library General Public License for more
00023 ++=   -.     .`     .:       details.
00024  :     =  ...= . :.=-
00025  -.   .:....=;==+<;          You should have received a copy of the GNU
00026   -_. . .   )=.  =           Library General Public License along with
00027     --        :-=`           this library; see the file COPYING.LIB.
00028                              If not, write to the Free Software Foundation,
00029                              Inc., 59 Temple Place - Suite 330,
00030                              Boston, MA 02111-1307, USA.
00031 
00032 */
00033 #ifndef __playlist_h
00034 #define __playlist_h
00035 
00036 #include <qpe/applnk.h>
00037 
00038 #include <qlistview.h>
00039 #include <qstringlist.h>
00040 
00041 namespace XINE {
00042     class Lib;
00043 }
00044 
00045 class PlaylistView;
00046 
00047 class PlaylistItem:public QListViewItem
00048 {
00049 public:
00050     PlaylistItem(const DocLnk&aLink,PlaylistView*parent);
00051     PlaylistItem(const DocLnk&aLink,PlaylistView*parent,PlaylistItem*after);
00052     virtual ~PlaylistItem();
00053 
00054     const DocLnk&Lnk()const{return m_Content;}
00055     void Video(bool y);
00056     bool isVideo()const{return m_video;}
00057 
00058 protected:
00059     DocLnk m_Content;
00060     bool m_video:1;
00061 };
00062 
00063 typedef QValueList<PlaylistItem*> t_itemlist;
00064 
00065 class PlaylistView:public QListView
00066 {
00067     Q_OBJECT
00068 public:
00069     PlaylistView( QWidget *parent = 0, const char *name = 0);
00070     virtual ~PlaylistView();
00071     XINE::Lib*getXine();
00072     PlaylistItem* currentItem()const;
00073     void setCurrentItem(PlaylistItem*);
00074     PlaylistItem* nextItem(PlaylistItem*parent)const;
00075     PlaylistItem* prevItem(PlaylistItem*parent)const;
00076 
00077     void removeFromList(PlaylistItem*Item);
00078 
00079     enum itemcolumns{
00080         COL_ICON=0,
00081         COL_FILE=1,
00082         COL_TIME=2,
00083         COL_ARTIST=3,
00084         COL_ALBUM=4,
00085         COL_TITLE=5,
00086         COL_TYPE=6,
00087         COL_SIZE=7
00088     };
00089     void addFile(const QString&aFile,const QString&aName="");
00090 signals:
00091     void contentChanged(int);
00092 
00093 public slots:
00094     virtual void slotAddFile(const DocLnk&);
00095     virtual void slotAppendDir();
00096     virtual void slotOpenM3u();
00097     virtual void slotSaveAsM3u();
00098     virtual void slotDummyStop();
00099 
00100 protected:
00101     void checkLib();
00102     void readPlayList(const QString&);
00103     QStringList columnLabels;
00104     XINE::Lib*m_Infolib;
00105     PlaylistItem*m_lastItem;
00106     t_itemlist m_items;
00107     QString m_lastDir;
00108 };
00109 
00110 #endif

Generated on Sat Nov 5 16:17:34 2005 for OPIE by  doxygen 1.4.2