author | zecke <zecke> | 2004-09-23 22:27:45 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-23 22:27:45 (UTC) |
commit | b33878c73018d91101e828101e632c96d39c1381 (patch) (unidiff) | |
tree | c2606b2b9941e3a80649415207bd2b9be27ba998 | |
parent | 97ab73d99688443d02086b4f00d1de7c81faa3c7 (diff) | |
download | opie-b33878c73018d91101e828101e632c96d39c1381.zip opie-b33878c73018d91101e828101e632c96d39c1381.tar.gz opie-b33878c73018d91101e828101e632c96d39c1381.tar.bz2 |
If you close the Audio-/VideoWidget and the stream was paused
it didn't play on request. Remove the paused state of MediaPlayerState
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index ba4e11a..44bc46b 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -26,233 +26,234 @@ | |||
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 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | #include "mediaplayerstate.h" | 37 | #include "mediaplayerstate.h" |
38 | 38 | ||
39 | #include <assert.h> | 39 | #include <assert.h> |
40 | 40 | ||
41 | #define MediaPlayerDebug(x) | 41 | #define MediaPlayerDebug(x) |
42 | 42 | ||
43 | 43 | ||
44 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) | 44 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) |
45 | : QObject( parent, name ) { | 45 | : QObject( parent, name ) { |
46 | Config cfg( "OpiePlayer" ); | 46 | Config cfg( "OpiePlayer" ); |
47 | readConfig( cfg ); | 47 | readConfig( cfg ); |
48 | streaming = false; | 48 | streaming = false; |
49 | seekable = true; | 49 | seekable = true; |
50 | } | 50 | } |
51 | 51 | ||
52 | 52 | ||
53 | MediaPlayerState::~MediaPlayerState() { | 53 | MediaPlayerState::~MediaPlayerState() { |
54 | } | 54 | } |
55 | 55 | ||
56 | 56 | ||
57 | void MediaPlayerState::readConfig( Config& cfg ) { | 57 | void MediaPlayerState::readConfig( Config& cfg ) { |
58 | cfg.setGroup("Options"); | 58 | cfg.setGroup("Options"); |
59 | fullscreen = cfg.readBoolEntry( "FullScreen" ); | 59 | fullscreen = cfg.readBoolEntry( "FullScreen" ); |
60 | scaled = cfg.readBoolEntry( "Scaling" ); | 60 | scaled = cfg.readBoolEntry( "Scaling" ); |
61 | looping = cfg.readBoolEntry( "Looping" ); | 61 | looping = cfg.readBoolEntry( "Looping" ); |
62 | shuffled = cfg.readBoolEntry( "Shuffle" ); | 62 | shuffled = cfg.readBoolEntry( "Shuffle" ); |
63 | videoGamma = cfg.readNumEntry( "VideoGamma" ); | 63 | videoGamma = cfg.readNumEntry( "VideoGamma" ); |
64 | playing = FALSE; | 64 | playing = FALSE; |
65 | streaming = FALSE; | 65 | streaming = FALSE; |
66 | paused = FALSE; | 66 | paused = FALSE; |
67 | curPosition = 0; | 67 | curPosition = 0; |
68 | curLength = 0; | 68 | curLength = 0; |
69 | m_displayType = MediaSelection; | 69 | m_displayType = MediaSelection; |
70 | } | 70 | } |
71 | 71 | ||
72 | 72 | ||
73 | void MediaPlayerState::writeConfig( Config& cfg ) const { | 73 | void MediaPlayerState::writeConfig( Config& cfg ) const { |
74 | cfg.setGroup( "Options" ); | 74 | cfg.setGroup( "Options" ); |
75 | cfg.writeEntry( "FullScreen", fullscreen ); | 75 | cfg.writeEntry( "FullScreen", fullscreen ); |
76 | cfg.writeEntry( "Scaling", scaled ); | 76 | cfg.writeEntry( "Scaling", scaled ); |
77 | cfg.writeEntry( "Looping", looping ); | 77 | cfg.writeEntry( "Looping", looping ); |
78 | cfg.writeEntry( "Shuffle", shuffled ); | 78 | cfg.writeEntry( "Shuffle", shuffled ); |
79 | cfg.writeEntry( "VideoGamma", videoGamma ); | 79 | cfg.writeEntry( "VideoGamma", videoGamma ); |
80 | } | 80 | } |
81 | 81 | ||
82 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const | 82 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const |
83 | { | 83 | { |
84 | return m_displayType; | 84 | return m_displayType; |
85 | } | 85 | } |
86 | 86 | ||
87 | // slots | 87 | // slots |
88 | void MediaPlayerState::setIsStreaming( bool b ) { | 88 | void MediaPlayerState::setIsStreaming( bool b ) { |
89 | streaming = b; | 89 | streaming = b; |
90 | } | 90 | } |
91 | 91 | ||
92 | void MediaPlayerState::setIsSeekable( bool b ) { | 92 | void MediaPlayerState::setIsSeekable( bool b ) { |
93 | seekable = b; | 93 | seekable = b; |
94 | emit isSeekableToggled(b); | 94 | emit isSeekableToggled(b); |
95 | } | 95 | } |
96 | 96 | ||
97 | 97 | ||
98 | void MediaPlayerState::setFullscreen( bool b ) { | 98 | void MediaPlayerState::setFullscreen( bool b ) { |
99 | if ( fullscreen == b ) { | 99 | if ( fullscreen == b ) { |
100 | return; | 100 | return; |
101 | } | 101 | } |
102 | fullscreen = b; | 102 | fullscreen = b; |
103 | emit fullscreenToggled(b); | 103 | emit fullscreenToggled(b); |
104 | } | 104 | } |
105 | 105 | ||
106 | 106 | ||
107 | void MediaPlayerState::setBlanked( bool b ) { | 107 | void MediaPlayerState::setBlanked( bool b ) { |
108 | if ( blanked == b ) { | 108 | if ( blanked == b ) { |
109 | return; | 109 | return; |
110 | } | 110 | } |
111 | blanked = b; | 111 | blanked = b; |
112 | emit blankToggled(b); | 112 | emit blankToggled(b); |
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
116 | void MediaPlayerState::setScaled( bool b ) { | 116 | void MediaPlayerState::setScaled( bool b ) { |
117 | if ( scaled == b ) { | 117 | if ( scaled == b ) { |
118 | return; | 118 | return; |
119 | } | 119 | } |
120 | scaled = b; | 120 | scaled = b; |
121 | emit scaledToggled(b); | 121 | emit scaledToggled(b); |
122 | } | 122 | } |
123 | 123 | ||
124 | void MediaPlayerState::setLooping( bool b ) { | 124 | void MediaPlayerState::setLooping( bool b ) { |
125 | if ( looping == b ) { | 125 | if ( looping == b ) { |
126 | return; | 126 | return; |
127 | } | 127 | } |
128 | looping = b; | 128 | looping = b; |
129 | emit loopingToggled(b); | 129 | emit loopingToggled(b); |
130 | } | 130 | } |
131 | 131 | ||
132 | void MediaPlayerState::setShuffled( bool b ) { | 132 | void MediaPlayerState::setShuffled( bool b ) { |
133 | if ( shuffled == b ) { | 133 | if ( shuffled == b ) { |
134 | return; | 134 | return; |
135 | } | 135 | } |
136 | shuffled = b; | 136 | shuffled = b; |
137 | emit shuffledToggled(b); | 137 | emit shuffledToggled(b); |
138 | } | 138 | } |
139 | 139 | ||
140 | void MediaPlayerState::setPaused( bool b ) { | 140 | void MediaPlayerState::setPaused( bool b ) { |
141 | if ( paused == b ) { | 141 | if ( paused == b ) { |
142 | paused = FALSE; | 142 | paused = FALSE; |
143 | emit pausedToggled(FALSE); | 143 | emit pausedToggled(FALSE); |
144 | return; | 144 | return; |
145 | } | 145 | } |
146 | paused = b; | 146 | paused = b; |
147 | emit pausedToggled(b); | 147 | emit pausedToggled(b); |
148 | } | 148 | } |
149 | 149 | ||
150 | void MediaPlayerState::setPlaying( bool b ) { | 150 | void MediaPlayerState::setPlaying( bool b ) { |
151 | if ( playing == b ) { | 151 | if ( playing == b ) { |
152 | return; | 152 | return; |
153 | } | 153 | } |
154 | playing = b; | 154 | playing = b; |
155 | stopped = !b; | 155 | stopped = !b; |
156 | emit playingToggled(b); | 156 | emit playingToggled(b); |
157 | } | 157 | } |
158 | 158 | ||
159 | void MediaPlayerState::setStopped( bool b ) { | 159 | void MediaPlayerState::setStopped( bool b ) { |
160 | if ( stopped == b ) { | 160 | if ( stopped == b ) { |
161 | return; | 161 | return; |
162 | } | 162 | } |
163 | stopped = b; | 163 | stopped = b; |
164 | emit stopToggled(b); | 164 | emit stopToggled(b); |
165 | } | 165 | } |
166 | 166 | ||
167 | void MediaPlayerState::setPosition( long p ) { | 167 | void MediaPlayerState::setPosition( long p ) { |
168 | if ( curPosition == p ) { | 168 | if ( curPosition == p ) { |
169 | return; | 169 | return; |
170 | } | 170 | } |
171 | curPosition = p; | 171 | curPosition = p; |
172 | emit positionChanged(p); | 172 | emit positionChanged(p); |
173 | } | 173 | } |
174 | 174 | ||
175 | void MediaPlayerState::updatePosition( long p ){ | 175 | void MediaPlayerState::updatePosition( long p ){ |
176 | if ( curPosition == p ) { | 176 | if ( curPosition == p ) { |
177 | return; | 177 | return; |
178 | } | 178 | } |
179 | curPosition = p; | 179 | curPosition = p; |
180 | emit positionUpdated(p); | 180 | emit positionUpdated(p); |
181 | } | 181 | } |
182 | 182 | ||
183 | void MediaPlayerState::setVideoGamma( int v ){ | 183 | void MediaPlayerState::setVideoGamma( int v ){ |
184 | if ( videoGamma == v ) { | 184 | if ( videoGamma == v ) { |
185 | return; | 185 | return; |
186 | } | 186 | } |
187 | videoGamma = v; | 187 | videoGamma = v; |
188 | emit videoGammaChanged( v ); | 188 | emit videoGammaChanged( v ); |
189 | } | 189 | } |
190 | 190 | ||
191 | void MediaPlayerState::setLength( long l ) { | 191 | void MediaPlayerState::setLength( long l ) { |
192 | if ( curLength == l ) { | 192 | if ( curLength == l ) { |
193 | return; | 193 | return; |
194 | } | 194 | } |
195 | curLength = l; | 195 | curLength = l; |
196 | emit lengthChanged(l); | 196 | emit lengthChanged(l); |
197 | } | 197 | } |
198 | 198 | ||
199 | void MediaPlayerState::setDisplayType( DisplayType displayType ) | 199 | void MediaPlayerState::setDisplayType( DisplayType displayType ) |
200 | { | 200 | { |
201 | if ( m_displayType == displayType ) | 201 | if ( m_displayType == displayType ) |
202 | return; | 202 | return; |
203 | 203 | ||
204 | m_displayType = displayType; | 204 | m_displayType = displayType; |
205 | emit displayTypeChanged( m_displayType ); | 205 | emit displayTypeChanged( m_displayType ); |
206 | } | 206 | } |
207 | 207 | ||
208 | void MediaPlayerState::setPrev(){ | 208 | void MediaPlayerState::setPrev(){ |
209 | emit prev(); | 209 | emit prev(); |
210 | } | 210 | } |
211 | 211 | ||
212 | void MediaPlayerState::setNext() { | 212 | void MediaPlayerState::setNext() { |
213 | emit next(); | 213 | emit next(); |
214 | } | 214 | } |
215 | 215 | ||
216 | void MediaPlayerState::setList() { | 216 | void MediaPlayerState::setList() { |
217 | setPlaying( FALSE ); | 217 | setPlaying( FALSE ); |
218 | paused = false; | ||
218 | setDisplayType( MediaSelection ); | 219 | setDisplayType( MediaSelection ); |
219 | } | 220 | } |
220 | 221 | ||
221 | void MediaPlayerState::setVideo() { | 222 | void MediaPlayerState::setVideo() { |
222 | setDisplayType( Video ); | 223 | setDisplayType( Video ); |
223 | } | 224 | } |
224 | 225 | ||
225 | void MediaPlayerState::setAudio() { | 226 | void MediaPlayerState::setAudio() { |
226 | setDisplayType( Audio ); | 227 | setDisplayType( Audio ); |
227 | } | 228 | } |
228 | 229 | ||
229 | void MediaPlayerState::toggleFullscreen() { | 230 | void MediaPlayerState::toggleFullscreen() { |
230 | setFullscreen( !fullscreen ); | 231 | setFullscreen( !fullscreen ); |
231 | } | 232 | } |
232 | 233 | ||
233 | void MediaPlayerState::toggleScaled() { | 234 | void MediaPlayerState::toggleScaled() { |
234 | setScaled( !scaled); | 235 | setScaled( !scaled); |
235 | } | 236 | } |
236 | 237 | ||
237 | void MediaPlayerState::toggleLooping() { | 238 | void MediaPlayerState::toggleLooping() { |
238 | setLooping( !looping); | 239 | setLooping( !looping); |
239 | } | 240 | } |
240 | 241 | ||
241 | void MediaPlayerState::toggleShuffled() { | 242 | void MediaPlayerState::toggleShuffled() { |
242 | setShuffled( !shuffled); | 243 | setShuffled( !shuffled); |
243 | } | 244 | } |
244 | 245 | ||
245 | void MediaPlayerState::togglePaused() { | 246 | void MediaPlayerState::togglePaused() { |
246 | setPaused( !paused); | 247 | setPaused( !paused); |
247 | } | 248 | } |
248 | 249 | ||
249 | void MediaPlayerState::togglePlaying() { | 250 | void MediaPlayerState::togglePlaying() { |
250 | setPlaying( !playing); | 251 | setPlaying( !playing); |
251 | } | 252 | } |
252 | 253 | ||
253 | void MediaPlayerState::toggleBlank() { | 254 | void MediaPlayerState::toggleBlank() { |
254 | setBlanked( !blanked); | 255 | setBlanked( !blanked); |
255 | } | 256 | } |
256 | 257 | ||
257 | 258 | ||
258 | 259 | ||