author | llornkcor <llornkcor> | 2002-09-04 23:38:09 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-09-04 23:38:09 (UTC) |
commit | 3f2a74813b552c6f7a4450ec6294bbbcc5b811c5 (patch) (side-by-side diff) | |
tree | a29f6d3436365b13b71615052cf08817225d0d78 | |
parent | 95d24f601f7845e49092068ad358030024fa6097 (diff) | |
download | opie-3f2a74813b552c6f7a4450ec6294bbbcc5b811c5.zip opie-3f2a74813b552c6f7a4450ec6294bbbcc5b811c5.tar.gz opie-3f2a74813b552c6f7a4450ec6294bbbcc5b811c5.tar.bz2 |
change playing in file lists. no loop mode
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/inputDialog.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 48 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.h | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 84 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 2 |
7 files changed, 97 insertions, 45 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 040e965..446fa45 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -455,2 +455,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { } + qDebug("mouseEvent %d", i); switch (i) { diff --git a/noncore/multimedia/opieplayer2/inputDialog.cpp b/noncore/multimedia/opieplayer2/inputDialog.cpp index 9edb1d3..62240b2 100644 --- a/noncore/multimedia/opieplayer2/inputDialog.cpp +++ b/noncore/multimedia/opieplayer2/inputDialog.cpp @@ -27,2 +27,3 @@ InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); + LineEdit1->setFocus(); } diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index bf2acc8..553e3c1 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -5,2 +5,3 @@ #include <qpe/qcopenvelope_qws.h> +#include <qfileinfo.h> @@ -91,2 +92,4 @@ void MediaPlayer::setPlaying( bool play ) { + QString tickerText, time, fileName; + if( playList->whichList() == 0 ) { //check for filelist const DocLnk *playListCurrent = playList->current(); @@ -95,17 +98,32 @@ void MediaPlayer::setPlaying( bool play ) { } - xineControl->play( currentFile->file() ); + fileName = currentFile->name(); + long seconds = mediaPlayerState->length();// + time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); + qDebug(time); + } else { //if playing in file list.. play in a different way + // random and looping settings enabled causes problems here, + // since there is no selected file in the playlist, but a selected file in the file list, + // so we remember and shutoff + l = mediaPlayerState->looping(); + if(l) + mediaPlayerState->setLooping( false ); + r = mediaPlayerState->shuffled(); + mediaPlayerState->setShuffled(false); + + fileName = playList->currentFileListPathName(); + xineControl->play( fileName); long seconds = mediaPlayerState->length();// - QString time; time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); + time.sprintf("%li:%02i", seconds/60, (int)seconds%60 ); qDebug(time); + if( fileName.left(4) != "http" ) + fileName = QFileInfo( fileName).baseName(); - QString tickerText; - if( currentFile->file().left(4) == "http" ) - tickerText= tr( " File: " ) + currentFile->name(); + } + if( fileName.left(4) == "http" ) + tickerText= tr( " File: " ) + fileName; else - tickerText = tr( " File: " ) + currentFile->name() + tr(", Length: ") + time; - - audioUI->setTickerText( currentFile->file( ) ); - + tickerText = tr( " File: " ) + fileName + tr(", Length: ") + time; + audioUI->setTickerText( tickerText ); } @@ -114,2 +132,3 @@ void MediaPlayer::setPlaying( bool play ) { void MediaPlayer::prev() { + if(playList->whichList() == 0) { //if using the playlist if ( playList->prev() ) { @@ -124,2 +143,3 @@ void MediaPlayer::prev() { } +} @@ -127,2 +147,4 @@ void MediaPlayer::prev() { void MediaPlayer::next() { + + if(playList->whichList() == 0) { //if using the playlist if ( playList->next() ) { @@ -136,2 +158,10 @@ void MediaPlayer::next() { } + } else { //if playing from file list, let's just stop + qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); + mediaPlayerState->setPlaying(false); + mediaPlayerState->setView('l'); + if(l) mediaPlayerState->setLooping(l); + if(r) mediaPlayerState->setShuffled(r); + } + qApp->processEvents(); } diff --git a/noncore/multimedia/opieplayer2/mediaplayer.h b/noncore/multimedia/opieplayer2/mediaplayer.h index 81fab88..05be128 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.h +++ b/noncore/multimedia/opieplayer2/mediaplayer.h @@ -19,3 +19,2 @@ public: ~MediaPlayer(); - private slots: @@ -36,3 +35,3 @@ protected: private: - bool isBlanked; + bool isBlanked, l, r; int fd; diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 3bd04bc..15c70c3 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -323,3 +323,3 @@ void PlayListWidget::useSelectedDocument() { const DocLnk *PlayListWidget::current() { // this is fugly - switch ( tabWidget->currentPageIndex() ) { + switch ( whichList() ) { case 0: //playlist @@ -396,2 +396,3 @@ bool PlayListWidget::prev() { bool PlayListWidget::next() { +qDebug("<<<<<<<<<<<<next()"); if ( mediaPlayerState->playlist() ) { @@ -499,3 +500,3 @@ void PlayListWidget::addSelected() { - switch (tabWidget->currentPageIndex()) { + switch (whichList()) { case 0: //playlist @@ -559,3 +560,3 @@ void PlayListWidget::addToSelection( QListViewItem *it) { if(it) { - switch (tabWidget->currentPageIndex()) { + switch ( whichList()) { case 1: { @@ -590,3 +591,3 @@ void PlayListWidget::tabChanged(QWidget *) { - switch ( tabWidget->currentPageIndex()) { + switch ( whichList()) { case 0: @@ -636,31 +637,30 @@ void PlayListWidget::tabChanged(QWidget *) { void PlayListWidget::btnPlay(bool b) { - // mediaPlayerState->setPlaying(b); - switch ( tabWidget->currentPageIndex()) { - case 0: - { - mediaPlayerState->setPlaying(b); - } - break; - case 1: - { - addToSelection( audioView->currentItem() ); - mediaPlayerState->setPlaying(b); - d->selectedFiles->removeSelected( ); - tabWidget->setCurrentPage(1); - d->selectedFiles->unSelect(); - insanityBool=FALSE; - }// audioView->clearSelection(); - break; - case 2: - { - addToSelection( videoView->currentItem() ); mediaPlayerState->setPlaying(b); qApp->processEvents(); - d->selectedFiles->removeSelected( ); - tabWidget->setCurrentPage(2); - d->selectedFiles->unSelect(); insanityBool=FALSE; - }// videoView->clearSelection(); - break; - }; +// switch ( whichList()) { +// case 0: +// { +// mediaPlayerState->setPlaying(b); +// } +// break; +// case 1: +// { +// mediaPlayerState->setPlaying(b); +// qApp->processEvents(); +// insanityBool=FALSE; +// }// audioView->clearSelection(); +// break; +// case 2: +// { +// // addToSelection( videoView->currentItem() ); +// mediaPlayerState->setPlaying(b); +// qApp->processEvents(); +// // d->selectedFiles->removeSelected( ); +// // tabWidget->setCurrentPage(2); +// // d->selectedFiles->unSelect(); +// insanityBool=FALSE; +// }// videoView->clearSelection(); +// break; +// }; @@ -738,3 +738,4 @@ void PlayListWidget::populateAudioView() { size = QFile( dit.current()->file() ).size(); - newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number(size ), storage); + newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), + QString::number(size ), storage, dit.current()->file()); newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) ); @@ -757,3 +758,3 @@ void PlayListWidget::populateVideoView() { videoView->clear(); - QString storage; + QString storage, pathName; for ( ; Vdit.current(); ++Vdit ) { @@ -764,2 +765,3 @@ void PlayListWidget::populateVideoView() { storage=name; + pathName=path; } @@ -770,3 +772,3 @@ void PlayListWidget::populateVideoView() { newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), - QString::number( QFile( Vdit.current()->file() ).size() ), storage ); + QString::number( QFile( Vdit.current()->file() ).size() ), storage, Vdit.current()->file()); newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); @@ -1064 +1066,17 @@ void PlayListWidget::skinsMenuActivated( int item ) { } + +int PlayListWidget::whichList() { + return tabWidget->currentPageIndex(); +} + +QString PlayListWidget::currentFileListPathName() { + switch (whichList()) { + case 1: + return audioView->currentItem()->text(3); + break; + case 2: + return videoView->currentItem()->text(3); + break; + }; + return ""; +} diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index dcfdd48..2873dca 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h @@ -68,2 +68,3 @@ public: int selected; + int whichList(); @@ -75,3 +76,3 @@ public slots: void writeConfig( Config& cfg ) const; - + QString currentFileListPathName(); protected: diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index 250833c..f073102 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp @@ -157,2 +157,3 @@ PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags audioView->addColumn( tr( "Media" ), -1 ); + audioView->addColumn( tr( "Path" ), 0 ); audioView->setColumnAlignment( 1, Qt::AlignRight ); @@ -178,2 +179,3 @@ PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags videoView->addColumn(tr( "Media" ), -1 ); + videoView->addColumn(tr( "Path" ), 0 ); videoView->setColumnAlignment( 1, Qt::AlignRight ); |