-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 | |||
@@ -47,16 +47,17 @@ | |||
47 | #include "playlistselection.h" | 47 | #include "playlistselection.h" |
48 | #include "playlistwidget.h" | 48 | #include "playlistwidget.h" |
49 | #include "mediaplayerstate.h" | 49 | #include "mediaplayerstate.h" |
50 | #include "inputDialog.h" | 50 | #include "inputDialog.h" |
51 | #include "om3u.h" | 51 | #include "om3u.h" |
52 | 52 | ||
53 | //only needed for the random play | 53 | //only needed for the random play |
54 | #include <stdlib.h> | 54 | #include <stdlib.h> |
55 | #include <assert.h> | ||
55 | 56 | ||
56 | #include "audiowidget.h" | 57 | #include "audiowidget.h" |
57 | #include "videowidget.h" | 58 | #include "videowidget.h" |
58 | 59 | ||
59 | extern MediaPlayerState *mediaPlayerState; | 60 | extern MediaPlayerState *mediaPlayerState; |
60 | // extern AudioWidget *audioUI; | 61 | // extern AudioWidget *audioUI; |
61 | // extern VideoWidget *videoUI; | 62 | // extern VideoWidget *videoUI; |
62 | 63 | ||
@@ -1140,16 +1141,27 @@ void PlayListWidget::skinsMenuActivated( int item ) { | |||
1140 | QMessageBox::warning( this, tr( "OpiePlayer" ), | 1141 | QMessageBox::warning( this, tr( "OpiePlayer" ), |
1141 | tr( "You must <b>restart</b> Opieplayer<br>to see your changes." ) ); | 1142 | tr( "You must <b>restart</b> Opieplayer<br>to see your changes." ) ); |
1142 | } | 1143 | } |
1143 | 1144 | ||
1144 | int PlayListWidget::whichList() { | 1145 | int PlayListWidget::whichList() { |
1145 | return tabWidget->currentPageIndex(); | 1146 | return tabWidget->currentPageIndex(); |
1146 | } | 1147 | } |
1147 | 1148 | ||
1149 | PlayListWidget::TabType PlayListWidget::currentTab() const | ||
1150 | { | ||
1151 | static const TabType indexToTabType[ NumTabTypes ] = | ||
1152 | { CurrentPlaylist, AudioFiles, VideoFiles, PlayLists }; | ||
1153 | |||
1154 | int index = tabWidget->currentPageIndex(); | ||
1155 | assert( index < NumTabTypes && index >= 0 ); | ||
1156 | |||
1157 | return indexToTabType[ index ]; | ||
1158 | } | ||
1159 | |||
1148 | QString PlayListWidget::currentFileListPathName() { | 1160 | QString PlayListWidget::currentFileListPathName() { |
1149 | switch (whichList()) { | 1161 | switch (whichList()) { |
1150 | case 1: | 1162 | case 1: |
1151 | return audioView->currentItem()->text(3); | 1163 | return audioView->currentItem()->text(3); |
1152 | break; | 1164 | break; |
1153 | case 2: | 1165 | case 2: |
1154 | return videoView->currentItem()->text(3); | 1166 | return videoView->currentItem()->text(3); |
1155 | break; | 1167 | break; |
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 | |||
@@ -50,28 +50,31 @@ class QListViewItem; | |||
50 | class QListView; | 50 | class QListView; |
51 | class QPoint; | 51 | class QPoint; |
52 | class QAction; | 52 | class QAction; |
53 | class QLabel; | 53 | class QLabel; |
54 | 54 | ||
55 | class PlayListWidget : public PlayListWidgetGui { | 55 | class PlayListWidget : public PlayListWidgetGui { |
56 | Q_OBJECT | 56 | Q_OBJECT |
57 | public: | 57 | public: |
58 | enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists, NumTabTypes = 4 }; | ||
59 | |||
58 | PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 ); | 60 | PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 ); |
59 | ~PlayListWidget(); | 61 | ~PlayListWidget(); |
60 | DocLnkSet files; | 62 | DocLnkSet files; |
61 | DocLnkSet vFiles; | 63 | DocLnkSet vFiles; |
62 | bool fromSetDocument; | 64 | bool fromSetDocument; |
63 | bool insanityBool; | 65 | bool insanityBool; |
64 | QString setDocFileRef, currentPlayList; | 66 | QString setDocFileRef, currentPlayList; |
65 | // retrieve the current playlist entry (media file link) | 67 | // retrieve the current playlist entry (media file link) |
66 | const DocLnk *current(); | 68 | const DocLnk *current(); |
67 | void useSelectedDocument(); | 69 | void useSelectedDocument(); |
68 | int selected; | 70 | int selected; |
69 | int whichList(); | 71 | int whichList(); |
72 | TabType currentTab() const; | ||
70 | 73 | ||
71 | public slots: | 74 | public slots: |
72 | bool first(); | 75 | bool first(); |
73 | bool last(); | 76 | bool last(); |
74 | bool next(); | 77 | bool next(); |
75 | bool prev(); | 78 | bool prev(); |
76 | void writeDefaultPlaylist( ); | 79 | void writeDefaultPlaylist( ); |
77 | QString currentFileListPathName(); | 80 | QString currentFileListPathName(); |