summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-21 03:26:09 (UTC)
committer llornkcor <llornkcor>2002-04-21 03:26:09 (UTC)
commit6818807a46b80774de328b4c3001d4bc9d788666 (patch) (side-by-side diff)
tree1bede7ebbb324058b664330abf481f7afb25eb73
parent1c459273c0e9e387fd5fe2e2c05bef4db5bce115 (diff)
downloadopie-6818807a46b80774de328b4c3001d4bc9d788666.zip
opie-6818807a46b80774de328b4c3001d4bc9d788666.tar.gz
opie-6818807a46b80774de328b4c3001d4bc9d788666.tar.bz2
fixed when playing stream, slider moved and stopped stream when it reached the end
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp7
-rw-r--r--core/multimedia/opieplayer/audiowidget.h20
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp18
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.h2
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp1
5 files changed, 28 insertions, 20 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp
index 3212001..20345b7 100644
--- a/core/multimedia/opieplayer/audiowidget.cpp
+++ b/core/multimedia/opieplayer/audiowidget.cpp
@@ -88,13 +88,16 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
connect( slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
connect( mediaPlayerState, SIGNAL( lengthChanged(long) ), this, SLOT( setLength(long) ) );
- connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
- connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
connect( mediaPlayerState, SIGNAL( viewChanged(char) ), this, SLOT( setView(char) ) );
connect( mediaPlayerState, SIGNAL( loopingToggled(bool) ), this, SLOT( setLooping(bool) ) );
connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) );
connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) );
+ if( !mediaPlayerState->isStreaming) { // this stops the slider from being moved, thus
+ // does not stop stream when it reaches the end
+ connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
+ connect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
+ }
// Intialise state
setLength( mediaPlayerState->length() );
setPosition( mediaPlayerState->position() );
diff --git a/core/multimedia/opieplayer/audiowidget.h b/core/multimedia/opieplayer/audiowidget.h
index d1d72b6..4ffd167 100644
--- a/core/multimedia/opieplayer/audiowidget.h
+++ b/core/multimedia/opieplayer/audiowidget.h
@@ -53,18 +53,18 @@ class Ticker : public QFrame {
Q_OBJECT
public:
Ticker( QWidget* parent=0 ) : QFrame( parent ) {
- setFrameStyle( WinPanel | Sunken );
- setText( "No Song" );
+ setFrameStyle( WinPanel | Sunken );
+ setText( "No Song" );
}
~Ticker() { }
void setText( const QString& text ) {
- pos = 0; // reset it everytime the text is changed
- scrollText = text;
- pixelLen = fontMetrics().width( scrollText );
- killTimers();
- if ( pixelLen > width() )
- startTimer( 50 );
- update();
+ pos = 0; // reset it everytime the text is changed
+ scrollText = text;
+ pixelLen = fontMetrics().width( scrollText );
+ killTimers();
+ if ( pixelLen > width() )
+ startTimer( 50 );
+ update();
}
protected:
void timerEvent( QTimerEvent * ) {
@@ -102,7 +102,7 @@ public:
AudioWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
~AudioWidget();
void setTickerText( const QString &text ) { songInfo->setText( text ); }
-
+ bool isStreaming;
public slots:
void updateSlider( long, long );
void sliderPressed( );
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp
index b9f96de..45c2d3e 100644
--- a/core/multimedia/opieplayer/loopcontrol.cpp
+++ b/core/multimedia/opieplayer/loopcontrol.cpp
@@ -236,14 +236,15 @@ void LoopControl::startAudio() {
long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000;
long sampleWaitTime = currentSample - sampleWeShouldBeAt;
-// if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) {
-// usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) );
+// this causes drop outs not sure why its even here
+// 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;
// }
-// 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;
@@ -432,6 +433,9 @@ bool LoopControl::init( const QString& filename ) {
current_frame = 0;
prev_frame = -1;
+ if( fileName.left(7) == "http://")
+ mediaPlayerState->isStreaming = TRUE;
+
connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( setPosition( long ) ) );
connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( setPaused( bool ) ) );
diff --git a/core/multimedia/opieplayer/mediaplayerstate.h b/core/multimedia/opieplayer/mediaplayerstate.h
index ad273f1..06c5556 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.h
+++ b/core/multimedia/opieplayer/mediaplayerstate.h
@@ -34,7 +34,7 @@ public:
MediaPlayerState( QObject *parent, const char *name );
~MediaPlayerState();
-
+ bool isStreaming;
bool fullscreen() { return isFullscreen; }
bool scaled() { return isScaled; }
bool looping() { return isLooping; }
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index 250645c..ff156f8 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -993,6 +993,7 @@ void PlayListWidget::openFile() {
// name = fileDlg2->LineEdit1->text();
// }
//http://205.188.234.129:8030
+// http://66.28.68.70:8000
qDebug(filename);
DocLnk lnk;
// if(filename.left(7) == "http://")