-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 7 | ||||
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.h | 20 | ||||
-rw-r--r-- | core/multimedia/opieplayer/loopcontrol.cpp | 18 | ||||
-rw-r--r-- | core/multimedia/opieplayer/mediaplayerstate.h | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 1 |
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 @@ -87,15 +87,18 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : 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() ); 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 @@ -52,20 +52,20 @@ enum AudioButtons { 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 * ) { pos = ( pos + 1 > pixelLen ) ? 0 : pos + 1; @@ -101,9 +101,9 @@ class AudioWidget : public QWidget { 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( ); 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 @@ -235,16 +235,17 @@ void LoopControl::startAudio() { bool readOk=mediaPlayerState->curDecoder()->audioReadSamples( (short*)audioBuffer, channels, 1024, samplesRead, stream ); 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; @@ -431,8 +432,11 @@ 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(); 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 @@ -33,9 +33,9 @@ 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; } 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 @@ -992,8 +992,9 @@ void PlayListWidget::openFile() { // 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); |