[Xfce4-commits] <parole:bluesabre/gtk3> Add Previous/Next Track to Notify Plugin

Sean Davis noreply at xfce.org
Sun Sep 1 03:58:01 CEST 2013


Updating branch refs/heads/bluesabre/gtk3
         to 6bbe02976885a4578f5ac00735b19734ebddab63 (commit)
       from e297f9073f4112e0d567af1d8ef013607c83e83e (commit)

commit 6bbe02976885a4578f5ac00735b19734ebddab63
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Aug 31 21:56:27 2013 -0400

    Add Previous/Next Track to Notify Plugin

 src/plugins/notify/notify-provider.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/plugins/notify/notify-provider.c b/src/plugins/notify/notify-provider.c
index d04ac19..20da833 100644
--- a/src/plugins/notify/notify-provider.c
+++ b/src/plugins/notify/notify-provider.c
@@ -80,6 +80,18 @@ close_notification (NotifyProvider *notify)
 }
 
 static void
+on_previous_clicked(NotifyNotification *notification, char *action, NotifyProvider *notify)
+{
+    parole_provider_player_play_previous (notify->player);
+}
+
+static void
+on_next_clicked(NotifyNotification *notification, char *action, NotifyProvider *notify)
+{
+    parole_provider_player_play_next (notify->player);
+}
+
+static void
 notify_playing (NotifyProvider *notify, const ParoleStream *stream)
 {
     GdkPixbuf *pix;
@@ -178,6 +190,16 @@ notify_playing (NotifyProvider *notify, const ParoleStream *stream)
     notify_notification_set_urgency (notify->notification, NOTIFY_URGENCY_LOW);
     notify_notification_set_timeout (notify->notification, 5000);
     
+    notify_notification_add_action (notify->notification, 
+                                    "play-previous", _("Previous Track"), 
+                                    NOTIFY_ACTION_CALLBACK(on_previous_clicked),
+                                    notify, NULL);
+
+    notify_notification_add_action (notify->notification, 
+                                    "play-next", _("Next Track"), 
+                                    NOTIFY_ACTION_CALLBACK(on_next_clicked),
+                                    notify, NULL);
+    
     notify_notification_show (notify->notification, NULL);
     g_signal_connect (notify->notification, "closed",
                       G_CALLBACK (notification_closed_cb), notify);


More information about the Xfce4-commits mailing list