pausemusic plugin does not "pause" streams

Stefan dustbln at gmx.de
Tue May 6 15:12:18 UTC 2014


Hi there and first of all thanks for that great piece of software!

When a call comes in and a stream is playing in a MPRIS media player
then "CanPause" is (or at least should be) false and nothing happens. I
made a little patch to stop instead of pause in that case.

---------------------------------------

--- kdeconnect-kde_orig/kded/plugins/pausemusic/pausemusicplugin.cpp
2014-05-06 16:28:43.402933445 +0200
+++ kdeconnect-kde/kded/plugins/pausemusic/pausemusicplugin.cpp
2014-05-06 16:57:18.464049379 +0200
@@ -90,7 +90,11 @@
                     if (status == "Playing") {
                         if (!pausedSources.contains(iface)) {
                             pausedSources.insert(iface);
-                            mprisInterface.asyncCall("Pause");
+                            if
(mprisInterface.property("CanPause").toBool()) {
+                                mprisInterface.asyncCall("Pause");
+                            } else {
+                                mprisInterface.asyncCall("Stop");
+                            }
                         }
                     }
                 }
@@ -108,7 +112,7 @@
                 //mprisInterface->call(QDBus::Block,"Play");
                 //Workaround: Using playpause instead (checking first
if it is already playing)
                 QString status =
mprisInterface.property("PlaybackStatus").toString();
-                if (status == "Paused")
mprisInterface.asyncCall("PlayPause");
+                mprisInterface.asyncCall("PlayPause");
                 //End of workaround
             }
         }

---------------------------------------

Greetings,
Stefan


More information about the KDEConnect mailing list