[wiki] [sites] Add some comments || blut

From: <git_AT_suckless.org>
Date: Sun, 08 Jun 2014 21:59:46 +0200

commit 03997ebb78edc2b174cd4b6972d95f967d22fe62
Author: blut <CXblut_AT_gmail.com>
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
_AT_@ -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;
_AT_@ -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;
 }
Received on Sun Jun 08 2014 - 21:59:46 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 18 2015 - 17:39:01 CEST