[cheese] play a sound when taking a photo



commit 9487826de5b74ed124113d97936e321b47aaf033
Author: daniel g. siegel <dgsiegel gnome org>
Date:   Sun Aug 8 21:53:17 2010 +0200

    play a sound when taking a photo
    
    this was somehow not added when we did the vala port, now
    everybody can enjoy that lovely shutter sound

 src/Makefile.am        |    2 ++
 src/cheese-window.vala |    6 ++++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 6970f89..6d55447 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,6 +11,8 @@ VALAFLAGS = \
 	--pkg gstreamer-0.10 \
 	--pkg unique-1.0 \
 	--pkg mx-1.0 \
+	--pkg libcanberra \
+	--pkg libcanberra-gtk \
 	--pkg eogthumbnav \
 	--pkg cheese-thumbview \
 	--pkg cheese-common
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index d56cb23..83b3440 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -28,6 +28,7 @@ using Eog;
 using Gst;
 using Mx;
 using Gee;
+using CanberraGtk;
 
 const int FULLSCREEN_TIMEOUT_INTERVAL = 5 * 1000;
 const int EFFECTS_PER_PAGE            = 9;
@@ -582,6 +583,11 @@ public class Cheese.MainWindow : Gtk.Window
     string file_name = fileutil.get_new_media_filename (this.current_mode);
 
     this.flash.fire ();
+    CanberraGtk.play_for_widget (this.main_vbox, 0,
+                                 Canberra.PROP_EVENT_ID, "camera-shutter",
+                                 Canberra.PROP_MEDIA_ROLE, "event",
+                                 Canberra.PROP_EVENT_DESCRIPTION, _("Shutter sound"),
+                                 null);
     this.camera.take_photo (file_name);
   }
 



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