Cleaning up.
authorMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Thu, 14 Dec 2006 16:45:32 +0000 (16:45 +0000)
committerMichael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Thu, 14 Dec 2006 16:45:32 +0000 (16:45 +0000)
ChangeLog
src/hildon-sound.c
src/hildon-sound.h

index 29a52b8..3e01ec5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-12-14  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
 
+       * src/hildon-sound.c:
+       * src/hildon-sound.h: Cleaning up.
+
+2006-12-14  Michael Dominic Kostrzewa  <michael.kostrzewa@nokia.com> 
+
        * TODO: Removing. 
 
        * src/hildon-volumebar-range.c:
index e02a6f2..18d6e54 100644 (file)
  * 
  */
 
-#include <config.h>
-#include "hildon-sound.h"
-#include <gconf/gconf-client.h>
-#include <esd.h>
-#include <unistd.h>
+#include                                        "hildon-sound.h"
+#include                                        <gconf/gconf-client.h>
+#include                                        <esd.h>
+#include                                        <unistd.h>
 
-#define ALARM_GCONF_PATH "/apps/osso/sound/system_alert_volume"
+#define                                         ALARM_GCONF_PATH \
+                                                "/apps/osso/sound/system_alert_volume"
 
 /**
  * hildon_play_system_sound:
  * Plays the given sample using esd sound daemon.
  * Volume level is received from gconf. 
  */
-void hildon_play_system_sound(const gchar *sample)
+void 
+hildon_play_system_sound                        (const gchar *sample)
 {
-  GConfClient *client;
-  GConfValue *value;
-  gint volume, scale, sock, sample_id;
+    GConfClient *client;
+    GConfValue *value;
+    gint volume, scale, sock, sample_id;
 
-  client = gconf_client_get_default();
-  value = gconf_client_get(client, ALARM_GCONF_PATH, NULL);
+    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)
-    volume = 2;
-  else
-    volume = gconf_value_get_int(value);
+    /* 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)
+        volume = 2;
+    else
+        volume = gconf_value_get_int(value);
 
-  if (value)
-    gconf_value_free(value);
-  g_object_unref(client);
+    if (value)
+        gconf_value_free(value);
+    g_object_unref (client);
 
-  switch (volume)
-  {
-    case 0:
-      return;
-    case 1:
-      scale = 0x80;
-      break;
-    case 2:
-    default:
-      scale = 0xff;
-      break;
-  };
-    
-  sock = esd_open_sound(NULL);
-  if (sock <= 0)
-    return;
+    switch (volume)
+    {
+        case 0:
+            return;
+        case 1:
+            scale = 0x80;
+            break;
+        case 2:
+        default:
+            scale = 0xff;
+            break;
+    };
 
-  sample_id = esd_file_cache(sock, g_get_prgname(), sample);
-  if (sample_id < 0) {
-    close(sock);
-    return;
-  }
-  
-  esd_set_default_sample_pan(sock, sample_id, scale, scale);
-  esd_sample_play(sock, sample_id);
-  esd_sample_free(sock, sample_id);
-  close(sock);
+    sock = esd_open_sound (NULL);
+    if (sock <= 0)
+        return;
+
+    sample_id = esd_file_cache (sock, g_get_prgname(), sample);
+    if (sample_id < 0) {
+        close(sock);
+        return;
+    }
+
+    esd_set_default_sample_pan (sock, sample_id, scale, scale);
+    esd_sample_play(sock, sample_id);
+    esd_sample_free(sock, sample_id);
+    close (sock);
 }
index bd47155..c66ff98 100644 (file)
  * 02110-1301 USA
  *
  */
-#ifndef __HILDON_SOUND_H__
-#define __HILDON_SOUND_H__
 
-#include <glib.h>
+#ifndef                                         __HILDON_SOUND_H__
+#define                                         __HILDON_SOUND_H__
+
+#include                                        <glib.h>
 
 G_BEGIN_DECLS
 
-void hildon_play_system_sound(const gchar *sample);
+void 
+hildon_play_system_sound                        (const gchar *sample);
 
 G_END_DECLS
-#endif /* __HILDON_SYSTEM_SOUND_H__ */
+
+#endif                                          /* __HILDON_SOUND_H__ */