[Xfce4-commits] [panel-plugins/xfce4-pulseaudio-plugin] 04/12: Use a common callback for volume and mute change notifications

noreply at xfce.org noreply at xfce.org
Tue Feb 17 00:12:43 CET 2015


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

andrzejr pushed a commit to branch master
in repository panel-plugins/xfce4-pulseaudio-plugin.

commit ba7ea62e16d51f711271d05e635d7d476267d06e
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Wed Apr 30 21:41:52 2014 +0100

    Use a common callback for volume and mute change notifications
---
 panel-plugin/pulseaudio-volume.c |   25 +++++++------------------
 1 file changed, 7 insertions(+), 18 deletions(-)

diff --git a/panel-plugin/pulseaudio-volume.c b/panel-plugin/pulseaudio-volume.c
index 797582f..f505be6 100644
--- a/panel-plugin/pulseaudio-volume.c
+++ b/panel-plugin/pulseaudio-volume.c
@@ -312,12 +312,12 @@ pulseaudio_volume_get_muted (PulseaudioVolume *volume)
 
 
 
-/* muted setting callbacks */
+/* final callback for volume/mute changes */
 /* pa_context_success_cb_t */
 static void
-pulseaudio_volume_set_muted_cb2 (pa_context *context,
-                                 int         success,
-                                 void       *userdata)
+pulseaudio_volume_sink_volume_changed (pa_context *context,
+                                       int         success,
+                                       void       *userdata)
 {
   PulseaudioVolume *volume = PULSEAUDIO_VOLUME (userdata);
 
@@ -325,6 +325,7 @@ pulseaudio_volume_set_muted_cb2 (pa_context *context,
     g_signal_emit (G_OBJECT (volume), pulseaudio_volume_signals [VOLUME_CHANGED], 0);
 }
 
+/* mute setting callbacks */
 /* pa_sink_info_cb_t */
 static void
 pulseaudio_volume_set_muted_cb1 (pa_context         *context,
@@ -335,7 +336,7 @@ pulseaudio_volume_set_muted_cb1 (pa_context         *context,
   PulseaudioVolume *volume = PULSEAUDIO_VOLUME (userdata);
   if (i == NULL) return;
 
-  pa_context_set_sink_mute_by_index (context, i->index, volume->muted, pulseaudio_volume_set_muted_cb2, volume);
+  pa_context_set_sink_mute_by_index (context, i->index, volume->muted, pulseaudio_volume_sink_volume_changed, volume);
 }
 
 
@@ -378,18 +379,6 @@ pulseaudio_volume_get_volume (PulseaudioVolume *volume)
 
 
 /* volume setting callbacks */
-/* pa_context_success_cb_t */
-static void
-pulseaudio_volume_set_volume_cb3 (pa_context *context,
-                                  int         success,
-                                  void       *userdata)
-{
-  PulseaudioVolume *volume = PULSEAUDIO_VOLUME (userdata);
-
-  if (success)
-    g_signal_emit (G_OBJECT (volume), pulseaudio_volume_signals [VOLUME_CHANGED], 0);
-}
-
 /* pa_sink_info_cb_t */
 static void
 pulseaudio_volume_set_volume_cb2 (pa_context         *context,
@@ -404,7 +393,7 @@ pulseaudio_volume_set_volume_cb2 (pa_context         *context,
 
   //g_debug ("*** %s", pa_cvolume_snprint (st, sizeof (st), &i->volume));
   pa_cvolume_set (&i->volume, 1, pulseaudio_volume_d2v (volume->volume));
-  pa_context_set_sink_volume_by_index (context, i->index, &i->volume, pulseaudio_volume_set_volume_cb3, volume);
+  pa_context_set_sink_volume_by_index (context, i->index, &i->volume, pulseaudio_volume_sink_volume_changed, volume);
 }
 
 

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


More information about the Xfce4-commits mailing list