X-Git-Url: http://git.maemo.org/git/?p=hildon;a=blobdiff_plain;f=hildon%2Fhildon-sound.c;h=5d611cc1328a50d23e6e122af4ca3e21a655fcec;hp=980d65f65bd11a2d47b48c912407a0e644c0a709;hb=c86e430a3531b99ef6a23755661f96a1be6716e5;hpb=f813fd8f279380f367dce8e07238de2df9aa19da 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); }