summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayer.h2
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp70
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h3
3 files changed, 53 insertions, 22 deletions
diff --git a/core/multimedia/opieplayer/mediaplayer.h b/core/multimedia/opieplayer/mediaplayer.h
index cf9daea..8f9a0ee 100644
--- a/core/multimedia/opieplayer/mediaplayer.h
+++ b/core/multimedia/opieplayer/mediaplayer.h
@@ -45,4 +45,5 @@ private slots:
45 void startDecreasingVolume(); 45 void startDecreasingVolume();
46 void stopChangingVolume(); 46 void stopChangingVolume();
47 void cleanUp();
47 48
48protected: 49protected:
@@ -51,5 +52,4 @@ protected:
51 void doBlank(); 52 void doBlank();
52 void doUnblank(); 53 void doUnblank();
53 void cleanUp();
54private: 54private:
55 int volumeDirection; 55 int volumeDirection;
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 7a79be1..78c2822 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -33,5 +33,4 @@
33#include <qpe/global.h> 33#include <qpe/global.h>
34#include <qpe/resource.h> 34#include <qpe/resource.h>
35
36#include <qaction.h> 35#include <qaction.h>
37#include <qcursor.h> 36#include <qcursor.h>
@@ -132,4 +131,6 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
132 fromSetDocument = FALSE; 131 fromSetDocument = FALSE;
133 insanityBool=FALSE; 132 insanityBool=FALSE;
133 audioScan = FALSE;
134 videoScan = FALSE;
134// menuTimer = new QTimer( this ,"menu timer"), 135// menuTimer = new QTimer( this ,"menu timer"),
135// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); 136// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) );
@@ -182,4 +183,7 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
182 pmPlayList->insertSeparator(-1); 183 pmPlayList->insertSeparator(-1);
183 new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) ); 184 new MenuItem( pmPlayList, tr( "Open File or URL" ), this,SLOT( openFile() ) );
185 pmPlayList->insertSeparator(-1);
186 new MenuItem( pmPlayList, tr( "Rescan for Audio Files" ), this,SLOT( scanForAudio() ) );
187 new MenuItem( pmPlayList, tr( "Rescan for Video Files" ), this,SLOT( scanForVideo() ) );
184 188
185 QPopupMenu *pmView = new QPopupMenu( this ); 189 QPopupMenu *pmView = new QPopupMenu( this );
@@ -255,5 +259,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
255 259
256// audioView 260// audioView
257 populateAudioView(); 261// populateAudioView();
258// videowidget 262// videowidget
259 263
@@ -280,5 +284,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
280 284
281 tabWidget->insertTab( vTab,tr("Video")); 285 tabWidget->insertTab( vTab,tr("Video"));
282populateVideoView(); 286// populateVideoView();
283 287
284//playlists list 288//playlists list
@@ -286,5 +290,5 @@ populateVideoView();
286 LTab = new QWidget( tabWidget, "LTab" ); 290 LTab = new QWidget( tabWidget, "LTab" );
287 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy 291 playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy
288 playLists->setMinimumSize(233,260);; 292 playLists->setMinimumSize(233,260);
289 tabWidget->insertTab(LTab,tr("Lists")); 293 tabWidget->insertTab(LTab,tr("Lists"));
290 294
@@ -292,5 +296,4 @@ populateVideoView();
292// connect( playLists, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) ); 296// connect( playLists, SIGNAL( newSelected( const DocLnk &) ), this, SLOT( newFile( const DocLnk & ) ) );
293 297
294
295// add the library area 298// add the library area
296 299
@@ -434,6 +437,4 @@ void PlayListWidget::addAllToList() {
434 437
435void PlayListWidget::addAllMusicToList() { 438void PlayListWidget::addAllMusicToList() {
436// DocLnkSet files;
437// Global::findDocuments(&files, "audio/*");
438 QListIterator<DocLnk> dit( files.children() ); 439 QListIterator<DocLnk> dit( files.children() );
439 for ( ; dit.current(); ++dit ) 440 for ( ; dit.current(); ++dit )
@@ -528,5 +529,4 @@ const DocLnk *PlayListWidget::current() { // this is fugly
528 { 529 {
529 qDebug("audioView"); 530 qDebug("audioView");
530// Global::findDocuments(&files, "audio/*");
531 QListIterator<DocLnk> dit( files.children() ); 531 QListIterator<DocLnk> dit( files.children() );
532 for ( ; dit.current(); ++dit ) { 532 for ( ; dit.current(); ++dit ) {
@@ -542,5 +542,4 @@ const DocLnk *PlayListWidget::current() { // this is fugly
542 { 542 {
543 qDebug("videoView"); 543 qDebug("videoView");
544// Global::findDocuments(&vFiles, "video/*");
545 QListIterator<DocLnk> Vdit( vFiles.children() ); 544 QListIterator<DocLnk> Vdit( vFiles.children() );
546 for ( ; Vdit.current(); ++Vdit ) { 545 for ( ; Vdit.current(); ++Vdit ) {
@@ -804,4 +803,7 @@ void PlayListWidget::tabChanged(QWidget *widg) {
804 case 1: 803 case 1:
805 { 804 {
805 audioView->clear();
806 populateAudioView();
807
806 if( !tbDeletePlaylist->isHidden()) 808 if( !tbDeletePlaylist->isHidden())
807 tbDeletePlaylist->hide(); 809 tbDeletePlaylist->hide();
@@ -812,4 +814,6 @@ void PlayListWidget::tabChanged(QWidget *widg) {
812 case 2: 814 case 2:
813 { 815 {
816 videoView->clear();
817 populateVideoView();
814 if( !tbDeletePlaylist->isHidden()) 818 if( !tbDeletePlaylist->isHidden())
815 tbDeletePlaylist->hide(); 819 tbDeletePlaylist->hide();
@@ -828,6 +832,4 @@ void PlayListWidget::tabChanged(QWidget *widg) {
828} 832}
829 833
830
831
832void PlayListWidget::btnPlay(bool b) { 834void PlayListWidget::btnPlay(bool b) {
833 835
@@ -881,5 +883,4 @@ void PlayListWidget::deletePlaylist() {
881 break; 883 break;
882 }; 884 };
883
884} 885}
885 886
@@ -975,14 +976,35 @@ void PlayListWidget::listDelete() {
975} 976}
976 977
978void PlayListWidget::scanForAudio() {
979 qDebug("scan for audio");
980 files.detachChildren();
981 QListIterator<DocLnk> sdit( files.children() );
982 for ( ; sdit.current(); ++sdit ) {
983 delete sdit.current();
984 }
985 Global::findDocuments(&files, "audio/*");
986 audioScan = TRUE;
987}
988void PlayListWidget::scanForVideo() {
989 qDebug("scan for video");
990 vFiles.detachChildren();
991 QListIterator<DocLnk> sdit( vFiles.children() );
992 for ( ; sdit.current(); ++sdit ) {
993 delete sdit.current();
994 }
995 Global::findDocuments(&vFiles, "video/*");
996 videoScan = TRUE;
997}
998
977void PlayListWidget::populateAudioView() { 999void PlayListWidget::populateAudioView() {
978// if(files) 1000
979// files.~DocLnkSet(); 1001 audioView->clear();
980 StorageInfo storageInfo; 1002 StorageInfo storageInfo;
981 const QList<FileSystem> &fs = storageInfo.fileSystems(); 1003 const QList<FileSystem> &fs = storageInfo.fileSystems();
1004 if(!audioScan) scanForAudio();
982 1005
983 Global::findDocuments(&files, "audio/*");
984 QListIterator<DocLnk> dit( files.children() ); 1006 QListIterator<DocLnk> dit( files.children() );
985 QListIterator<FileSystem> it ( fs ); 1007 QListIterator<FileSystem> it ( fs );
986 audioView->clear(); 1008
987 QString storage; 1009 QString storage;
988 for ( ; dit.current(); ++dit ) { 1010 for ( ; dit.current(); ++dit ) {
@@ -994,6 +1016,8 @@ void PlayListWidget::populateAudioView() {
994 1016
995 QListViewItem * newItem; 1017 QListViewItem * newItem;
996 if ( QFile( dit.current()->file()).exists() ) { 1018 if ( QFile( dit.current()->file()).exists() ) {
997 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); 1019// qDebug(dit.current()->name());
1020 newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(),
1021 QString::number( QFile( dit.current()->file()).size() ), storage);
998 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" )); 1022 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" ));
999 } 1023 }
@@ -1003,8 +1027,10 @@ void PlayListWidget::populateAudioView() {
1003 1027
1004void PlayListWidget::populateVideoView() { 1028void PlayListWidget::populateVideoView() {
1029 videoView->clear();
1005 StorageInfo storageInfo; 1030 StorageInfo storageInfo;
1006 const QList<FileSystem> &fs = storageInfo.fileSystems(); 1031 const QList<FileSystem> &fs = storageInfo.fileSystems();
1007 1032
1008 Global::findDocuments(&vFiles, "video/*"); 1033 if(!videoScan ) scanForVideo();
1034
1009 QListIterator<DocLnk> Vdit( vFiles.children() ); 1035 QListIterator<DocLnk> Vdit( vFiles.children() );
1010 QListIterator<FileSystem> it ( fs ); 1036 QListIterator<FileSystem> it ( fs );
@@ -1020,5 +1046,6 @@ void PlayListWidget::populateVideoView() {
1020 QListViewItem * newItem; 1046 QListViewItem * newItem;
1021 if ( QFile( Vdit.current()->file()).exists() ) { 1047 if ( QFile( Vdit.current()->file()).exists() ) {
1022 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); 1048 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(),
1049 QString::number( QFile( Vdit.current()->file()).size() ), storage);
1023 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" )); 1050 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" ));
1024 } 1051 }
@@ -1096,5 +1123,5 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e)
1096 case Key_Space: 1123 case Key_Space:
1097 qDebug("Play"); 1124 qDebug("Play");
1098 playSelected(); 1125// playSelected(); puh
1099 break; 1126 break;
1100 case Key_1: 1127 case Key_1:
@@ -1234,2 +1261,3 @@ void PlayListWidget::readPls(const QString &filename) {
1234 } 1261 }
1235} 1262}
1263
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h
index 778e3ee..6569f35 100644
--- a/core/multimedia/opieplayer/playlistwidget.h
+++ b/core/multimedia/opieplayer/playlistwidget.h
@@ -72,4 +72,5 @@ void keyReleaseEvent( QKeyEvent *e);
72void keyPressEvent( QKeyEvent *e); 72void keyPressEvent( QKeyEvent *e);
73private: 73private:
74 bool audioScan, videoScan;
74 void doBlank(); 75 void doBlank();
75 void doUnblank(); 76 void doUnblank();
@@ -86,4 +87,6 @@ private:
86 void populateVideoView(); 87 void populateVideoView();
87private slots: 88private slots:
89 void scanForAudio();
90 void scanForVideo();
88 void openFile(); 91 void openFile();
89 void setDocument( const QString& fileref ); 92 void setDocument( const QString& fileref );