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) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/audiowidget.cpp7
-rw-r--r--core/multimedia/opieplayer/audiowidget.h2
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp4
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.h2
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp1
5 files changed, 12 insertions, 4 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
@@ -85,19 +85,22 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) :
slider->setGeometry( QRect( 7, 262, 220, 20 ) );
connect( slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
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() );
setLooping( mediaPlayerState->fullscreen() );
setPaused( mediaPlayerState->paused() );
setPlaying( mediaPlayerState->playing() );
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
@@ -99,13 +99,13 @@ private:
class AudioWidget : public QWidget {
Q_OBJECT
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( );
void sliderReleased( );
void setPaused( bool b) { setToggleButton( AudioPause, b ); }
void setLooping( bool b) { setToggleButton( AudioLoop, b ); }
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
@@ -233,12 +233,13 @@ void LoopControl::startAudio() {
long samplesRead = 0;
bool readOk=mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream );
long sampleWeShouldBeAt = long( playtime.elapsed() ) * freq / 1000;
long sampleWaitTime = currentSample - sampleWeShouldBeAt;
+// 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 );
@@ -429,12 +430,15 @@ 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 ) ) );
audioMutex->unlock();
return TRUE;
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
@@ -31,13 +31,13 @@ class Config;
class MediaPlayerState : public QObject {
Q_OBJECT
public:
MediaPlayerState( QObject *parent, const char *name );
~MediaPlayerState();
-
+ bool isStreaming;
bool fullscreen() { return isFullscreen; }
bool scaled() { return isScaled; }
bool looping() { return isLooping; }
bool shuffled() { return isShuffled; }
bool playlist() { return usePlaylist; }
bool paused() { return isPaused; }
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
@@ -990,12 +990,13 @@ void PlayListWidget::openFile() {
// fileDlg2 = new InputDialog(this,tr("Name"),TRUE, 0);
// fileDlg2->exec();
// if( fileDlg2->result() == 1 ) {
// 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://")
// name= filename.right(filename.length()-filename.find("http://")-7);
// else name = filename;
// qDebug("name is "+name);