author | simon <simon> | 2002-12-02 13:45:55 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 13:45:55 (UTC) |
commit | 6e883bf60ea91cc6b0624c7307edc27ea3db291b (patch) (side-by-side diff) | |
tree | b07c9f35a0f8aa2693d19496e24bf0f577e98d28 | |
parent | fcee8216cade787e0099c0aa43a5b8f90b24a85b (diff) | |
download | opie-6e883bf60ea91cc6b0624c7307edc27ea3db291b.zip opie-6e883bf60ea91cc6b0624c7307edc27ea3db291b.tar.gz opie-6e883bf60ea91cc6b0624c7307edc27ea3db291b.tar.bz2 |
- made isPaused, isPlaying and isStopped private member variables
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 4 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/xinecontrol.cpp | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 6ccf206..a52319b 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -402,68 +402,68 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { && imgButtonMask->pixelIndex( x, y ) == i + 1 ); if ( isOnButton && !audioButtons[i].isHeld ) { audioButtons[i].isHeld = TRUE; toggleButton(i); switch (i) { case AudioVolumeUp: emit moreClicked(); return; case AudioVolumeDown: emit lessClicked(); return; case AudioForward: emit forwardClicked(); return; case AudioBack: emit backClicked(); return; } } else if ( !isOnButton && audioButtons[i].isHeld ) { audioButtons[i].isHeld = FALSE; toggleButton(i); } } else { if ( audioButtons[i].isHeld ) { audioButtons[i].isHeld = FALSE; if ( !audioButtons[i].isToggle ) { setToggleButton( i, FALSE ); } qDebug("mouseEvent %d", i); switch (i) { case AudioPlay: - if( mediaPlayerState->isPaused ) { + if( mediaPlayerState->paused() ) { mediaPlayerState->setPaused( FALSE ); return; - } else if( !mediaPlayerState->isPaused ) { + } else if( !mediaPlayerState->paused() ) { mediaPlayerState->setPaused( TRUE ); return; } case AudioStop: mediaPlayerState->setPlaying(FALSE); return; case AudioNext: if( playList->whichList() ==0 ) mediaPlayerState->setNext(); return; case AudioPrevious: if( playList->whichList() ==0 ) mediaPlayerState->setPrev(); return; case AudioLoop: mediaPlayerState->setLooping(audioButtons[i].isDown); return; case AudioVolumeUp: emit moreReleased(); return; case AudioVolumeDown: emit lessReleased(); return; case AudioPlayList: mediaPlayerState->setList(); return; case AudioForward: emit forwardReleased(); return; case AudioBack: emit backReleased(); return; } } } } } void AudioWidget::mousePressEvent( QMouseEvent *event ) { mouseMoveEvent( event ); } void AudioWidget::mouseReleaseEvent( QMouseEvent *event ) { mouseMoveEvent( event ); } void AudioWidget::showEvent( QShowEvent* ) { QMouseEvent event( QEvent::MouseMove, QPoint( 0, 0 ), 0, 0 ); mouseMoveEvent( &event ); diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index 8c4e09e..154e3b0 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h @@ -21,67 +21,64 @@ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // this file is based on work by trolltech #ifndef MEDIA_PLAYER_STATE_H #define MEDIA_PLAYER_STATE_H #include <qobject.h> class MediaPlayerDecoder; class Config; class MediaPlayerState : public QObject { Q_OBJECT public: MediaPlayerState( QObject *parent, const char *name ); ~MediaPlayerState(); - bool isPaused; - bool isPlaying; - bool isStoped; bool streaming(); bool seekable(); 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 setIsSeekable( 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 setBlanked( bool b ); void setVideoGamma( int v ); @@ -101,43 +98,46 @@ public slots: void toggleBlank(); void writeConfig( Config& cfg ) const; 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 isSeekableToggled( bool ); void blankToggled( bool ); void videoGammaChanged( int ); void prev(); void next(); private: bool isStreaming; bool isSeekable; bool isFullscreen; bool isScaled; bool isBlanked; bool isLooping; bool isShuffled; bool usePlaylist; + bool isPaused; + bool isPlaying; + bool isStoped; long curPosition; long curLength; char curView; int videoGamma; void readConfig( Config& cfg ); }; #endif // MEDIA_PLAYER_STATE_H diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index c643273..3a757f0 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -298,69 +298,69 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() && y < imgButtonMask->height() && imgButtonMask->pixelIndex( x, y ) == i + 1 ); if ( isOnButton && !videoButtons[i].isHeld ) { videoButtons[i].isHeld = TRUE; toggleButton(i); switch (i) { case VideoVolUp: emit moreClicked(); return; case VideoVolDown: emit lessClicked(); return; } } else if ( !isOnButton && videoButtons[i].isHeld ) { videoButtons[i].isHeld = FALSE; toggleButton(i); } } else { if ( videoButtons[i].isHeld ) { videoButtons[i].isHeld = FALSE; if ( !videoButtons[i].isToggle ) { setToggleButton( i, FALSE ); } switch(i) { case VideoPlay: { - if( mediaPlayerState->isPaused ) { + if( mediaPlayerState->paused() ) { setToggleButton( i, FALSE ); mediaPlayerState->setPaused( FALSE ); return; - } else if( !mediaPlayerState->isPaused ) { + } else if( !mediaPlayerState->paused() ) { setToggleButton( i, TRUE ); mediaPlayerState->setPaused( TRUE ); return; } else { return; } } case VideoStop: mediaPlayerState->setPlaying( FALSE ); return; case VideoNext: if(playList->whichList() ==0) mediaPlayerState->setNext(); return; case VideoPrevious: if(playList->whichList() ==0) mediaPlayerState->setPrev(); return; case VideoVolUp: emit moreReleased(); return; case VideoVolDown: emit lessReleased(); return; case VideoFullscreen: mediaPlayerState->setFullscreen( TRUE ); makeVisible(); return; } } } } } void VideoWidget::mousePressEvent( QMouseEvent *event ) { mouseMoveEvent( event ); } void VideoWidget::mouseReleaseEvent( QMouseEvent *event ) { if ( mediaPlayerState->fullscreen() ) { mediaPlayerState->setFullscreen( FALSE ); makeVisible(); } mouseMoveEvent( event ); } diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp index c46994a..f6289d7 100644 --- a/noncore/multimedia/opieplayer2/xinecontrol.cpp +++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp @@ -151,65 +151,65 @@ void XineControl::pause( bool isSet) { } } /** * get current time in playback */ long XineControl::currentTime() { // todo: jede sekunde überprüfen m_currentTime = libXine->currentTime(); return m_currentTime; QTimer::singleShot( 1000, this, SLOT( currentTime() ) ); } /** * Set the length of the media file */ void XineControl::length() { m_length = libXine->length(); mediaPlayerState->setLength( m_length ); } /** * Reports the position the xine backend is at right now * @return long the postion in seconds */ long XineControl::position() { m_position = ( currentTime() ); mediaPlayerState->updatePosition( m_position ); long emitPos = (long)m_position; emit positionChanged( emitPos ); - if( mediaPlayerState->isPlaying ) { + if( mediaPlayerState->playing() ) { // needs to be stopped the media is stopped QTimer::singleShot( 1000, this, SLOT( position() ) ); } // qDebug("POSITION : %d", m_position); return m_position; } /** * Set videoplayback to fullscreen * @param isSet */ void XineControl::setFullscreen( bool isSet ) { libXine->showVideoFullScreen( isSet ); } QString XineControl::getMetaInfo() { QString returnString; if ( !libXine->metaInfo( 0 ).isEmpty() ) { returnString += tr( " Title: " + libXine->metaInfo( 0 ) ); } if ( !libXine->metaInfo( 1 ).isEmpty() ) { returnString += tr( " Comment: " + libXine->metaInfo( 1 ) ); } if ( !libXine->metaInfo( 2 ).isEmpty() ) { returnString += tr( " Artist: " + libXine->metaInfo( 2 ) ); } |