Play sounds with "module-stream-restore.id" set to "x-maemo-system-sound"
authorAlberto Garcia <agarcia@igalia.com>
Mon, 24 Aug 2009 14:12:36 +0000 (16:12 +0200)
committerAlberto Garcia <agarcia@igalia.com>
Wed, 26 Aug 2009 13:39:12 +0000 (15:39 +0200)
* hildon/hildon-sound.c (hildon_play_system_sound):
Set "module-stream-restore.id" to "x-maemo-system-sound" when
playing system sounds

Fixes: NB#133767 (Information and confirmation note sound should
follow system profile setting)

ChangeLog
hildon/hildon-sound.c

index c1cccea..9fc2a1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-08-26  Alberto Garcia  <agarcia@igalia.com>
+
+       * hildon/hildon-sound.c (hildon_play_system_sound):
+       Set "module-stream-restore.id" to "x-maemo-system-sound" when
+       playing system sounds
+
+       Fixes: NB#133767 (Information and confirmation note sound should
+       follow system profile setting)
+
 2009-08-26  Alejandro G. Castro  <alex@igalia.com>
 
        * hildon/hildon-pannable-area.c,
index 980d65f..5d611cc 100644 (file)
@@ -93,45 +93,19 @@ hildon_ca_context_get (void)
 void 
 hildon_play_system_sound(const gchar *sample)
 {
-    float volume = 0;
     int ret;
     ca_context *ca_con = NULL;
     ca_proplist *pl = NULL;
 
-#if 0 /* FIXME: Check volume handling. Would be great not to use Gconf... */
-    GConfClient *client;
-    GConfValue *value;
-    gint gconf_vol;
-
-    /*
-     * The volume is from -0dB to -6dB,
-       The full volume is marked as 2 in gconf */
-    client = gconf_client_get_default ();
-    value = gconf_client_get (client, ALARM_GCONF_PATH, NULL);
-
-    /* We want error cases to match full volume, not silence, so
-       we do not want to use gconf_client_get_int */
-    if (!value || value->type != GCONF_VALUE_INT)
-        gconf_vol = 2;
-    else
-        gconf_vol = gconf_value_get_int(value);
-
-    if (value)
-        gconf_value_free(value);
-    g_object_unref (client);
-
-    volume = ((1.0 - (float)gconf_vol / 2.0)) * (-6.0);
-#endif
-
     ca_con = hildon_ca_context_get ();
 
     ca_proplist_create(&pl);
     ca_proplist_sets(pl, CA_PROP_MEDIA_FILENAME, sample);
     ca_proplist_sets(pl, CA_PROP_MEDIA_ROLE, "dialog-information");
-    ca_proplist_setf(pl, CA_PROP_CANBERRA_VOLUME, "%f", volume);
+    ca_proplist_sets(pl, "module-stream-restore.id", "x-maemo-system-sound");
 
     ret = ca_context_play_full(ca_con, 0, pl, NULL, NULL);
-    g_debug("ca_context_play_full (vol %f): %s\n", volume, ca_strerror(ret));
+    g_debug("ca_context_play_full %s\n", ca_strerror(ret));
 
     ca_proplist_destroy(pl);
 }