16 std::forward<F>(
apply)(volume);
25 template<
typename F>
void begin(
bool other_audio_playing, F &&
apply) {
35 template<
typename F>
void end(
float media_volume, F &&
apply) {
41 std::forward<F>(
apply)(media_volume);
52 void item_started(
bool is_announcement,
bool other_audio_playing,
float media_volume, F &&
apply) {
53 if (!is_announcement) {
64 this->
end(media_volume, std::forward<F>(
apply));
69 void log_end_(
float media_volume)
const;
Tracks a separate volume for announcements that start while nothing else is playing.
void cancel()
The media player volume was set and already sent to the speakers; it applies until the next announcem...
void item_started(bool is_announcement, bool other_audio_playing, float media_volume, F &&apply)
Called when an item starts on a playlist that holds announcements, and may hold media too.
void begin(bool other_audio_playing, F &&apply)
Called when an announcement starts.
void set_volume(float volume, F &&apply)
Stores a new announcement volume and applies it right away if it is in use.
bool is_configured() const
bool last_item_announcement_
void playlist_finished(float media_volume, F &&apply)
Called when the playlist that holds announcements has finished. Switches back to the media volume.
void log_end_(float media_volume) const
void end(float media_volume, F &&apply)
Switches back to the media player volume if the announcement volume is in use.
void apply(Climate *climate)
Apply these settings to the climate device.