* Please see COPYING for details
*
* Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
- * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
+ * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al.
* (see AUTHORS)
* All rights reserved.
*
* 0 := channel average
* 1 := right channel
*/
-void print_mixer(struct text_object *obj, int chan, char *p, int p_max_size)
+static void print_mixer_chan(struct text_object *obj, int chan, char *p, int p_max_size)
{
int val;
percent_print(p, p_max_size, val);
}
+void print_mixer(struct text_object *obj, char *p, int p_max_size)
+{
+ print_mixer_chan(obj, 0, p, p_max_size);
+}
+
+void print_mixerl(struct text_object *obj, char *p, int p_max_size)
+{
+ print_mixer_chan(obj, -1, p, p_max_size);
+}
+
+void print_mixerr(struct text_object *obj, char *p, int p_max_size)
+{
+ print_mixer_chan(obj, 1, p, p_max_size);
+}
+
int check_mixer_muted(struct text_object *obj)
{
if (!mixer_is_mute(obj->data.l))
return 1;
}
-#ifdef X11
void scan_mixer_bar(struct text_object *obj, const char *arg)
{
char buf1[64];
}
/* see print_mixer() above for a description of 'chan' */
-void print_mixer_bar(struct text_object *obj, int chan, char *p)
+static void print_mixer_bar_chan(struct text_object *obj, int chan, char *p, int p_max_size)
{
int val;
+ if (!p_max_size)
+ return;
+
if (chan < 0)
val = mixer_get_left(obj->data.i);
else if (chan == 0)
else
val = mixer_get_right(obj->data.i);
- new_bar(obj, p, mixer_to_255(obj->data.i, val));
+ new_bar(obj, p, p_max_size, mixer_to_255(obj->data.i, val));
+}
+
+void print_mixer_bar(struct text_object *obj, char *p, int p_max_size)
+{
+ print_mixer_bar_chan(obj, 0, p, p_max_size);
+}
+
+void print_mixerl_bar(struct text_object *obj, char *p, int p_max_size)
+{
+ print_mixer_bar_chan(obj, -1, p, p_max_size);
+}
+
+void print_mixerr_bar(struct text_object *obj, char *p, int p_max_size)
+{
+ print_mixer_bar_chan(obj, 1, p, p_max_size);
}
-#endif /* X11 */