author | skyhusker <skyhusker> | 2005-03-24 16:52:08 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-03-24 16:52:08 (UTC) |
commit | 38ace7e9b3c9665336c0e6d2350895b147858f1f (patch) (unidiff) | |
tree | b82538e70104d8ea179b3364b1d592e7cfb4c650 | |
parent | 76db09fe0448c68496055f5e2b5c672fea1df5df (diff) | |
download | opie-38ace7e9b3c9665336c0e6d2350895b147858f1f.zip opie-38ace7e9b3c9665336c0e6d2350895b147858f1f.tar.gz opie-38ace7e9b3c9665336c0e6d2350895b147858f1f.tar.bz2 |
Keep paused when sliding the progress bar in paused state. Block de audio device only while playing.
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index f1b9773..6ed4cea 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -132,4 +132,5 @@ void Lib::initialize() | |||
132 | 132 | ||
133 | m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); | 133 | m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); |
134 | xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); | ||
134 | 135 | ||
135 | if (m_wid != 0 ) | 136 | if (m_wid != 0 ) |
@@ -203,4 +204,5 @@ void Lib::stop() { | |||
203 | assert( m_initialized ); | 204 | assert( m_initialized ); |
204 | xine_stop( m_stream ); | 205 | xine_stop( m_stream ); |
206 | xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); | ||
205 | } | 207 | } |
206 | 208 | ||
@@ -208,5 +210,12 @@ void Lib::pause( bool toggle ) { | |||
208 | assert( m_initialized ); | 210 | assert( m_initialized ); |
209 | 211 | ||
210 | xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL ); | 212 | if ( toggle ) { |
213 | xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE ); | ||
214 | xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); | ||
215 | } | ||
216 | |||
217 | else { | ||
218 | xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL ); | ||
219 | } | ||
211 | } | 220 | } |
212 | 221 | ||
@@ -283,5 +292,15 @@ void Lib::seekTo( int time ) { | |||
283 | assert( m_initialized ); | 292 | assert( m_initialized ); |
284 | 293 | ||
285 | xine_play( m_stream, 0, time*1000 ); | 294 | odebug << "Seeking to second " << time << oendl; |
295 | //Keep it paused if it was in that state | ||
296 | if ( xine_get_param( m_stream, XINE_PARAM_SPEED ) ) { | ||
297 | xine_play( m_stream, 0, time*1000 ); | ||
298 | } | ||
299 | |||
300 | else { | ||
301 | xine_play( m_stream, 0, time*1000 ); | ||
302 | xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE ); | ||
303 | } | ||
304 | |||
286 | } | 305 | } |
287 | 306 | ||