-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 | |||
@@ -43,24 +43,25 @@ | |||
43 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
44 | #include <qregexp.h> | 44 | #include <qregexp.h> |
45 | #include <qtextstream.h> | 45 | #include <qtextstream.h> |
46 | 46 | ||
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 | ||
63 | QString audioMimes ="audio/mpeg;audio/x-wav;audio/x-ogg"; | 64 | QString audioMimes ="audio/mpeg;audio/x-wav;audio/x-ogg"; |
64 | // no m3u's here please | 65 | // no m3u's here please |
65 | 66 | ||
66 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | 67 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) |
@@ -1136,23 +1137,34 @@ void PlayListWidget::skinsMenuActivated( int item ) { | |||
1136 | 1137 | ||
1137 | Config cfg( "OpiePlayer" ); | 1138 | Config cfg( "OpiePlayer" ); |
1138 | cfg.setGroup("Options"); | 1139 | cfg.setGroup("Options"); |
1139 | cfg.writeEntry("Skin", skinsMenu->text( item ) ); | 1140 | cfg.writeEntry("Skin", skinsMenu->text( 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; |
1156 | }; | 1168 | }; |
1157 | return ""; | 1169 | return ""; |
1158 | } | 1170 | } |
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 | |||
@@ -46,36 +46,39 @@ | |||
46 | 46 | ||
47 | //class PlayListWidgetPrivate; | 47 | //class PlayListWidgetPrivate; |
48 | class Config; | 48 | class Config; |
49 | class QListViewItem; | 49 | 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(); |
78 | protected: | 81 | protected: |
79 | void keyReleaseEvent( QKeyEvent *e); | 82 | void keyReleaseEvent( QKeyEvent *e); |
80 | 83 | ||
81 | private: | 84 | private: |