aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Garcia <agarcia@igalia.com>2009-08-24 16:12:36 +0200
committerAlberto Garcia <agarcia@igalia.com>2009-08-26 15:39:12 +0200
commitc86e430a3531b99ef6a23755661f96a1be6716e5 (patch)
tree3085dccbc0f91306edc270c54374bf5c34b4e146
parentf813fd8f279380f367dce8e07238de2df9aa19da (diff)
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)
-rw-r--r--ChangeLog9
-rw-r--r--hildon/hildon-sound.c30
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 <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,
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);
}