[brasero] Play 'complete-media-burn' event sound when finished burning CD



commit 51e5d32f47ede4b4ebe62e5fe43f099aea67d9f9
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Thu Sep 17 21:13:08 2009 +0200

    Play 'complete-media-burn' event sound when finished burning CD
    
    Patch by Lennart Poettering <lennart poettering net>
    
    This patch simply calls ca_gtk_play_for_widget() on the burn dialog when
    a CD finished burning. Depending on the sound theme used this should
    trigger a nice completion sound (currently a 'bing' like from a
    microwave in the upstream sound-theme-freedesktop).

 README                                |    1 +
 configure.in                          |    8 ++++++++
 libbrasero-burn/Makefile.am           |    6 ++++--
 libbrasero-burn/brasero-burn-dialog.c |   11 ++++++++++-
 4 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/README b/README
index d63cccb..2e6ab9a 100644
--- a/README
+++ b/README
@@ -72,6 +72,7 @@ Requirements:
 - growisofs
 - a fairly new kernel (>= 2.6.13 because of inotify) (optional)
 - cairo
+- libcanberra
 - totem (>= 2.20) (optional)
 - beagle (>= 0.3.0) (optional)
 - libburn (>=0.4.0) (optional)
diff --git a/configure.in b/configure.in
index 9b44389..41b8df0 100644
--- a/configure.in
+++ b/configure.in
@@ -141,6 +141,7 @@ GSTREAMER_BASE_REQUIRED=0.10.0
 LIBXML2_REQUIRED=2.6.0
 LIBUNIQUE_REQUIRED=1.0.0
 DBUS_REQUIRED=0.7.2
+CANBERRA_REQUIRED=0.1
 
 GTK_DOC_CHECK([1.3])
 GNOME_DOC_INIT
@@ -223,6 +224,13 @@ PKG_CHECK_MODULES(BRASERO_SM,			\
 AC_SUBST(BRASERO_SM_CFLAGS)
 AC_SUBST(BRASERO_SM_LIBS)
 
+PKG_CHECK_MODULES(BRASERO_CANBERRA,		\
+	libcanberra >= $CANBERRA_REQUIRED       \
+	libcanberra-gtk >= $CANBERRA_REQUIRED)
+
+AC_SUBST(BRASERO_CANBERRA_CFLAGS)
+AC_SUBST(BRASERO_CANBERRA_LIBS)
+
 dnl ****************Nautilus**********************************
 NAUTILUS_REQUIRED=2.22.2
 
diff --git a/libbrasero-burn/Makefile.am b/libbrasero-burn/Makefile.am
index 868ea53..5322ff9 100644
--- a/libbrasero-burn/Makefile.am
+++ b/libbrasero-burn/Makefile.am
@@ -18,7 +18,8 @@ INCLUDES = \
 	$(BRASERO_GIO_CFLAGS)						\
 	$(BRASERO_GTK_CFLAGS)						\
 	$(BRASERO_GSTREAMER_CFLAGS)					\
-	$(BRASERO_DBUS_CFLAGS)
+	$(BRASERO_DBUS_CFLAGS)                                          \
+	$(BRASERO_CANBERRA_CFLAGS)
 
 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
 RECMARSHALFILES = libbrasero-marshal.h libbrasero-marshal.c
@@ -67,7 +68,8 @@ libbrasero_burn_la_LIBADD =					\
 	$(BRASERO_GCONF_LIBS)					\
 	$(BRASERO_GTK_LIBS)					\
 	$(BRASERO_GSTREAMER_LIBS)	\
-	$(BRASERO_DBUS_LIBS)
+	$(BRASERO_DBUS_LIBS)                                    \
+	$(BRASERO_CANBERRA_LIBS)
 
 libbrasero_burn_la_LDFLAGS =					\
 	-version-info $(LIBBRASERO_LT_VERSION)			\
diff --git a/libbrasero-burn/brasero-burn-dialog.c b/libbrasero-burn/brasero-burn-dialog.c
index 72e8081..c123112 100644
--- a/libbrasero-burn/brasero-burn-dialog.c
+++ b/libbrasero-burn/brasero-burn-dialog.c
@@ -44,6 +44,8 @@
 
 #include <gtk/gtk.h>
 
+#include <canberra-gtk.h>
+
 #include "brasero-tray.h"
 #include "brasero-burn-dialog.h"
 #include "brasero-session-cfg.h"
@@ -1898,7 +1900,6 @@ brasero_burn_dialog_notify_success (BraseroBurnDialog *dialog)
 
 	primary = brasero_burn_dialog_get_success_message (dialog);
 	brasero_burn_dialog_activity_stop (dialog, primary);
-	g_free (primary);
 
 	/* Don't show the "Make Another Copy" button if:
 	 * - we wrote to a file
@@ -1940,6 +1941,14 @@ brasero_burn_dialog_notify_success (BraseroBurnDialog *dialog)
 						      GTK_RESPONSE_CLOSE);
 	}
 
+	gtk_widget_show(GTK_WIDGET(dialog));
+	ca_gtk_play_for_widget(GTK_WIDGET(dialog), 0,
+			       CA_PROP_EVENT_ID, "complete-media-burn",
+			       CA_PROP_EVENT_DESCRIPTION, primary,
+			       NULL);
+
+	g_free (primary);
+
 	res = brasero_burn_dialog_success_run (dialog);
 
 	if (make_another)



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