commit 03997ebb78edc2b174cd4b6972d95f967d22fe62
Author: blut <[email protected]>
Date:   Sun Jun 8 19:58:21 2014 +0000

    Add some comments

diff --git a/dwm.suckless.org/dwmstatus/getvol.c 
b/dwm.suckless.org/dwmstatus/getvol.c
index d170075..8e0ad66 100644
--- a/dwm.suckless.org/dwmstatus/getvol.c
+++ b/dwm.suckless.org/dwmstatus/getvol.c
@@ -1,10 +1,18 @@
+/* include this into your dwmstatus.c and use get_vol() as volume.
+ * if your audio card and subunit numbers differ from 0,0 you might havo
+ * to use amixer, aplay and the /proc/asound file tree to adapt.
+ *
+ * I had compilation issues. As result i had to drop the -std=c99 and
+ * -pedantic flags from the config.mk
+ */
+
 #include <alsa/asoundlib.h>
 #include <alsa/control.h>
 
 int
 get_vol(void)
 {
-    long int vol;
+    int vol;
     snd_hctl_t *hctl;
     snd_ctl_elem_id_t *id;
     snd_ctl_elem_value_t *control;
@@ -25,8 +33,8 @@ get_vol(void)
     snd_ctl_elem_value_set_id(control, id);
 
     snd_hctl_elem_read(elem, control);
-    vol = snd_ctl_elem_value_get_integer(control,0);
+    vol = (int)snd_ctl_elem_value_get_integer(control,0);
 
     snd_hctl_close(hctl);
-    return (int)vol;
+    return vol;
 }


Reply via email to