-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 4 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.h | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 30 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mpegplayer.pro | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistselection.cpp | 8 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 173 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 1 | ||||
-rw-r--r-- | core/multimedia/opieplayer/videowidget.cpp | 19 |
8 files changed, 158 insertions, 80 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index 3901446..cda3f77 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp | |||
@@ -222,3 +222,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
222 | toggleButton(i); | 222 | toggleButton(i); |
223 | qDebug("button toggled %d",i); | 223 | qDebug("button toggled1 %d",i); |
224 | switch (i) { | 224 | switch (i) { |
@@ -230,2 +230,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
230 | toggleButton(i); | 230 | toggleButton(i); |
231 | qDebug("button toggled2 %d",i); | ||
231 | } | 232 | } |
@@ -236,2 +237,3 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
236 | setToggleButton( i, FALSE ); | 237 | setToggleButton( i, FALSE ); |
238 | qDebug("button toggled3 %d",i); | ||
237 | switch (i) { | 239 | switch (i) { |
diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h index a2850aa..d1d72b6 100644 --- a/core/multimedia/opieplayer/audiowidget.h +++ b/core/multimedia/opieplayer/audiowidget.h | |||
@@ -19,2 +19,3 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | |||
20 | #ifndef AUDIO_WIDGET_H | 21 | #ifndef AUDIO_WIDGET_H |
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 4b2827e..b9f96de 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp | |||
@@ -21,3 +21,2 @@ | |||
21 | 21 | ||
22 | |||
23 | #include <qpe/qpeapplication.h> | 22 | #include <qpe/qpeapplication.h> |
@@ -223,2 +222,3 @@ void LoopControl::startAudio() { | |||
223 | 222 | ||
223 | //qDebug("start audio"); | ||
224 | audioMutex->lock(); | 224 | audioMutex->lock(); |
@@ -238,10 +238,10 @@ void LoopControl::startAudio() { | |||
238 | 238 | ||
239 | // if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { | 239 | // if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { |
240 | // usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); | 240 | // usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); |
241 | // } | 241 | // } |
242 | // else if ( sampleWaitTime <= -5000 ) { | 242 | // else if ( sampleWaitTime <= -5000 ) { |
243 | // // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); | 243 | // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); |
244 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); | 244 | // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); |
245 | // currentSample = sampleWeShouldBeAt; | 245 | // currentSample = sampleWeShouldBeAt; |
246 | // } | 246 | // } |
247 | 247 | ||
@@ -380,3 +380,3 @@ bool LoopControl::init( const QString& filename ) { | |||
380 | channels = mediaPlayerState->curDecoder()->audioChannels( astream ); | 380 | channels = mediaPlayerState->curDecoder()->audioChannels( astream ); |
381 | // qDebug( "LC- channels = %d", channels ); | 381 | qDebug( "LC- channels = %d", channels ); |
382 | 382 | ||
@@ -390,3 +390,3 @@ bool LoopControl::init( const QString& filename ) { | |||
390 | freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); | 390 | freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); |
391 | // qDebug( "LC- frequency = %d", freq ); | 391 | qDebug( "LC- frequency = %d", freq ); |
392 | 392 | ||
@@ -394,9 +394,7 @@ bool LoopControl::init( const QString& filename ) { | |||
394 | int bits_per_sample; | 394 | int bits_per_sample; |
395 | if ( mediaPlayerState->curDecoder()->pluginName() == QString("WavPlugin") ) { | 395 | if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibWavPlugin") ) { |
396 | bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); | 396 | bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); |
397 | // qDebug("using stupid hack"); | 397 | qDebug("using stupid hack"); |
398 | } else { | 398 | } else { |
399 | bits_per_sample=0; | 399 | bits_per_sample=0; |
400 | // freq=44100; | ||
401 | channels=2; | ||
402 | } | 400 | } |
diff --git a/core/multimedia/opieplayer/mpegplayer.pro b/core/multimedia/opieplayer/mpegplayer.pro index b9e9ffe..241e29e 100644 --- a/core/multimedia/opieplayer/mpegplayer.pro +++ b/core/multimedia/opieplayer/mpegplayer.pro | |||
@@ -24,3 +24,3 @@ DEPENDPATH += $(OPIEDIR)/include | |||
24 | 24 | ||
25 | TRANSLATIONS = ../i18n/de/mpegplayer.ts | 25 | TRANSLATIONS += ../i18n/de/mpegplayer.ts |
26 | TRANSLATIONS += ../i18n/pt_BR/mpegplayer.ts | 26 | TRANSLATIONS += ../i18n/pt_BR/mpegplayer.ts |
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp index 991301a..756e3b4 100644 --- a/core/multimedia/opieplayer/playlistselection.cpp +++ b/core/multimedia/opieplayer/playlistselection.cpp | |||
@@ -57,3 +57,3 @@ PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) | |||
57 | 57 | ||
58 | setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); | 58 | // setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); |
59 | // #endif | 59 | // #endif |
@@ -75,5 +75,5 @@ void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { | |||
75 | p->fillRect( r, QBrush( white ) ); | 75 | p->fillRect( r, QBrush( white ) ); |
76 | QImage logo = Resource::loadImage( "launcher/opielogo" ); | 76 | // QImage logo = Resource::loadImage( "launcher/opielogo" ); |
77 | if ( !logo.isNull() ) | 77 | // if ( !logo.isNull() ) |
78 | p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); | 78 | // p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); |
79 | } | 79 | } |
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 524747e..cf665c8 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -108,2 +108,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
108 | fromSetDocument = FALSE; | 108 | fromSetDocument = FALSE; |
109 | insanityBool=FALSE; | ||
109 | // menuTimer = new QTimer( this ,"menu timer"), | 110 | // menuTimer = new QTimer( this ,"menu timer"), |
@@ -208,5 +209,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
208 | audioView->setMinimumSize(233,260); | 209 | audioView->setMinimumSize(233,260); |
209 | audioView->addColumn( "Title",150); | 210 | audioView->addColumn( "Title",140); |
210 | audioView->addColumn("Size", 45); | 211 | audioView->addColumn("Size", -1); |
211 | audioView->addColumn("Media",35); | 212 | audioView->addColumn("Media",-1); |
212 | audioView->setColumnAlignment(1, Qt::AlignRight); | 213 | audioView->setColumnAlignment(1, Qt::AlignRight); |
@@ -243,5 +244,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
243 | 244 | ||
244 | videoView->addColumn("Title",150); | 245 | videoView->addColumn("Title",140); |
245 | videoView->addColumn("Size",45); | 246 | videoView->addColumn("Size",-1); |
246 | videoView->addColumn("Media",35); | 247 | videoView->addColumn("Media",-1); |
247 | videoView->setColumnAlignment(1, Qt::AlignRight); | 248 | videoView->setColumnAlignment(1, Qt::AlignRight); |
@@ -488,34 +489,46 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
488 | // } else | 489 | // } else |
489 | switch (tabWidget->currentPageIndex()) { | 490 | // qDebug("current"); |
490 | case 0: //playlist | 491 | // switch (tabWidget->currentPageIndex()) { |
491 | { | 492 | // case 0: //playlist |
492 | if ( mediaPlayerState->playlist() ) { | 493 | // { |
493 | return d->selectedFiles->current(); | 494 | qDebug("playlist"); |
494 | } | 495 | if ( mediaPlayerState->playlist() ) { |
495 | else if ( d->setDocumentUsed && d->current ) { | 496 | return d->selectedFiles->current(); |
496 | return d->current; | ||
497 | } else { | ||
498 | return d->files->selected(); | ||
499 | } | ||
500 | } | 497 | } |
501 | break; | 498 | else if ( d->setDocumentUsed && d->current ) { |
502 | case 1: { //audio | 499 | return d->current; |
503 | Global::findDocuments(&files, "audio/*"); | 500 | } else { |
504 | QListIterator<DocLnk> dit( files.children() ); | 501 | return d->files->selected(); |
505 | for ( ; dit.current(); ++dit ) { | ||
506 | if( dit.current()->name() == audioView->currentItem()->text(0)) | ||
507 | return dit; | ||
508 | } | ||
509 | } | ||
510 | break; | ||
511 | case 2: { // video | ||
512 | Global::findDocuments(&vFiles, "video/*"); | ||
513 | QListIterator<DocLnk> Vdit( vFiles.children() ); | ||
514 | for ( ; Vdit.current(); ++Vdit ) { | ||
515 | if( Vdit.current()->name() == videoView->currentItem()->text(0)) | ||
516 | return Vdit; | ||
517 | } | ||
518 | } | 502 | } |
519 | break; | 503 | // } |
520 | }; | 504 | // break; |
505 | // case 1://audio | ||
506 | // { | ||
507 | // qDebug("audioView"); | ||
508 | // Global::findDocuments(&files, "audio/*"); | ||
509 | // QListIterator<DocLnk> dit( files.children() ); | ||
510 | // for ( ; dit.current(); ++dit ) { | ||
511 | // if( dit.current()->name() == audioView->currentItem()->text(0) && !insanityBool) { | ||
512 | // qDebug("here"); | ||
513 | // insanityBool=TRUE; | ||
514 | // return dit; | ||
515 | // } | ||
516 | // } | ||
517 | // } | ||
518 | // break; | ||
519 | // case 2: // video | ||
520 | // { | ||
521 | // qDebug("videoView"); | ||
522 | // Global::findDocuments(&vFiles, "video/*"); | ||
523 | // QListIterator<DocLnk> Vdit( vFiles.children() ); | ||
524 | // for ( ; Vdit.current(); ++Vdit ) { | ||
525 | // if( Vdit.current()->name() == videoView->currentItem()->text(0) && !insanityBool) { | ||
526 | // insanityBool=TRUE; | ||
527 | // return Vdit; | ||
528 | // } | ||
529 | // } | ||
530 | // } | ||
531 | // break; | ||
532 | // }; | ||
533 | // return 0; | ||
521 | } | 534 | } |
@@ -656,14 +669,45 @@ void PlayListWidget::addSelected() { | |||
656 | 669 | ||
657 | switch (tabWidget->currentPageIndex()) { | 670 | Config cfg( "MediaPlayer" ); |
658 | case 0: //playlist | 671 | cfg.setGroup("PlayList"); |
659 | break; | 672 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); |
660 | case 1: { //audio | 673 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); |
661 | addToSelection( audioView->selectedItem() ); | 674 | |
662 | } | 675 | switch (tabWidget->currentPageIndex()) { |
663 | break; | 676 | case 0: //playlist |
664 | case 2: { // video | 677 | break; |
665 | addToSelection( videoView->selectedItem() ); | 678 | case 1: { //audio |
666 | } | 679 | for ( int i = 0; i < noOfFiles; i++ ) { |
667 | break; | 680 | QString entryName; |
668 | }; | 681 | entryName.sprintf( "File%i", i + 1 ); |
682 | QString linkFile = cfg.readEntry( entryName ); | ||
683 | if( DocLnk( linkFile).name() == audioView->selectedItem()->text(0) ) { | ||
684 | int result= QMessageBox::warning(this,"OpiePlayer", | ||
685 | tr("This is all ready in your playlist.\nContinue?"), | ||
686 | tr("Yes"),tr("No"),0,0,1); | ||
687 | if (result !=0) | ||
688 | return; | ||
689 | } | ||
690 | } | ||
691 | addToSelection( audioView->selectedItem() ); | ||
692 | tabWidget->setCurrentPage(1); | ||
693 | } | ||
694 | break; | ||
695 | case 2: { // video | ||
696 | for ( int i = 0; i < noOfFiles; i++ ) { | ||
697 | QString entryName; | ||
698 | entryName.sprintf( "File%i", i + 1 ); | ||
699 | QString linkFile = cfg.readEntry( entryName ); | ||
700 | if( DocLnk( linkFile).name() == videoView->selectedItem()->text(0) ) { | ||
701 | int result= QMessageBox::warning(this,"OpiePlayer", | ||
702 | tr("This is all ready in your playlist.\nContinue?"), | ||
703 | tr("Yes"),tr("No"),0,0,1); | ||
704 | if (result !=0) | ||
705 | return; | ||
706 | } | ||
707 | } | ||
708 | addToSelection( videoView->selectedItem() ); | ||
709 | tabWidget->setCurrentPage(2); | ||
710 | } | ||
711 | break; | ||
712 | }; | ||
669 | } | 713 | } |
@@ -757,3 +801,34 @@ void PlayListWidget::tabChanged(QWidget *widg) { | |||
757 | void PlayListWidget::btnPlay(bool b) { | 801 | void PlayListWidget::btnPlay(bool b) { |
758 | mediaPlayerState->setPlaying(b); | 802 | // mediaPlayerState->setPlaying(b); |
803 | switch ( tabWidget->currentPageIndex()) { | ||
804 | case 0: | ||
805 | { | ||
806 | mediaPlayerState->setPlaying(b); | ||
807 | } | ||
808 | break; | ||
809 | case 1: | ||
810 | { | ||
811 | addToSelection( audioView->selectedItem() ); | ||
812 | mediaPlayerState->setPlaying(b); | ||
813 | // qApp->processEvents(); | ||
814 | d->selectedFiles->removeSelected( ); | ||
815 | tabWidget->setCurrentPage(1); | ||
816 | // mediaPlayerState->setPlaying(FALSE); | ||
817 | } | ||
818 | break; | ||
819 | case 2: | ||
820 | { | ||
821 | addToSelection( videoView->selectedItem() ); | ||
822 | mediaPlayerState->setPlaying(b); | ||
823 | qApp->processEvents(); | ||
824 | d->selectedFiles->removeSelected( ); | ||
825 | tabWidget->setCurrentPage(2); | ||
826 | // mediaPlayerState->setPlaying(FALSE); | ||
827 | } | ||
828 | break; | ||
829 | }; | ||
830 | |||
831 | |||
832 | |||
833 | |||
759 | } | 834 | } |
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index effc600..10a42df 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h | |||
@@ -51,2 +51,3 @@ public: | |||
51 | bool fromSetDocument; | 51 | bool fromSetDocument; |
52 | bool insanityBool; | ||
52 | QString setDocFileRef; | 53 | QString setDocFileRef; |
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp index bb5f9e8..23b36e5 100644 --- a/core/multimedia/opieplayer/videowidget.cpp +++ b/core/multimedia/opieplayer/videowidget.cpp | |||
@@ -205,13 +205,14 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
205 | setToggleButton( i, FALSE ); | 205 | setToggleButton( i, FALSE ); |
206 | switch (i) { | ||
207 | case VideoPlay: mediaPlayerState->setPlaying(videoButtons[i].isDown); return; | ||
208 | case VideoStop: mediaPlayerState->setPlaying(FALSE); return; | ||
209 | case VideoPause: mediaPlayerState->setPaused(videoButtons[i].isDown); return; | ||
210 | case VideoNext: mediaPlayerState->setNext(); return; | ||
211 | case VideoPrevious: mediaPlayerState->setPrev(); return; | ||
212 | case VideoPlayList: mediaPlayerState->setList(); return; | ||
213 | case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; | ||
214 | } | ||
215 | } | 206 | } |
216 | } | 207 | } |
208 | switch (i) { | ||
209 | case VideoPlay: mediaPlayerState->setPlaying(videoButtons[i].isDown); return; | ||
210 | case VideoStop: mediaPlayerState->setPlaying(FALSE); return; | ||
211 | case VideoPause: mediaPlayerState->setPaused(videoButtons[i].isDown); return; | ||
212 | case VideoNext: mediaPlayerState->setNext(); return; | ||
213 | case VideoPrevious: mediaPlayerState->setPrev(); return; | ||
214 | case VideoPlayList: mediaPlayerState->setList(); return; | ||
215 | case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; | ||
216 | } | ||
217 | |||
217 | } | 218 | } |