+#include "hildon-sound.h"
+
+#define ALARM_GCONF_PATH "/apps/osso/sound/system_alert_volume"
+
+static ca_context *hildon_ca_context_get (void);
+
+/*
+ * hildon_ca_context_get:
+ *
+ * hildon maintains a single application-global ca_context object.
+ *
+ * This functions is based on ca_gtk_context_get
+ *
+ * Returns: a ca_context object
+ */
+static ca_context *
+hildon_ca_context_get (void)
+{
+ static GStaticPrivate context_private = G_STATIC_PRIVATE_INIT;
+ ca_context *c = NULL;
+ const gchar *name = NULL;
+ gint ret;
+
+ if ((c = g_static_private_get(&context_private)))
+ return c;
+
+ if ((ret = ca_context_create(&c)) != CA_SUCCESS) {
+ g_warning("ca_context_create: %s\n", ca_strerror(ret));
+ return NULL;
+ }
+ if ((ret = ca_context_open(c)) != CA_SUCCESS) {
+ g_warning("ca_context_open: %s\n", ca_strerror(ret));
+ ca_context_destroy(c);
+ return NULL;
+ }
+
+ if ((name = g_get_application_name()))
+ ca_context_change_props(c, CA_PROP_APPLICATION_NAME, name, NULL);
+
+ g_static_private_set(&context_private, c, (GDestroyNotify) ca_context_destroy);
+
+ return c;
+}