summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-02 13:47:30 (UTC)
committer simon <simon>2002-12-02 13:47:30 (UTC)
commit62f60ab5bb344ec3a5ac6f2486c460a0f11a9f69 (patch) (unidiff)
tree77d75fb5fa33d1dd064d739c64dc55d0b7fb8999
parent1646c471d8a1f54df65c8d58402bc80af004f498 (diff)
downloadopie-62f60ab5bb344ec3a5ac6f2486c460a0f11a9f69.zip
opie-62f60ab5bb344ec3a5ac6f2486c460a0f11a9f69.tar.gz
opie-62f60ab5bb344ec3a5ac6f2486c460a0f11a9f69.tar.bz2
- made the accessor functions inline
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.cpp57
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayerstate.h26
2 files changed, 13 insertions, 70 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
index 85d9bac..0d21027 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp
@@ -59,121 +59,64 @@ MediaPlayerState::MediaPlayerState( QObject *parent, const char *name )
59MediaPlayerState::~MediaPlayerState() { 59MediaPlayerState::~MediaPlayerState() {
60} 60}
61 61
62 62
63void MediaPlayerState::readConfig( Config& cfg ) { 63void MediaPlayerState::readConfig( Config& cfg ) {
64 cfg.setGroup("Options"); 64 cfg.setGroup("Options");
65 fullscreen = cfg.readBoolEntry( "FullScreen" ); 65 fullscreen = cfg.readBoolEntry( "FullScreen" );
66 scaled = cfg.readBoolEntry( "Scaling" ); 66 scaled = cfg.readBoolEntry( "Scaling" );
67 looping = cfg.readBoolEntry( "Looping" ); 67 looping = cfg.readBoolEntry( "Looping" );
68 shuffled = cfg.readBoolEntry( "Shuffle" ); 68 shuffled = cfg.readBoolEntry( "Shuffle" );
69 usePlaylist = cfg.readBoolEntry( "UsePlayList" ); 69 usePlaylist = cfg.readBoolEntry( "UsePlayList" );
70 videoGamma = cfg.readNumEntry( "VideoGamma" ); 70 videoGamma = cfg.readNumEntry( "VideoGamma" );
71 usePlaylist = TRUE; 71 usePlaylist = TRUE;
72 playing = FALSE; 72 playing = FALSE;
73 streaming = FALSE; 73 streaming = FALSE;
74 paused = FALSE; 74 paused = FALSE;
75 curPosition = 0; 75 curPosition = 0;
76 curLength = 0; 76 curLength = 0;
77 curView = 'l'; 77 curView = 'l';
78} 78}
79 79
80 80
81void MediaPlayerState::writeConfig( Config& cfg ) const { 81void MediaPlayerState::writeConfig( Config& cfg ) const {
82 cfg.setGroup( "Options" ); 82 cfg.setGroup( "Options" );
83 cfg.writeEntry( "FullScreen", fullscreen ); 83 cfg.writeEntry( "FullScreen", fullscreen );
84 cfg.writeEntry( "Scaling", scaled ); 84 cfg.writeEntry( "Scaling", scaled );
85 cfg.writeEntry( "Looping", looping ); 85 cfg.writeEntry( "Looping", looping );
86 cfg.writeEntry( "Shuffle", shuffled ); 86 cfg.writeEntry( "Shuffle", shuffled );
87 cfg.writeEntry( "UsePlayList", usePlaylist ); 87 cfg.writeEntry( "UsePlayList", usePlaylist );
88 cfg.writeEntry( "VideoGamma", videoGamma ); 88 cfg.writeEntry( "VideoGamma", videoGamma );
89} 89}
90 90
91
92// public stuff
93
94
95bool MediaPlayerState::isStreaming() const {
96 return streaming;
97}
98
99bool MediaPlayerState::isSeekable() const {
100 return seekable;
101}
102
103bool MediaPlayerState::isFullscreen() const {
104 return fullscreen;
105}
106
107bool MediaPlayerState::isScaled() const {
108 return scaled;
109}
110
111bool MediaPlayerState::isLooping() const {
112 return looping;
113}
114
115bool MediaPlayerState::isShuffled() const {
116 return shuffled;
117}
118
119
120bool MediaPlayerState::isUsingPlaylist() const {
121 return usePlaylist;
122}
123
124bool MediaPlayerState::isPaused() const {
125 return paused;
126}
127
128bool MediaPlayerState::isPlaying() const {
129 return playing;
130}
131
132bool MediaPlayerState::isStop() const {
133 return stoped;
134}
135
136long MediaPlayerState::position() const {
137 return curPosition;
138}
139
140long MediaPlayerState::length() const {
141 return curLength;
142}
143
144char MediaPlayerState::view() const {
145 return curView;
146}
147
148// slots 91// slots
149void MediaPlayerState::setIsStreaming( bool b ) { 92void MediaPlayerState::setIsStreaming( bool b ) {
150 93
151 if ( streaming == b ) { 94 if ( streaming == b ) {
152 return; 95 return;
153 } 96 }
154 streaming = b; 97 streaming = b;
155} 98}
156 99
157void MediaPlayerState::setIsSeekable( bool b ) { 100void MediaPlayerState::setIsSeekable( bool b ) {
158 101
159 //if ( isSeekable == b ) { 102 //if ( isSeekable == b ) {
160 // return; 103 // return;
161 // } 104 // }
162 seekable = b; 105 seekable = b;
163 emit isSeekableToggled(b); 106 emit isSeekableToggled(b);
164} 107}
165 108
166 109
167void MediaPlayerState::setFullscreen( bool b ) { 110void MediaPlayerState::setFullscreen( bool b ) {
168 if ( fullscreen == b ) { 111 if ( fullscreen == b ) {
169 return; 112 return;
170 } 113 }
171 fullscreen = b; 114 fullscreen = b;
172 emit fullscreenToggled(b); 115 emit fullscreenToggled(b);
173} 116}
174 117
175 118
176void MediaPlayerState::setBlanked( bool b ) { 119void MediaPlayerState::setBlanked( bool b ) {
177 if ( blanked == b ) { 120 if ( blanked == b ) {
178 return; 121 return;
179 } 122 }
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.h b/noncore/multimedia/opieplayer2/mediaplayerstate.h
index 4e837e3..57189dd 100644
--- a/noncore/multimedia/opieplayer2/mediaplayerstate.h
+++ b/noncore/multimedia/opieplayer2/mediaplayerstate.h
@@ -21,77 +21,77 @@
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; General Public License for more 22..}^=.=       =       ; General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = General Public License along with 26  -_. . .   )=.  = General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31 31
32*/ 32*/
33 33
34// this file is based on work by trolltech 34// this file is based on work by trolltech
35 35
36#ifndef MEDIA_PLAYER_STATE_H 36#ifndef MEDIA_PLAYER_STATE_H
37#define MEDIA_PLAYER_STATE_H 37#define MEDIA_PLAYER_STATE_H
38 38
39 39
40#include <qobject.h> 40#include <qobject.h>
41 41
42 42
43class MediaPlayerDecoder; 43class MediaPlayerDecoder;
44class Config; 44class Config;
45 45
46 46
47class MediaPlayerState : public QObject { 47class MediaPlayerState : public QObject {
48Q_OBJECT 48Q_OBJECT
49public: 49public:
50 MediaPlayerState( QObject *parent, const char *name ); 50 MediaPlayerState( QObject *parent, const char *name );
51 ~MediaPlayerState(); 51 ~MediaPlayerState();
52 52
53 bool isStreaming() const; 53 bool isStreaming() const { return streaming; }
54 bool isSeekable() const; 54 bool isSeekable() const { return seekable; }
55 bool isFullscreen() const; 55 bool isFullscreen() const { return fullscreen; }
56 bool isScaled() const; 56 bool isScaled() const { return scaled; }
57 bool isLooping() const; 57 bool isLooping() const { return looping; }
58 bool isShuffled() const; 58 bool isShuffled() const { return shuffled; }
59 bool isUsingPlaylist() const; 59 bool isUsingPlaylist() const { return usePlaylist; }
60 bool isPaused() const; 60 bool isPaused() const { return paused; }
61 bool isPlaying() const; 61 bool isPlaying() const { return playing; }
62 bool isStop() const; 62 bool isStop() const { return stoped; }
63 long position() const; 63 long position() const { return curPosition; }
64 long length() const; 64 long length() const { return curLength; }
65 char view() const; 65 char view() const { return curView; }
66 66
67public slots: 67public slots:
68 void setIsStreaming( bool b ); 68 void setIsStreaming( bool b );
69 void setIsSeekable( bool b ); 69 void setIsSeekable( bool b );
70 void setFullscreen( bool b ); 70 void setFullscreen( bool b );
71 void setScaled( bool b ); 71 void setScaled( bool b );
72 void setLooping( bool b ); 72 void setLooping( bool b );
73 void setShuffled( bool b ); 73 void setShuffled( bool b );
74 void setPlaylist( bool b ); 74 void setPlaylist( bool b );
75 void setPaused( bool b ); 75 void setPaused( bool b );
76 void setPlaying( bool b ); 76 void setPlaying( bool b );
77 void setStop( bool b ); 77 void setStop( bool b );
78 void setPosition( long p ); 78 void setPosition( long p );
79 void updatePosition( long p ); 79 void updatePosition( long p );
80 void setLength( long l ); 80 void setLength( long l );
81 void setView( char v ); 81 void setView( char v );
82 void setBlanked( bool b ); 82 void setBlanked( bool b );
83 void setVideoGamma( int v ); 83 void setVideoGamma( int v );
84 84
85 void setPrev(); 85 void setPrev();
86 void setNext(); 86 void setNext();
87 void setList(); 87 void setList();
88 void setVideo(); 88 void setVideo();
89 void setAudio(); 89 void setAudio();
90 90
91 void toggleFullscreen(); 91 void toggleFullscreen();
92 void toggleScaled(); 92 void toggleScaled();
93 void toggleLooping(); 93 void toggleLooping();
94 void toggleShuffled(); 94 void toggleShuffled();
95 void togglePlaylist(); 95 void togglePlaylist();
96 void togglePaused(); 96 void togglePaused();
97 void togglePlaying(); 97 void togglePlaying();