/*
- * Copyright (C) 1998-2012 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1998-2013 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
static struct mixer supported_mixer[] = {MIXER_ARRAY};
#define FOR_EACH_MIXER(i) for ((i) = 0; (i) < NUM_SUPPORTED_MIXERS; (i)++)
-__printf_2_3 void date_log(__a_unused int ll, const char *fmt, ...)
+static int loglevel;
+__printf_2_3 void date_log(int ll, const char *fmt, ...)
{
va_list argp;
time_t t1;
struct tm *tm;
+ if (ll < loglevel)
+ return;
time(&t1);
tm = localtime(&t1);
printf("%d:%02d:%02d ", tm->tm_hour, tm->tm_min, tm->tm_sec);
unsigned long long tmp, tmp2; /* Careful with that axe, Eugene! */
if (fade_time <= 0)
- return 1;
+ return m->set(h, new_vol);
secs = fade_time;
PARA_NOTICE_LOG("fading to %d in %d seconds\n", new_vol, secs);
ret = m->get(h);
pid_t pid;
char *cmdline = make_message(BINDIR "/para_client %s", cmd);
- PARA_INFO_LOG("%s\n", cmdline);
+ PARA_NOTICE_LOG("%s\n", cmdline);
ret = para_exec_cmdline_pid(&pid, cmdline, fds);
free(cmdline);
if (ret < 0) {
fade_cmdline_parser_config_file(conf.config_file_arg,
&conf, ¶ms);
}
+ loglevel = get_loglevel_by_name(conf.loglevel_arg);
init_mixers();
m = get_mixer_or_die();
ret = m->open(conf.mixer_device_arg, &h);