Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 4e1543e..269aed8 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -36,13 +36,13 @@ | |||
36 | #include <qmainwindow.h> | 36 | #include <qmainwindow.h> |
37 | #include <qmessagebox.h> | 37 | #include <qmessagebox.h> |
38 | #include <qtoolbutton.h> | 38 | #include <qtoolbutton.h> |
39 | #include <qtabwidget.h> | 39 | #include <qtabwidget.h> |
40 | #include <qlistview.h> | 40 | #include <qlistview.h> |
41 | #include <qpoint.h> | 41 | #include <qpoint.h> |
42 | #include <qtimer.h> | 42 | //#include <qtimer.h> |
43 | 43 | ||
44 | #include "playlistselection.h" | 44 | #include "playlistselection.h" |
45 | #include "playlistwidget.h" | 45 | #include "playlistwidget.h" |
46 | #include "mediaplayerstate.h" | 46 | #include "mediaplayerstate.h" |
47 | 47 | ||
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
@@ -95,14 +95,14 @@ public: | |||
95 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | 95 | PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) |
96 | : QMainWindow( parent, name, fl ) { | 96 | : QMainWindow( parent, name, fl ) { |
97 | 97 | ||
98 | d = new PlayListWidgetPrivate; | 98 | d = new PlayListWidgetPrivate; |
99 | d->setDocumentUsed = FALSE; | 99 | d->setDocumentUsed = FALSE; |
100 | d->current = NULL; | 100 | d->current = NULL; |
101 | menuTimer = new QTimer( this ,"menu timer"), | 101 | // menuTimer = new QTimer( this ,"menu timer"), |
102 | connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); | 102 | // connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); |
103 | 103 | ||
104 | setBackgroundMode( PaletteButton ); | 104 | setBackgroundMode( PaletteButton ); |
105 | 105 | ||
106 | setCaption( tr("OpiePlayer") ); | 106 | setCaption( tr("OpiePlayer") ); |
107 | setIcon( Resource::loadPixmap( "MPEGPlayer" ) ); | 107 | setIcon( Resource::loadPixmap( "MPEGPlayer" ) ); |
108 | 108 | ||
@@ -201,18 +201,20 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
201 | Global::findDocuments(&files, "audio/*"); | 201 | Global::findDocuments(&files, "audio/*"); |
202 | QListIterator<DocLnk> dit( files.children() ); | 202 | QListIterator<DocLnk> dit( files.children() ); |
203 | QString storage; | 203 | QString storage; |
204 | for ( ; dit.current(); ++dit ) { | 204 | for ( ; dit.current(); ++dit ) { |
205 | QListViewItem * newItem; | 205 | QListViewItem * newItem; |
206 | if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; | 206 | if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; |
207 | else if(dit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; | ||
207 | else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD"; | 208 | else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD"; |
208 | else storage="RAM"; | 209 | else storage="RAM"; |
209 | 210 | if ( QFile( dit.current()->file()).exists() ) { | |
210 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); | 211 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); |
211 | newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" )); | 212 | newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" )); |
212 | } | 213 | } |
214 | } | ||
213 | // videowidget | 215 | // videowidget |
214 | 216 | ||
215 | QWidget *vTab; | 217 | QWidget *vTab; |
216 | vTab = new QWidget( tabWidget, "vTab" ); | 218 | vTab = new QWidget( tabWidget, "vTab" ); |
217 | videoView = new QListView( vTab, "Videoview" ); | 219 | videoView = new QListView( vTab, "Videoview" ); |
218 | videoView->setMinimumSize(233,260); | 220 | videoView->setMinimumSize(233,260); |
@@ -226,18 +228,21 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
226 | tabWidget->insertTab( vTab,"Video"); | 228 | tabWidget->insertTab( vTab,"Video"); |
227 | 229 | ||
228 | Global::findDocuments(&vFiles, "video/*"); | 230 | Global::findDocuments(&vFiles, "video/*"); |
229 | QListIterator<DocLnk> Vdit( vFiles.children() ); | 231 | QListIterator<DocLnk> Vdit( vFiles.children() ); |
230 | for ( ; Vdit.current(); ++Vdit ) { | 232 | for ( ; Vdit.current(); ++Vdit ) { |
231 | if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; | 233 | if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; |
234 | else if( Vdit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; | ||
232 | else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD"; | 235 | else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD"; |
233 | else storage="RAM"; | 236 | else storage="RAM"; |
234 | QListViewItem * newItem; | 237 | QListViewItem * newItem; |
238 | if ( QFile( Vdit.current()->file()).exists() ) { | ||
235 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); | 239 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); |
236 | newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" )); | 240 | newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" )); |
237 | } | 241 | } |
242 | } | ||
238 | 243 | ||
239 | 244 | ||
240 | // d->tbPlay = new ToolButton( vbox1, tr( "Play" ), "mpegplayer/play", mediaPlayerState, SLOT(setPlaying(bool)), TRUE ); | 245 | // d->tbPlay = new ToolButton( vbox1, tr( "Play" ), "mpegplayer/play", mediaPlayerState, SLOT(setPlaying(bool)), TRUE ); |
241 | // d->tbShuffle = new ToolButton( vbox1, tr( "Randomize" ), "mpegplayer/shuffle", mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); | 246 | // d->tbShuffle = new ToolButton( vbox1, tr( "Randomize" ), "mpegplayer/shuffle", mediaPlayerState, SLOT(setShuffled(bool)), TRUE ); |
242 | 247 | ||
243 | // add the library area | 248 | // add the library area |
@@ -660,34 +665,34 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
660 | d->tbAddToList->setEnabled(TRUE); | 665 | d->tbAddToList->setEnabled(TRUE); |
661 | } | 666 | } |
662 | break; | 667 | break; |
663 | }; | 668 | }; |
664 | } | 669 | } |
665 | 670 | ||
666 | void PlayListWidget::cancelMenuTimer() { | 671 | // void PlayListWidget::cancelMenuTimer() { |
667 | if( menuTimer->isActive() ) | 672 | // if( menuTimer->isActive() ) |
668 | menuTimer->stop(); | 673 | // menuTimer->stop(); |
669 | } | 674 | // } |
670 | 675 | ||
671 | void PlayListWidget::showFileMenu() { | 676 | // void PlayListWidget::showFileMenu() { |
672 | 677 | ||
673 | } | 678 | // } |
674 | 679 | ||
675 | void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) | 680 | // void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) |
676 | { | 681 | // { |
677 | // QListView::contentsMousePressEvent( e ); | 682 | // // QListView::contentsMousePressEvent( e ); |
678 | menuTimer->start( 750, TRUE ); | 683 | // menuTimer->start( 750, TRUE ); |
679 | } | 684 | // } |
680 | 685 | ||
681 | 686 | ||
682 | void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e ) | 687 | // void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e ) |
683 | { | 688 | // { |
684 | // QListView::contentsMouseReleaseEvent( e ); | 689 | // // QListView::contentsMouseReleaseEvent( e ); |
685 | menuTimer->stop(); | 690 | // menuTimer->stop(); |
686 | } | 691 | // } |
687 | // void PlayListWidget::setFullScreen() { | 692 | // // void PlayListWidget::setFullScreen() { |
688 | // mediaPlayerState->toggleFullscreen( ); | 693 | // mediaPlayerState->toggleFullscreen( ); |
689 | // } | 694 | // } |
690 | 695 | ||
691 | // void PlayListWidget::setScaled() { | 696 | // void PlayListWidget::setScaled() { |
692 | // mediaPlayerState->toggleScaled(); | 697 | // mediaPlayerState->toggleScaled(); |
693 | // } | 698 | // } |