-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index ccf654f..1138dc2 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -461,209 +461,210 @@ bool PlayListWidget::prev() { if ( mediaPlayerState->looping() ) { return d->selectedFiles->last(); } else { return FALSE; } } return TRUE; } } else { return mediaPlayerState->looping(); } } bool PlayListWidget::next() { //qDebug("<<<<<<<<<<<<next()"); if ( mediaPlayerState->playlist() ) { if ( mediaPlayerState->shuffled() ) { return prev(); } else { if ( !d->selectedFiles->next() ) { if ( mediaPlayerState->looping() ) { return d->selectedFiles->first(); } else { return FALSE; } } return TRUE; } } else { return mediaPlayerState->looping(); } } bool PlayListWidget::first() { if ( mediaPlayerState->playlist() ) return d->selectedFiles->first(); else return mediaPlayerState->looping(); } bool PlayListWidget::last() { if ( mediaPlayerState->playlist() ) return d->selectedFiles->last(); else return mediaPlayerState->looping(); } void PlayListWidget::saveList() { writem3u(); } void PlayListWidget::loadList( const DocLnk & lnk) { QString name = lnk.name(); // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); if( name.length()>0) { setCaption("OpiePlayer: "+name); // qDebug("<<<<<<<<<<<<load list "+ lnk.file()); clearList(); readm3u(lnk.file()); tabWidget->setCurrentPage(0); } } void PlayListWidget::setPlaylist( bool shown ) { if ( shown ) { d->playListFrame->show(); } else { d->playListFrame->hide(); } } void PlayListWidget::addSelected() { qDebug("addSelected"); DocLnk lnk; QString filename; switch (whichList()) { case 0: //playlist return; break; case 1: { //audio QListViewItemIterator it( audioView ); for ( ; it.current(); ++it ) { if ( it.current()->isSelected() ) { filename=it.current()->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); + } } + audioView->clearSelection(); } break; case 2: { // video QListViewItemIterator it( videoView ); for ( ; it.current(); ++it ) { if ( it.current()->isSelected() ) { - // myFile = (*it); - filename=it.current()->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); } } + videoView->clearSelection(); } break; }; tabWidget->setCurrentPage(0); writeCurrentM3u(); } void PlayListWidget::removeSelected() { d->selectedFiles->removeSelected( ); writeCurrentM3u(); } void PlayListWidget::playIt( QListViewItem *it) { if(!it) return; mediaPlayerState->setPlaying(FALSE); mediaPlayerState->setPlaying(TRUE); d->selectedFiles->unSelect(); } void PlayListWidget::addToSelection( QListViewItem *it) { d->setDocumentUsed = FALSE; if(it) { switch ( whichList()) { case 0: //playlist return; break; }; // case 1: { DocLnk lnk; QString filename; filename=it->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); writeCurrentM3u(); tabWidget->setCurrentPage(0); } } void PlayListWidget::tabChanged(QWidget *) { switch ( whichList()) { case 0: { if( !tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->hide(); } d->tbRemoveFromList->setEnabled(TRUE); d->tbAddToList->setEnabled(FALSE); } break; case 1: { // audioView->clear(); if(!audioPopulated) populateAudioView(); if( !tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->hide(); } d->tbRemoveFromList->setEnabled(FALSE); d->tbAddToList->setEnabled(TRUE); } break; case 2: { // videoView->clear(); if(!videoPopulated) populateVideoView(); if( !tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->hide(); } d->tbRemoveFromList->setEnabled(FALSE); d->tbAddToList->setEnabled(TRUE); } break; case 3: { if( tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->show(); } playLists->reread(); } break; }; } void PlayListWidget::btnPlay(bool b) { // mediaPlayerState->setPlaying(false); |