author | skyhusker <skyhusker> | 2005-03-24 16:52:08 (UTC) |
---|---|---|
committer | skyhusker <skyhusker> | 2005-03-24 16:52:08 (UTC) |
commit | 38ace7e9b3c9665336c0e6d2350895b147858f1f (patch) (side-by-side diff) | |
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 | 21 |
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 @@ -130,8 +130,9 @@ void Lib::initialize() m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this ); m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); + xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); if (m_wid != 0 ) setWidget( m_wid ); @@ -201,14 +202,22 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) { void Lib::stop() { assert( m_initialized ); xine_stop( m_stream ); + xine_set_param( m_stream, XINE_PARAM_AUDIO_CLOSE_DEVICE, 1); } void Lib::pause( bool toggle ) { assert( m_initialized ); - 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 ); + } } int Lib::speed() const { assert( m_initialized ); @@ -281,9 +290,19 @@ bool Lib::isSeekable() const { void Lib::seekTo( int time ) { assert( m_initialized ); + 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 ); + } + } Frame Lib::currentFrame() const { |