Merge pull request #4908 from 7FM/master
pulseaudio: add target option to control source (microphone) volume
This commit is contained in:
@@ -7,6 +7,10 @@ waybar::modules::Pulseaudio::Pulseaudio(const std::string& id, const Json::Value
|
||||
|
||||
backend = util::AudioBackend::getInstance([this] { this->dp.emit(); });
|
||||
backend->setIgnoredSinks(config_["ignored-sinks"]);
|
||||
|
||||
if (config_["target"].isString() && config_["target"].asString() == "source") {
|
||||
target = util::PulseaudioTarget::Source;
|
||||
}
|
||||
}
|
||||
|
||||
bool waybar::modules::Pulseaudio::handleScroll(GdkEventScroll* e) {
|
||||
@@ -33,7 +37,7 @@ bool waybar::modules::Pulseaudio::handleScroll(GdkEventScroll* e) {
|
||||
? util::ChangeType::Increase
|
||||
: util::ChangeType::Decrease;
|
||||
|
||||
backend->changeVolume(change_type, step, max_volume);
|
||||
backend->changeVolume(change_type, step, max_volume, target);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ void PulseaudioSlider::onValueChanged() {
|
||||
if (unmute_on_volume_change) {
|
||||
backend->unmute(target);
|
||||
}
|
||||
backend->changeVolume(slider_value, min_, max_);
|
||||
backend->changeVolume(slider_value, min_, max_, target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user