-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 18 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 2 |
2 files changed, 13 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index c2b5c77..6bedb57 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -153,12 +153,14 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
153 | connect ( gammaSlider, SIGNAL( valueChanged( int ) ), | 153 | connect ( gammaSlider, SIGNAL( valueChanged( int ) ), |
154 | mediaPlayerState, SLOT( setVideoGamma( int ) ) ); | 154 | mediaPlayerState, SLOT( setVideoGamma( int ) ) ); |
155 | 155 | ||
156 | // see which skins are installed | 156 | // see which skins are installed |
157 | videoScan=false; | 157 | videoScan=false; |
158 | audioScan=false; | 158 | audioScan=false; |
159 | audioPopulated=false; | ||
160 | videoPopulated=false; | ||
159 | populateSkinsMenu(); | 161 | populateSkinsMenu(); |
160 | initializeStates(); | 162 | initializeStates(); |
161 | 163 | ||
162 | cfg.setGroup("PlayList"); | 164 | cfg.setGroup("PlayList"); |
163 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); | 165 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); |
164 | loadList(DocLnk( currentPlaylist ) ); | 166 | loadList(DocLnk( currentPlaylist ) ); |
@@ -615,26 +617,26 @@ void PlayListWidget::tabChanged(QWidget *) { | |||
615 | d->tbRemoveFromList->setEnabled(TRUE); | 617 | d->tbRemoveFromList->setEnabled(TRUE); |
616 | d->tbAddToList->setEnabled(FALSE); | 618 | d->tbAddToList->setEnabled(FALSE); |
617 | } | 619 | } |
618 | break; | 620 | break; |
619 | case 1: | 621 | case 1: |
620 | { | 622 | { |
621 | audioView->clear(); | 623 | // audioView->clear(); |
622 | populateAudioView(); | 624 | if(!audioPopulated) populateAudioView(); |
623 | 625 | ||
624 | if( !tbDeletePlaylist->isHidden() ) { | 626 | if( !tbDeletePlaylist->isHidden() ) { |
625 | tbDeletePlaylist->hide(); | 627 | tbDeletePlaylist->hide(); |
626 | } | 628 | } |
627 | d->tbRemoveFromList->setEnabled(FALSE); | 629 | d->tbRemoveFromList->setEnabled(FALSE); |
628 | d->tbAddToList->setEnabled(TRUE); | 630 | d->tbAddToList->setEnabled(TRUE); |
629 | } | 631 | } |
630 | break; | 632 | break; |
631 | case 2: | 633 | case 2: |
632 | { | 634 | { |
633 | videoView->clear(); | 635 | // videoView->clear(); |
634 | populateVideoView(); | 636 | if(!videoPopulated) populateVideoView(); |
635 | if( !tbDeletePlaylist->isHidden() ) { | 637 | if( !tbDeletePlaylist->isHidden() ) { |
636 | tbDeletePlaylist->hide(); | 638 | tbDeletePlaylist->hide(); |
637 | } | 639 | } |
638 | d->tbRemoveFromList->setEnabled(FALSE); | 640 | d->tbRemoveFromList->setEnabled(FALSE); |
639 | d->tbAddToList->setEnabled(TRUE); | 641 | d->tbAddToList->setEnabled(TRUE); |
640 | } | 642 | } |
@@ -683,24 +685,26 @@ void PlayListWidget::scanForAudio() { | |||
683 | QListIterator<DocLnk> sdit( files.children() ); | 685 | QListIterator<DocLnk> sdit( files.children() ); |
684 | for ( ; sdit.current(); ++sdit ) { | 686 | for ( ; sdit.current(); ++sdit ) { |
685 | delete sdit.current(); | 687 | delete sdit.current(); |
686 | } | 688 | } |
687 | // Global::findDocuments( &files, "audio/*"); | 689 | // Global::findDocuments( &files, "audio/*"); |
688 | Global::findDocuments( &files, audioMimes); | 690 | Global::findDocuments( &files, audioMimes); |
689 | audioScan = TRUE; | 691 | audioScan = true; |
692 | populateAudioView(); | ||
690 | } | 693 | } |
691 | 694 | ||
692 | void PlayListWidget::scanForVideo() { | 695 | void PlayListWidget::scanForVideo() { |
693 | // qDebug("scan for video"); | 696 | // qDebug("scan for video"); |
694 | vFiles.detachChildren(); | 697 | vFiles.detachChildren(); |
695 | QListIterator<DocLnk> sdit( vFiles.children() ); | 698 | QListIterator<DocLnk> sdit( vFiles.children() ); |
696 | for ( ; sdit.current(); ++sdit ) { | 699 | for ( ; sdit.current(); ++sdit ) { |
697 | delete sdit.current(); | 700 | delete sdit.current(); |
698 | } | 701 | } |
699 | Global::findDocuments(&vFiles, "video/*"); | 702 | Global::findDocuments(&vFiles, "video/*"); |
700 | videoScan = TRUE; | 703 | videoScan = true; |
704 | populateVideoView(); | ||
701 | } | 705 | } |
702 | 706 | ||
703 | void PlayListWidget::populateAudioView() { | 707 | void PlayListWidget::populateAudioView() { |
704 | audioView->clear(); | 708 | audioView->clear(); |
705 | StorageInfo storageInfo; | 709 | StorageInfo storageInfo; |
706 | const QList<FileSystem> &fs = storageInfo.fileSystems(); | 710 | const QList<FileSystem> &fs = storageInfo.fileSystems(); |
@@ -731,12 +735,13 @@ void PlayListWidget::populateAudioView() { | |||
731 | size = QFile( dit.current()->file() ).size(); | 735 | size = QFile( dit.current()->file() ).size(); |
732 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), | 736 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), |
733 | QString::number(size ), storage, dit.current()->file()); | 737 | QString::number(size ), storage, dit.current()->file()); |
734 | newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) ); | 738 | newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) ); |
735 | } | 739 | } |
736 | } | 740 | } |
741 | audioPopulated=true; | ||
737 | } | 742 | } |
738 | 743 | ||
739 | 744 | ||
740 | void PlayListWidget::populateVideoView() { | 745 | void PlayListWidget::populateVideoView() { |
741 | videoView->clear(); | 746 | videoView->clear(); |
742 | StorageInfo storageInfo; | 747 | StorageInfo storageInfo; |
@@ -765,12 +770,13 @@ void PlayListWidget::populateVideoView() { | |||
765 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), | 770 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), |
766 | QString::number( QFile( Vdit.current()->file() ).size() ), | 771 | QString::number( QFile( Vdit.current()->file() ).size() ), |
767 | storage, Vdit.current()->file()); | 772 | storage, Vdit.current()->file()); |
768 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); | 773 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); |
769 | } | 774 | } |
770 | } | 775 | } |
776 | videoPopulated=true; | ||
771 | } | 777 | } |
772 | 778 | ||
773 | 779 | ||
774 | void PlayListWidget::openFile() { | 780 | void PlayListWidget::openFile() { |
775 | // http://66.28.164.33:2080 | 781 | // http://66.28.164.33:2080 |
776 | // http://somafm.com/star0242.m3u | 782 | // http://somafm.com/star0242.m3u |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index 53be7a7..b2c389e 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h | |||
@@ -77,13 +77,13 @@ public slots: | |||
77 | QString currentFileListPathName(); | 77 | QString currentFileListPathName(); |
78 | protected: | 78 | protected: |
79 | void keyReleaseEvent( QKeyEvent *e); | 79 | void keyReleaseEvent( QKeyEvent *e); |
80 | 80 | ||
81 | private: | 81 | private: |
82 | int defaultSkinIndex; | 82 | int defaultSkinIndex; |
83 | bool audioScan, videoScan; | 83 | bool audioScan, videoScan, audioPopulated, videoPopulated; |
84 | void readm3u(const QString &); | 84 | void readm3u(const QString &); |
85 | void readPls(const QString &); | 85 | void readPls(const QString &); |
86 | void initializeStates(); | 86 | void initializeStates(); |
87 | void populateAudioView(); | 87 | void populateAudioView(); |
88 | void populateVideoView(); | 88 | void populateVideoView(); |
89 | 89 | ||