author | simon <simon> | 2002-12-02 13:46:23 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 13:46:23 (UTC) |
commit | b992707037f3bbf4573c52b34b3d25cbbf07bad0 (patch) (side-by-side diff) | |
tree | b5a5866cda4b3e059001e3159cdae374777d4a72 | |
parent | 6e883bf60ea91cc6b0624c7307edc27ea3db291b (diff) | |
download | opie-b992707037f3bbf4573c52b34b3d25cbbf07bad0.zip opie-b992707037f3bbf4573c52b34b3d25cbbf07bad0.tar.gz opie-b992707037f3bbf4573c52b34b3d25cbbf07bad0.tar.bz2 |
- made the accessor functions constant
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 26 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.h | 26 |
2 files changed, 26 insertions, 26 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 0b33dfd..a80d8fd 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -1,240 +1,240 @@ /* This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: 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 #include <qpe/qpeapplication.h> #include <qpe/qlibrary.h> #include <qpe/config.h> #include <qvaluelist.h> #include <qobject.h> #include <qdir.h> #include "mediaplayerstate.h" //#define MediaPlayerDebug(x) qDebug x #define MediaPlayerDebug(x) MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) : QObject( parent, name ) { Config cfg( "OpiePlayer" ); readConfig( cfg ); isStreaming = false; isSeekable = true; } MediaPlayerState::~MediaPlayerState() { } void MediaPlayerState::readConfig( Config& cfg ) { cfg.setGroup("Options"); isFullscreen = cfg.readBoolEntry( "FullScreen" ); isScaled = cfg.readBoolEntry( "Scaling" ); isLooping = cfg.readBoolEntry( "Looping" ); isShuffled = cfg.readBoolEntry( "Shuffle" ); usePlaylist = cfg.readBoolEntry( "UsePlayList" ); videoGamma = cfg.readNumEntry( "VideoGamma" ); usePlaylist = TRUE; isPlaying = FALSE; isStreaming = FALSE; isPaused = FALSE; curPosition = 0; curLength = 0; curView = 'l'; } void MediaPlayerState::writeConfig( Config& cfg ) const { cfg.setGroup( "Options" ); cfg.writeEntry( "FullScreen", isFullscreen ); cfg.writeEntry( "Scaling", isScaled ); cfg.writeEntry( "Looping", isLooping ); cfg.writeEntry( "Shuffle", isShuffled ); cfg.writeEntry( "UsePlayList", usePlaylist ); cfg.writeEntry( "VideoGamma", videoGamma ); } // public stuff -bool MediaPlayerState::streaming() { +bool MediaPlayerState::streaming() const { return isStreaming; } -bool MediaPlayerState::seekable() { +bool MediaPlayerState::seekable() const { return isSeekable; } -bool MediaPlayerState::fullscreen() { +bool MediaPlayerState::fullscreen() const { return isFullscreen; } -bool MediaPlayerState::scaled() { +bool MediaPlayerState::scaled() const { return isScaled; } -bool MediaPlayerState::looping() { +bool MediaPlayerState::looping() const { return isLooping; } -bool MediaPlayerState::shuffled() { +bool MediaPlayerState::shuffled() const { return isShuffled; } -bool MediaPlayerState::playlist() { +bool MediaPlayerState::playlist() const { return usePlaylist; } -bool MediaPlayerState::paused() { +bool MediaPlayerState::paused() const { return isPaused; } -bool MediaPlayerState::playing() { +bool MediaPlayerState::playing() const { return isPlaying; } -bool MediaPlayerState::stop() { +bool MediaPlayerState::stop() const { return isStoped; } -long MediaPlayerState::position() { +long MediaPlayerState::position() const { return curPosition; } -long MediaPlayerState::length() { +long MediaPlayerState::length() const { return curLength; } -char MediaPlayerState::view() { +char MediaPlayerState::view() const { return curView; } // slots void MediaPlayerState::setIsStreaming( bool b ) { if ( isStreaming == b ) { return; } isStreaming = b; } void MediaPlayerState::setIsSeekable( bool b ) { //if ( isSeekable == b ) { // return; // } isSeekable = b; emit isSeekableToggled(b); } void MediaPlayerState::setFullscreen( bool b ) { if ( isFullscreen == b ) { return; } isFullscreen = b; emit fullscreenToggled(b); } void MediaPlayerState::setBlanked( bool b ) { if ( isBlanked == b ) { return; } isBlanked = b; emit blankToggled(b); } void MediaPlayerState::setScaled( bool b ) { if ( isScaled == b ) { return; } isScaled = b; emit scaledToggled(b); } void MediaPlayerState::setLooping( bool b ) { if ( isLooping == b ) { return; } isLooping = b; emit loopingToggled(b); } void MediaPlayerState::setShuffled( bool b ) { if ( isShuffled == b ) { return; } isShuffled = b; emit shuffledToggled(b); } void MediaPlayerState::setPlaylist( bool b ) { if ( usePlaylist == b ) { return; } usePlaylist = b; emit playlistToggled(b); } void MediaPlayerState::setPaused( bool b ) { if ( isPaused == b ) { isPaused = FALSE; emit pausedToggled(FALSE); return; } isPaused = 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; diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h index 154e3b0..f9c1eeb 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.h +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h @@ -1,143 +1,143 @@ /* This file is part of the Opie Project Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> Copyright (c) 2002 L. Potter <ljp@llornkcor.com> Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> =. .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: 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 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(); + bool streaming() const; + bool seekable() const; + bool fullscreen() const; + bool scaled() const; + bool looping() const; + bool shuffled() const; + bool playlist() const; + bool paused() const; + bool playing() const; + bool stop() const; + long position() const; + long length() const; + char view() const; 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 ); void setPrev(); void setNext(); void setList(); void setVideo(); void setAudio(); void toggleFullscreen(); void toggleScaled(); void toggleLooping(); void toggleShuffled(); void togglePlaylist(); void togglePaused(); void togglePlaying(); 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 |