summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
149460f)
The user is about to fall asleep, so try to make the transition a
bit smoother by fading out to volume zero before stopping the stream.
+static void stop(const struct mixer *m, struct mixer_handle *h)
+ int ret, old_vol = 0;
+
+ ret = m->get(h);
+ if (ret > 0)
+ old_vol = ret;
+ fade(m, h, 0, 3);
audioc_cmd("off");
client_cmd("stop");
audioc_cmd("on");
audioc_cmd("off");
client_cmd("stop");
audioc_cmd("on");
}
static int com_sleep(const struct mixer *m)
}
static int com_sleep(const struct mixer *m)
}
wake_time_epoch = mktime(tm);
PARA_INFO_LOG("waketime: %d:%02d\n", tm->tm_hour, tm->tm_min);
}
wake_time_epoch = mktime(tm);
PARA_INFO_LOG("waketime: %d:%02d\n", tm->tm_hour, tm->tm_min);
ret = set_initial_volume(m, h);
if (ret < 0)
goto close_mixer;
ret = set_initial_volume(m, h);
if (ret < 0)
goto close_mixer;
change_afs_mode(initial_mood);
client_cmd("play");
sleep(delay);
change_afs_mode(initial_mood);
client_cmd("play");
sleep(delay);
}
if (fot && fo_mood && *fo_mood) {
change_afs_mode(fo_mood);
}
if (fot && fo_mood && *fo_mood) {
change_afs_mode(fo_mood);
if (!fot || !fo_mood) /* currently stopped */
client_cmd("play");
} else if (fot && fo_mood && *fo_mood) /* currently playing */
if (!fot || !fo_mood) /* currently stopped */
client_cmd("play");
} else if (fot && fo_mood && *fo_mood) /* currently playing */
m->close(&h);
if (!fit || !fi_mood || !*fi_mood) /* nothing to do */
return 1;
m->close(&h);
if (!fit || !fi_mood || !*fi_mood) /* nothing to do */
return 1;
if (ret < 0)
return ret;
if (sleep_mood && *sleep_mood) /* currently playing */
if (ret < 0)
return ret;
if (sleep_mood && *sleep_mood) /* currently playing */
client_cmd("play");
ret = fade(m, h, fiv, fit);
close_mixer:
client_cmd("play");
ret = fade(m, h, fiv, fit);
close_mixer: