[gnome-user-share/gnome-2-28] Implement sound notification on file reception using canberra



commit fdd88d4076ef27232e1e5be63d6ac42c99ddf343
Author: Baptiste Mille-Mathias <baptiste millemathias gmail com>
Date:   Sun Jul 19 12:15:22 2009 +0200

    Implement sound notification on file reception using canberra
    
    https://bugzilla.gnome.org/show_bug.cgi?id=588628

 configure.in   |    2 +-
 src/obexpush.c |    9 +++++++++
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/configure.in b/configure.in
index 573d07e..c16fd62 100644
--- a/configure.in
+++ b/configure.in
@@ -56,7 +56,7 @@ if $have_dbus_1_1 ; then
    AC_DEFINE(HAVE_DBUS_1_1, 1, [Set to true if we have D-BUS 1.1])
 fi
 
-PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.15.2 gio-2.0 gdk-x11-2.0 gtk+-2.0 gconf-2.0 dbus-glib-1 libnotify $DBUS_MODULES gnome-bluetooth-1.0 >= 2.27.7.2)
+PKG_CHECK_MODULES(USER_SHARE, glib-2.0 >= 2.15.2 gio-2.0 gdk-x11-2.0 gtk+-2.0 gconf-2.0 dbus-glib-1 libnotify libcanberra-gtk $DBUS_MODULES gnome-bluetooth-1.0 >= 2.27.7.2)
 AC_SUBST(USER_SHARE_CFLAGS)
 AC_SUBST(USER_SHARE_LIBS)
 
diff --git a/src/obexpush.c b/src/obexpush.c
index b61dac0..f894bd4 100644
--- a/src/obexpush.c
+++ b/src/obexpush.c
@@ -32,6 +32,7 @@
 #include <dbus/dbus-glib.h>
 #include <gconf/gconf-client.h>
 #include <dbus/dbus-glib-lowlevel.h>
+#include <canberra-gtk.h>
 
 #include <string.h>
 
@@ -125,6 +126,7 @@ show_notification (const char *filename)
 {
 	char *file_uri, *notification_text, *display, *mime_type;
 	NotifyNotification *notification;
+	ca_context *ctx;
 	GAppInfo *app;
 
 	file_uri = g_filename_to_uri (filename, NULL, NULL);
@@ -164,6 +166,13 @@ show_notification (const char *filename)
 		g_warning ("failed to send notification\n");
 	}
 	g_free (notification_text);
+
+	/* Now we do the audio notification */
+	ctx = ca_gtk_context_get ();
+	ca_context_play (ctx, 0,
+			 CA_PROP_EVENT_ID, "complete-download",
+			 CA_PROP_EVENT_DESCRIPTION, "File reception complete",
+			 NULL);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]