summaryrefslogtreecommitdiff
authorskyhusker <skyhusker>2005-03-24 16:52:08 (UTC)
committer skyhusker <skyhusker>2005-03-24 16:52:08 (UTC)
commit38ace7e9b3c9665336c0e6d2350895b147858f1f (patch) (side-by-side diff)
treeb82538e70104d8ea179b3364b1d592e7cfb4c650
parent76db09fe0448c68496055f5e2b5c672fea1df5df (diff)
downloadopie-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.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp21
1 files changed, 20 insertions, 1 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
@@ -133,2 +133,3 @@ void Lib::initialize()
m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput );
+ xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1);
@@ -204,2 +205,3 @@ void Lib::stop() {
xine_stop( m_stream );
+ xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1);
}
@@ -209,3 +211,10 @@ void Lib::pause( bool toggle ) {
- xine_set_param( m_stream, XINE_PARAM_SPEED, toggle ? XINE_SPEED_PAUSE : XINE_SPEED_NORMAL );
+ if ( toggle ) {
+ xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE );
+ xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1);
+ }
+
+ else {
+ xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL );
+ }
}
@@ -284,3 +293,13 @@ void Lib::seekTo( int time ) {
+ odebug << "Seeking to second " << time << oendl;
+ //Keep it paused if it was in that state
+ if ( xine_get_param( m_stream, XINE_PARAM_SPEED ) ) {
+ xine_play( m_stream, 0, time*1000 );
+ }
+
+ else {
xine_play( m_stream, 0, time*1000 );
+ xine_set_param( m_stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE );
+ }
+
}