-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 4926287..b9b63c7 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -1132,54 +1132,65 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) case Key_F13: //mail // doUnblank(); break; case Key_Q: //add to playlist qDebug("Add"); addSelected(); break; case Key_R: //remove from playlist removeSelected(); break; // case Key_P: //play // qDebug("Play"); // playSelected(); // break; case Key_Space: qDebug("Play"); // playSelected(); puh break; case Key_1: tabWidget->setCurrentPage(0); break; case Key_2: tabWidget->setCurrentPage(1); break; - case Key_3: - tabWidget->setCurrentPage(2); - break; - case Key_4: - tabWidget->setCurrentPage(3); - break; + case Key_3: + tabWidget->setCurrentPage(2); + break; + case Key_4: + tabWidget->setCurrentPage(3); + break; + case Key_Down: + if ( !d->selectedFiles->next() ) + d->selectedFiles->first(); + + break; + case Key_Up: + if ( !d->selectedFiles->prev() ) + d->selectedFiles->last(); + + break; + } } void PlayListWidget::keyPressEvent( QKeyEvent *e) { // qDebug("Key press"); // switch ( e->key() ) { // ////////////////////////////// Zaurus keys // case Key_A: //add to playlist // qDebug("Add"); // addSelected(); // break; // case Key_R: //remove from playlist // removeSelected(); // break; // case Key_P: //play // qDebug("Play"); // playSelected(); // break; // case Key_Space: // qDebug("Play"); // playSelected(); // break; // } @@ -1315,43 +1326,41 @@ void PlayListWidget::readPls(const QString &filename) { s=s.right(s.length() - 6); s.replace(QRegExp("%20")," "); qDebug("adding "+s+" to playlist"); // numberofentries=2 // File1=http // Title // Length // Version // File2=http s=s.replace( QRegExp("\\"),"/"); DocLnk lnk( s ); QFileInfo f(s); QString name = f.baseName(); if(name.left(4)=="http") name = s.right( s.length() - 7); else name=s; name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); // QFileInfo f(s); // QString name = f.baseName(); // name = name.left(name.length()-4); // name = name.right(name.findRev("/",0,TRUE)); lnk.setName( name); - if(s.at(s.length()-4) == '.') - lnk.setFile( s); - else { - if( name.right(1).find('/') == -1) - s+="/"; - // if(s.right(1) != '/') - lnk.setFile( s); - + if(s.at(s.length()-4) == '.') // if this is probably a file + lnk.setFile( s); + else { //if its a url + if( name.right(1).find('/') == -1) + s+="/"; + lnk.setFile( s); } lnk.setType("audio/x-mpegurl"); qDebug("DocLnk add "+name); d->selectedFiles->addToSelection( lnk); } } i++; } } |