Merge pull request #2554 from mutoroglin/cava-hide-on-silence

This commit is contained in:
Alexis Rouillard
2023-10-15 21:19:17 +02:00
committed by GitHub
3 changed files with 11 additions and 2 deletions

View File

@ -64,6 +64,7 @@ waybar::modules::Cava::Cava(const std::string& id, const Json::Value& config)
prm_.noise_reduction = config_["noise_reduction"].asDouble();
if (config_["input_delay"].isInt())
fetch_input_delay_ = std::chrono::seconds(config_["input_delay"].asInt());
if (config_["hide_on_silence"].isBool()) hide_on_silence_ = config_["hide_on_silence"].asBool();
// Make cava parameters configuration
plan_ = new cava_plan{};
@ -174,10 +175,13 @@ auto waybar::modules::Cava::update() -> void {
}
label_.set_markup(text_);
label_.show();
ALabel::update();
}
} else
} else {
upThreadDelay(frame_time_milsec_, suspend_silence_delay_);
if (hide_on_silence_) label_.hide();
}
}
auto waybar::modules::Cava::doAction(const std::string& name) -> void {