-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 29 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 8 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 9 |
5 files changed, 42 insertions, 15 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 125fd72..303e56e 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -120,17 +120,17 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : setLength( mediaPlayerState->length() ); setPosition( mediaPlayerState->position() ); setLooping( mediaPlayerState->fullscreen() ); setPaused( mediaPlayerState->paused() ); setPlaying( mediaPlayerState->playing() ); } AudioWidget::~AudioWidget() { - mediaPlayerState->isStreaming = FALSE; + mediaPlayerState->setIsStreaming( FALSE ); for ( int i = 0; i < 3; i++ ) { delete pixmaps[i]; } } static bool audioSliderBeingMoved = FALSE; @@ -156,17 +156,17 @@ void AudioWidget::setPosition( long i ) { void AudioWidget::setLength( long max ) { updateSlider( mediaPlayerState->position(), max ); } void AudioWidget::setView( char view ) { - if (mediaPlayerState->isStreaming) { + if (mediaPlayerState->streaming() ) { if( !slider->isHidden()) slider->hide(); disconnect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); disconnect( mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); } else { // this stops the slider from being moved, thus // does not stop stream when it reaches the end slider->show(); connect( mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp index 0ab0124..38ba08f 100644 --- a/noncore/multimedia/opieplayer2/mediaplayer.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp @@ -70,23 +70,16 @@ void MediaPlayer::setPlaying( bool play ) { const DocLnk *playListCurrent = playList->current(); if ( playListCurrent != NULL ) { currentFile = playListCurrent; } audioUI->setTickerText( currentFile->file( ) ); xineControl->play( currentFile->file() ); - - // alles nicht nötig, xine kümmert sich drum, man muss nur den return andio oder video gui geben - - // Ob auch video 'v' : 'a' - // mediaPlayerState->setView( 'v' ); - - // abspielen starten. } void MediaPlayer::prev() { if ( playList->prev() ) { play(); } else if ( mediaPlayerState->looping() ) { if ( playList->last() ) { diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 3090b08..778cd1e 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -51,16 +51,22 @@ void MediaPlayerState::writeConfig( Config& cfg ) const { cfg.writeEntry("Shuffle", isShuffled ); cfg.writeEntry("UsePlayList", usePlaylist ); } // public stuff + + +bool MediaPlayerState::streaming() { + return isStreaming; +} + bool MediaPlayerState::fullscreen() { return isFullscreen; } bool MediaPlayerState::scaled() { return isScaled; } @@ -80,29 +86,41 @@ bool MediaPlayerState:: playlist() { bool MediaPlayerState::paused() { return isPaused; } bool MediaPlayerState::playing() { return isPlaying; } +bool MediaPlayerState::stop() { + return isStoped; +} + long MediaPlayerState::position() { return curPosition; } long MediaPlayerState::length() { return curLength; } char MediaPlayerState::view() { return curView; } // slots +void MediaPlayerState::setIsStreaming( bool b ) { + if ( isStreaming == b ) { + return; + } + isStreaming = b; +} + + void MediaPlayerState::setFullscreen( bool b ) { if ( isFullscreen == b ) { return; } isFullscreen = b; emit fullscreenToggled(b); } @@ -147,19 +165,28 @@ void MediaPlayerState::setPaused( bool b ) { emit pausedToggled(b); } void MediaPlayerState::setPlaying( bool b ) { if ( isPlaying == b ) { return; } isPlaying = b; + isStoped = !b; emit playingToggled(b); } +void MediaPlayerState::setStop( bool b ) { + if ( isStoped == b ) { + return; + } + isStoped = b; + emit stopToggled(b); +} + void MediaPlayerState::setPosition( long p ) { if ( curPosition == p ) { return; } curPosition = p; emit positionChanged(p); } @@ -203,18 +230,16 @@ void MediaPlayerState::setList() { void MediaPlayerState::setVideo() { setView('v'); } void MediaPlayerState::setAudio() { setView('a'); } - - void MediaPlayerState::toggleFullscreen() { setFullscreen( !isFullscreen ); } void MediaPlayerState::toggleScaled() { setScaled( !isScaled); } diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index dbbb0f2..20e3552 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h @@ -11,36 +11,39 @@ class Config; class MediaPlayerState : public QObject { Q_OBJECT public: MediaPlayerState( QObject *parent, const char *name ); ~MediaPlayerState(); - bool isStreaming; + bool streaming(); bool fullscreen(); bool scaled(); bool looping(); bool shuffled(); bool playlist(); bool paused(); bool playing(); + bool stop(); long position(); long length(); char view(); public slots: + void setIsStreaming( bool b ); void setFullscreen( bool b ); void setScaled( bool b ); void setLooping( bool b ); void setShuffled( bool b ); void setPlaylist( bool b ); void setPaused( bool b ); void setPlaying( bool b ); + void setStop( bool b ); void setPosition( long p ); void updatePosition( long p ); void setLength( long l ); void setView( char v ); void setPrev(); void setNext(); void setList(); @@ -58,32 +61,35 @@ public slots: signals: void fullscreenToggled( bool ); void scaledToggled( bool ); void loopingToggled( bool ); void shuffledToggled( bool ); void playlistToggled( bool ); void pausedToggled( bool ); void playingToggled( bool ); + void stopToggled( bool ); void positionChanged( long ); // When the slider is moved void positionUpdated( long ); // When the media file progresses void lengthChanged( long ); void viewChanged( char ); void prev(); void next(); private: + bool isStreaming; bool isFullscreen; bool isScaled; bool isLooping; bool isShuffled; bool usePlaylist; bool isPaused; bool isPlaying; + bool isStoped; long curPosition; long curLength; char curView; void readConfig( Config& cfg ); void writeConfig( Config& cfg ) const; diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index cda9be2..5b674f8 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -19,25 +19,28 @@ XineControl::~XineControl() { } void XineControl::play( const QString& fileName ) { libXine->play( fileName ); mediaPlayerState->setPlaying( true ); // default to audio view until we know how to handle video mediaPlayerState->setView('a'); // determines of slider is shown - mediaPlayerState->isStreaming = false; + // mediaPlayerState->setIsStreaming( false ); // hier dann schaun welcher view } void XineControl::stop( bool isSet ) { - if ( isSet) { + if ( !isSet) { libXine->stop(); + mediaPlayerState->setNext(); + //mediaPlayerState->setPlaying( false ); + } else { + // play again } - // mediaPlayerState->setPlaying( false ); } void XineControl::pause( bool isSet) { libXine->pause(); } int XineControl::currentTime() { |