-rw-r--r-- | core/multimedia/opieplayer/audiodevice.cpp | 8 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 16 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 47 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.h | 12 |
4 files changed, 44 insertions, 39 deletions
diff --git a/core/multimedia/opieplayer/audiodevice.cpp b/core/multimedia/opieplayer/audiodevice.cpp index 59136af..11fd9e8 100644 --- a/core/multimedia/opieplayer/audiodevice.cpp +++ b/core/multimedia/opieplayer/audiodevice.cpp @@ -111,3 +111,3 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume if ( waveOutGetVolume( handle, (LPDWORD)&volume ) ) - qDebug( "get volume of audio device failed" ); +// qDebug( "get volume of audio device failed" ); waveOutClose( handle ); @@ -153,3 +153,3 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume, if ( waveOutSetVolume( handle, volume ) ) - qDebug( "set volume of audio device failed" ); +// qDebug( "set volume of audio device failed" ); waveOutClose( handle ); @@ -194,3 +194,3 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { d->bytesPerSample = bps; - qDebug("%d",bps); +// qDebug("%d",bps); int format=0; @@ -200,3 +200,3 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) { - qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); +// qDebug("AD- freq %d, channels %d, b/sample %d, bitrate %d",f,chs,bps,format); connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp index 859a67a..1ae0059 100644 --- a/core/multimedia/opieplayer/loopcontrol.cpp +++ b/core/multimedia/opieplayer/loopcontrol.cpp @@ -237,10 +237,10 @@ void LoopControl::startAudio() { -// if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 5000 ) ) { -// usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); -// } -// else if ( sampleWaitTime <= -5000 ) { -// qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); -// //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); -// currentSample = sampleWeShouldBeAt; -// } + if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) { + usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) ); + } + else if ( sampleWaitTime <= -5000 ) { + qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); + //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); + currentSample = sampleWeShouldBeAt; + } diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 4e1543e..269aed8 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -41,3 +41,3 @@ #include <qpoint.h> -#include <qtimer.h> +//#include <qtimer.h> @@ -100,4 +100,4 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) d->current = NULL; - menuTimer = new QTimer( this ,"menu timer"), - connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); +// menuTimer = new QTimer( this ,"menu timer"), +// connect( menuTimer, SIGNAL( timeout() ), SLOT( addSelected() ) ); @@ -206,7 +206,9 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) if(dit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; + else if(dit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; else if(dit.current()->file().find("/mnt/card") != -1 ) storage="SD"; else storage="RAM"; - + if ( QFile( dit.current()->file()).exists() ) { newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" )); + } } @@ -231,2 +233,3 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) if( Vdit.current()->file().find("/mnt/cf") != -1 ) storage="CF"; + else if( Vdit.current()->file().find("/mnt/hda") != -1 ) storage="CF"; else if( Vdit.current()->file().find("/mnt/card") != -1 ) storage="SD"; @@ -234,4 +237,6 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) QListViewItem * newItem; + if ( QFile( Vdit.current()->file()).exists() ) { newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" )); + } } @@ -665,24 +670,24 @@ void PlayListWidget::tabChanged(QWidget *widg) { -void PlayListWidget::cancelMenuTimer() { - if( menuTimer->isActive() ) - menuTimer->stop(); -} +// void PlayListWidget::cancelMenuTimer() { +// if( menuTimer->isActive() ) +// menuTimer->stop(); +// } -void PlayListWidget::showFileMenu() { +// void PlayListWidget::showFileMenu() { -} +// } -void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) -{ -// QListView::contentsMousePressEvent( e ); - menuTimer->start( 750, TRUE ); -} +// void PlayListWidget::contentsMousePressEvent( QMouseEvent * e ) +// { +// // QListView::contentsMousePressEvent( e ); +// menuTimer->start( 750, TRUE ); +// } -void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e ) -{ -// QListView::contentsMouseReleaseEvent( e ); - menuTimer->stop(); -} -// void PlayListWidget::setFullScreen() { +// void PlayListWidget::contentsMouseReleaseEvent( QMouseEvent * e ) +// { +// // QListView::contentsMouseReleaseEvent( e ); +// menuTimer->stop(); +// } +// // void PlayListWidget::setFullScreen() { // mediaPlayerState->toggleFullscreen( ); diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h index 3a52dd5..6fe2211 100644 --- a/core/multimedia/opieplayer/playlistwidget.h +++ b/core/multimedia/opieplayer/playlistwidget.h @@ -26,3 +26,3 @@ #include <qtabwidget.h> -#include <qtimer.h> +/* #include <qtimer.h> */ @@ -51,3 +51,3 @@ public: void useSelectedDocument(); - QTimer * menuTimer; +/* QTimer * menuTimer; */ @@ -78,4 +78,4 @@ public slots: protected: - void contentsMousePressEvent( QMouseEvent * e ); - void contentsMouseReleaseEvent( QMouseEvent * e ); +/* void contentsMousePressEvent( QMouseEvent * e ); */ +/* void contentsMouseReleaseEvent( QMouseEvent * e ); */ @@ -88,4 +88,4 @@ private: protected slots: - void cancelMenuTimer(); - void showFileMenu(); +/* void cancelMenuTimer(); */ +/* void showFileMenu(); */ |