X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=fade.c;h=52c83c4b08304a0edfb1ac316a1b4f30e6e8ac57;hp=41b4a6d78e2b40d80cb24e31a5b0030c37db4584;hb=30112f921d2bc97160e4b7ef3762a9ad3ad15ea3;hpb=65a0002eb560b7248cbb0b4f143d00053b66bccc diff --git a/fade.c b/fade.c index 41b4a6d7..52c83c4b 100644 --- a/fade.c +++ b/fade.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2011 Andre Noll + * Copyright (C) 1998-2012 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -8,7 +8,6 @@ #include #include -#include #include #include #include /* EXIT_SUCCESS */ @@ -28,7 +27,7 @@ INIT_FADE_ERRLISTS; static struct fade_args_info conf; -__printf_2_3 void para_log(__a_unused int ll, const char *fmt, ...) +__printf_2_3 void date_log(__a_unused int ll, const char *fmt, ...) { va_list argp; time_t t1; @@ -41,6 +40,7 @@ __printf_2_3 void para_log(__a_unused int ll, const char *fmt, ...) vprintf(fmt, argp); va_end(argp); } +__printf_2_3 void (*para_log)(int, const char*, ...) = date_log; /* * Open the mixer device. @@ -204,7 +204,7 @@ static void change_afs_mode_and_play(char *afs_mode) client_cmd("stop"); if (!afs_mode) return; - cmd = make_message("select %s\n", afs_mode); + cmd = make_message("select %s", afs_mode); client_cmd(cmd); free(cmd); client_cmd("play"); @@ -288,11 +288,9 @@ static int sweet_dreams(void) static int snooze(void) { int ret; - unsigned sleep_time; if (conf.so_time_arg <= 0) return 1; - sleep_time = conf.so_time_arg; if (open_and_get_mixer_channel() < conf.so_vol_arg) ret = open_and_set_mixer_channel(conf.so_vol_arg); else @@ -301,7 +299,7 @@ static int snooze(void) return ret; client_cmd("pause"); PARA_NOTICE_LOG("%d seconds snooze time...\n", conf.snooze_time_arg); - sleep(sleep_time); + sleep(conf.snooze_time_arg); client_cmd("play"); return fade(conf.si_vol_arg, conf.si_time_arg); }