X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mixer.c;h=52af25f9c22ae5397f03c5bf61daaae0f1bb67bd;hp=0c08e2f6d0ab24f35334aa9961bb2f143e656235;hb=ac9f8fc0b4a20b3ec1d205029ef61321174d15b6;hpb=1f12ea375358a0b30689e01efe82796ea4fcb14f diff --git a/mixer.c b/mixer.c index 0c08e2f6..52af25f9 100644 --- a/mixer.c +++ b/mixer.c @@ -1,8 +1,4 @@ -/* - * Copyright (C) 1998 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 1998 Andre Noll , see file COPYING. */ /** \file mixer.c A volume fader and alarm clock for OSS. */ @@ -196,9 +192,6 @@ static void change_afs_mode(const char *afs_mode) { char *cmd; - client_cmd("stop"); - if (!afs_mode) - return; cmd = make_message("select %s", afs_mode); client_cmd(cmd); free(cmd); @@ -294,7 +287,7 @@ static int com_sleep(const struct mixer *m, struct mixer_handle *h) PARA_INFO_LOG("waketime: %d:%02d\n", tm->tm_hour, tm->tm_min); client_cmd("stop"); sleep(1); - if (fot) { + if (fot && fo_mood) { ret = set_initial_volume(m, h); if (ret < 0) return ret; @@ -311,12 +304,13 @@ static int com_sleep(const struct mixer *m, struct mixer_handle *h) if (ret < 0) return ret; } - if (OPT_GIVEN(SLEEP, SLEEP_MOOD)) { + if (sleep_mood) { change_afs_mode(sleep_mood); - client_cmd("play"); - } else + if (!fot || !fo_mood) /* currently stopped */ + client_cmd("play"); + } else if (fot && fo_mood) /* currently playing */ client_cmd("stop"); - if (!fit) + if (!fit || !fi_mood) /* nothing to do */ return 1; change_afs_mode(fi_mood); for (;;) {