-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index d1506db..9918eeb 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -51,8 +51,9 @@ #include "om3u.h" //only needed for the random play #include <stdlib.h> +#include <assert.h> #include "audiowidget.h" #include "videowidget.h" @@ -1144,8 +1145,19 @@ void PlayListWidget::skinsMenuActivated( int item ) { int PlayListWidget::whichList() { return tabWidget->currentPageIndex(); } +PlayListWidget::TabType PlayListWidget::currentTab() const +{ + static const TabType indexToTabType[ NumTabTypes ] = + { CurrentPlaylist, AudioFiles, VideoFiles, PlayLists }; + + int index = tabWidget->currentPageIndex(); + assert( index < NumTabTypes && index >= 0 ); + + return indexToTabType[ index ]; +} + QString PlayListWidget::currentFileListPathName() { switch (whichList()) { case 1: return audioView->currentItem()->text(3); diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index b2c389e..05d53a4 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h @@ -54,8 +54,10 @@ class QLabel; class PlayListWidget : public PlayListWidgetGui { Q_OBJECT public: + enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists, NumTabTypes = 4 }; + PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 ); ~PlayListWidget(); DocLnkSet files; DocLnkSet vFiles; @@ -66,8 +68,9 @@ public: const DocLnk *current(); void useSelectedDocument(); int selected; int whichList(); + TabType currentTab() const; public slots: bool first(); bool last(); |