[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 125761] kmplayer - need dcop call to determine playback state
From:       Koos Vriezen <koos.vriezen () xs4all ! nl>
Date:       2006-04-17 21:20:36
Message-ID: 20060417212036.23865.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
         
http://bugs.kde.org/show_bug.cgi?id=125761         




------- Additional Comments From koos.vriezen xs4all nl  2006-04-17 23:20 -------
SVN commit 530869 by vriezen:

Adding a isPlaying() dcop call for the backends, that can be used to 
determine actual playing state (false on not playing or paused). Since 
this is a synchronious call, I rather not use it for the KMediaPlayer 
dcop interface (and this would also have a different meaning when 
backend is MPlayer then)

CCBUG: 125761

It ´s better than nothing, so w/
  dcop kxineplayer-pid Backend isPlaying
or
  dcop kgstplayer-pid Backend isPlaying
you could solve it for your case, probably better to do the  ´pause() ´ 
call on KMediaPlayer interface of kmplayer.


 M  +7 -0      gstplayer.cpp  
 M  +1 -0      kmplayer_backend.h  
 M  +8 -0      xineplayer.cpp  
 M  +4 -0      xvplayer.cpp  


--- trunk/extragear/multimedia/kmplayer/src/gstplayer.cpp #530868:530869
 @ -483,6 +483,13  @
         callback->errorMessage (0, err);*/
 }
 
+bool Backend::isPlaying () {
+    mutex.lock ();
+    bool b = gst_elm_play && (GST_STATE (gst_elm_play) == GST_STATE_PLAYING);
+    mutex.unlock ();
+    return b;
+}
+
 KGStreamerPlayer::KGStreamerPlayer (int _argc, char ** _argv)
   : QApplication (_argc, _argv, false) {
 }
--- trunk/extragear/multimedia/kmplayer/src/kmplayer_backend.h #530868:530869
 @ -48,6 +48,7  @
     virtual ASYNC setConfig (QByteArray);
     virtual ASYNC setAudioLang (int, QString);
     virtual ASYNC setSubtitle (int, QString);
+    virtual bool isPlaying ();
 private:
     BackendPrivate * d;
 };
--- trunk/extragear/multimedia/kmplayer/src/xineplayer.cpp #530868:530869
 @ -377,6 +377,14  @
         callback->errorMessage (0, err);
 }
 
+bool Backend::isPlaying () {
+    mutex.lock ();
+    bool b = (xine_get_status (stream) == XINE_STATUS_PLAY) &&
+        (xine_get_param (stream, XINE_PARAM_SPEED) != XINE_SPEED_PAUSE);
+    mutex.unlock ();
+    return b;
+}
+
 KXinePlayer::KXinePlayer (int _argc, char ** _argv)
   : QApplication (_argc, _argv, false) {
 }
--- trunk/extragear/multimedia/kmplayer/src/xvplayer.cpp #530868:530869
 @ -202,6 +202,10  @
         callback->errorMessage (0, err);
 }
 
+bool Backend::isPlaying () {
+    return running;
+}
+
 KXVideoPlayer::KXVideoPlayer (int _argc, char ** _argv)
   : QApplication (_argc, _argv, false) {
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic