From c86e430a3531b99ef6a23755661f96a1be6716e5 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Date: Mon, 24 Aug 2009 16:12:36 +0200 Subject: [PATCH] Play sounds with "module-stream-restore.id" set to "x-maemo-system-sound" * 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 | 9 +++++++++ hildon/hildon-sound.c | 30 ++---------------------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1cccea..9fc2a1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-08-26 Alberto Garcia + + * 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 * hildon/hildon-pannable-area.c, diff --git a/hildon/hildon-sound.c b/hildon/hildon-sound.c index 980d65f..5d611cc 100644 --- a/hildon/hildon-sound.c +++ b/hildon/hildon-sound.c @@ -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); } -- 1.7.9.5