[Xfce4-commits] [panel-plugins/xfce4-pulseaudio-plugin] 01/01: Fix multiple launches of same player

noreply at xfce.org noreply at xfce.org
Tue Aug 29 00:28:42 CEST 2017


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-pulseaudio-plugin.

commit c7c21621bed099f070b616535b23c274e3bb4248
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Mon Aug 28 18:28:37 2017 -0400

    Fix multiple launches of same player
---
 panel-plugin/pulseaudio-menu.c  | 8 ++++++--
 panel-plugin/pulseaudio-mpris.c | 3 +++
 panel-plugin/pulseaudio-mpris.h | 1 +
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/pulseaudio-menu.c b/panel-plugin/pulseaudio-menu.c
index 3f0982d..496c563 100644
--- a/panel-plugin/pulseaudio-menu.c
+++ b/panel-plugin/pulseaudio-menu.c
@@ -306,6 +306,7 @@ mpris_update_cb (PulseaudioMpris *mpris,
 
   gchar          *title;
   gchar          *artist;
+  gboolean        is_running;
   gboolean        is_playing;
   gboolean        is_stopped;
   gboolean        can_play;
@@ -328,6 +329,7 @@ mpris_update_cb (PulseaudioMpris *mpris,
                                                   player,
                                                   &title,
                                                   &artist,
+                                                  &is_running,
                                                   &is_playing,
                                                   &is_stopped,
                                                   &can_play,
@@ -336,7 +338,7 @@ mpris_update_cb (PulseaudioMpris *mpris,
                                                   &can_go_next,
                                                   &can_raise))
           {
-            mpris_menu_item_set_is_running (menu_item, TRUE);
+            mpris_menu_item_set_is_running (menu_item, is_running);
             mpris_menu_item_set_title (menu_item, title);
             mpris_menu_item_set_artist (menu_item, artist);
 
@@ -384,6 +386,7 @@ pulseaudio_menu_new (PulseaudioVolume *volume,
 
   gchar          *title = NULL;
   gchar          *artist = NULL;
+  gboolean        is_running;
   gboolean        is_playing;
   gboolean        is_stopped;
   gboolean        can_play;
@@ -478,6 +481,7 @@ pulseaudio_menu_new (PulseaudioVolume *volume,
                                                         players[i],
                                                         &title,
                                                         &artist,
+                                                        &is_running,
                                                         &is_playing,
                                                         &is_stopped,
                                                         &can_play,
@@ -486,7 +490,7 @@ pulseaudio_menu_new (PulseaudioVolume *volume,
                                                         &can_go_next,
                                                         &can_raise))
                 {
-                  mpris_menu_item_set_is_running (MPRIS_MENU_ITEM (mi), TRUE);
+                  mpris_menu_item_set_is_running (MPRIS_MENU_ITEM (mi), is_running);
                   mpris_menu_item_set_title (MPRIS_MENU_ITEM (mi), title);
                   mpris_menu_item_set_artist (MPRIS_MENU_ITEM (mi), artist);
 
diff --git a/panel-plugin/pulseaudio-mpris.c b/panel-plugin/pulseaudio-mpris.c
index 4ceac95..7a543fb 100644
--- a/panel-plugin/pulseaudio-mpris.c
+++ b/panel-plugin/pulseaudio-mpris.c
@@ -190,6 +190,7 @@ pulseaudio_mpris_get_player_snapshot (PulseaudioMpris  *mpris,
                                       const gchar      *name,
                                       gchar           **title,
                                       gchar           **artist,
+                                      gboolean         *is_running,
                                       gboolean         *is_playing,
                                       gboolean         *is_stopped,
                                       gboolean         *can_play,
@@ -208,6 +209,7 @@ pulseaudio_mpris_get_player_snapshot (PulseaudioMpris  *mpris,
           *title = g_strdup(pulseaudio_mpris_player_get_title (player));
           *artist = g_strdup(pulseaudio_mpris_player_get_artist (player));
 
+          *is_running         = TRUE;
           *is_playing         = pulseaudio_mpris_player_is_playing (player);
           *is_stopped         = pulseaudio_mpris_player_is_stopped (player);
           *can_play           = pulseaudio_mpris_player_can_play (player);
@@ -221,6 +223,7 @@ pulseaudio_mpris_get_player_snapshot (PulseaudioMpris  *mpris,
           *title = g_strdup(pulseaudio_mpris_player_get_player_title (player));
           *artist = g_strdup("Not currently playing");
 
+          *is_running         = FALSE;
           *is_playing         = FALSE;
           *is_stopped         = TRUE;
           *can_play           = FALSE;
diff --git a/panel-plugin/pulseaudio-mpris.h b/panel-plugin/pulseaudio-mpris.h
index c3aeabc..a059f6d 100644
--- a/panel-plugin/pulseaudio-mpris.h
+++ b/panel-plugin/pulseaudio-mpris.h
@@ -45,6 +45,7 @@ gboolean                pulseaudio_mpris_get_player_snapshot   (PulseaudioMpris
                                                                 const gchar      *name,
                                                                 gchar           **title,
                                                                 gchar           **artist,
+                                                                gboolean         *is_running,
                                                                 gboolean         *is_playing,
                                                                 gboolean         *is_stopped,
                                                                 gboolean         *can_play,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list