summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-02-25 00:26:33 (UTC)
committer llornkcor <llornkcor>2002-02-25 00:26:33 (UTC)
commitc0446b55fc32b7fdea9f58db06e40da703f5e8ff (patch) (side-by-side diff)
treeb84cbcdf9d2687bb3e8672981a6e62577c98becb
parent146ed85c70bf6a288294e91baceb9af9ec5b8611 (diff)
downloadopie-c0446b55fc32b7fdea9f58db06e40da703f5e8ff.zip
opie-c0446b55fc32b7fdea9f58db06e40da703f5e8ff.tar.gz
opie-c0446b55fc32b7fdea9f58db06e40da703f5e8ff.tar.bz2
*** empty log message ***
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiodevice.cpp8
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp16
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp47
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h12
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
@@ -109,7 +109,7 @@ void AudioDevice::getVolume( unsigned int& leftVolume, unsigned int& rightVolume
formatData.wBitsPerSample = 16;
waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL);
if ( waveOutGetVolume( handle, (LPDWORD)&volume ) )
- qDebug( "get volume of audio device failed" );
+// qDebug( "get volume of audio device failed" );
waveOutClose( handle );
leftVolume = volume & 0xFFFF;
rightVolume = volume >> 16;
@@ -151,7 +151,7 @@ void AudioDevice::setVolume( unsigned int leftVolume, unsigned int rightVolume,
waveOutOpen(&handle, WAVE_MAPPER, &formatData, 0L, 0L, CALLBACK_NULL);
unsigned int volume = (rightVolume << 16) | leftVolume;
if ( waveOutSetVolume( handle, volume ) )
- qDebug( "set volume of audio device failed" );
+// qDebug( "set volume of audio device failed" );
waveOutClose( handle );
#else
// Volume can be from 0 to 100 which is 101 distinct values
@@ -192,13 +192,13 @@ AudioDevice::AudioDevice( unsigned int f, unsigned int chs, unsigned int bps ) {
d->frequency = f;
d->channels = chs;
d->bytesPerSample = bps;
- qDebug("%d",bps);
+// qDebug("%d",bps);
int format=0;
if( bps == 8) format = AFMT_U8;
else if( bps <= 0) format = AFMT_S16_LE;
else format = AFMT_S16_LE;
- 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
@@ -235,14 +235,14 @@ void LoopControl::startAudio() {
long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000;
long sampleWaitTime = currentSample - sampleWeShouldBeAt;
-// 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;
+ }
audioDevice->write( audioBuffer, samplesRead * 2 * channels );
audioSampleCounter = currentSample + samplesRead - 1;
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
@@ -39,7 +39,7 @@
#include <qtabwidget.h>
#include <qlistview.h>
#include <qpoint.h>
-#include <qtimer.h>
+//#include <qtimer.h>
#include "playlistselection.h"
#include "playlistwidget.h"
@@ -98,8 +98,8 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
d = new PlayListWidgetPrivate;
d->setDocumentUsed = FALSE;
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() ) );
setBackgroundMode( PaletteButton );
@@ -204,12 +204,14 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
for ( ; dit.current(); ++dit ) {
QListViewItem * newItem;
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" ));
}
+ }
// videowidget
QWidget *vTab;
@@ -229,12 +231,15 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
QListIterator<DocLnk> Vdit( vFiles.children() );
for ( ; Vdit.current(); ++Vdit ) {
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";
else storage="RAM";
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" ));
}
+ }
// d->tbPlay = new ToolButton( vbox1, tr( "Play" ), "mpegplayer/play", mediaPlayerState, SLOT(setPlaying(bool)), TRUE );
@@ -663,28 +668,28 @@ 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
@@ -24,7 +24,7 @@
#include <qmainwindow.h>
#include <qpe/applnk.h>
#include <qtabwidget.h>
-#include <qtimer.h>
+/* #include <qtimer.h> */
class PlayListWidgetPrivate;
@@ -49,7 +49,7 @@ public:
// retrieve the current playlist entry (media file link)
const DocLnk *current();
void useSelectedDocument();
- QTimer * menuTimer;
+/* QTimer * menuTimer; */
public slots:
void setDocument( const QString& fileref );
@@ -76,8 +76,8 @@ public slots:
/* void setFullScreen(); */
/* void setScaled(); */
protected:
- void contentsMousePressEvent( QMouseEvent * e );
- void contentsMouseReleaseEvent( QMouseEvent * e );
+/* void contentsMousePressEvent( QMouseEvent * e ); */
+/* void contentsMouseReleaseEvent( QMouseEvent * e ); */
private:
void initializeStates();
@@ -86,8 +86,8 @@ private:
PlayListWidgetPrivate *d; // Private implementation data
protected slots:
- void cancelMenuTimer();
- void showFileMenu();
+/* void cancelMenuTimer(); */
+/* void showFileMenu(); */
};