exit(EXIT_FAILURE);
}
-static void change_afs_mode_and_play(char *afs_mode)
+static void change_afs_mode(char *afs_mode)
{
char *cmd;
cmd = make_message("select %s", afs_mode);
client_cmd(cmd);
free(cmd);
- client_cmd("play");
}
static int set_initial_volume(struct mixer *m, struct mixer_handle *h)
ret = set_initial_volume(m, h);
if (ret < 0)
return ret;
- change_afs_mode_and_play(fo_mood);
+ change_afs_mode(fo_mood);
+ client_cmd("play");
ret = set_channel(m, h, conf.mixer_channel_arg);
if (ret < 0)
return ret;
if (ret < 0)
return ret;
}
- if (conf.sleep_mood_given)
- change_afs_mode_and_play(sleep_mood);
- else
+ if (conf.sleep_mood_given) {
+ change_afs_mode(sleep_mood);
+ client_cmd("play");
+ } else
client_cmd("stop");
if (!fit)
return 1;
+ change_afs_mode(fi_mood);
for (;;) {
time(&t1);
if (wake_time_epoch <= t1 + fit)
(delay % 3600) / 60);
sleep(delay);
}
- change_afs_mode_and_play(fi_mood);
+ client_cmd("play");
ret = fade(m, h, fiv, fit);
PARA_INFO_LOG("fade complete, returning\n");
return ret;