Merge pull request #309 from dlasky/btaudio
fix(btformat): fixes an issue where btformat was not detectedpull/317/head
commit
10a17187a1
|
@ -33,6 +33,7 @@ class Pulseaudio : public ALabel {
|
||||||
bool muted_;
|
bool muted_;
|
||||||
std::string port_name_;
|
std::string port_name_;
|
||||||
std::string desc_;
|
std::string desc_;
|
||||||
|
std::string monitor_;
|
||||||
bool scrolling_;
|
bool scrolling_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,7 @@ void waybar::modules::Pulseaudio::sinkInfoCb(pa_context * /*context*/, const pa_
|
||||||
pa->volume_ = std::round(volume * 100.0F);
|
pa->volume_ = std::round(volume * 100.0F);
|
||||||
pa->muted_ = i->mute != 0;
|
pa->muted_ = i->mute != 0;
|
||||||
pa->desc_ = i->description;
|
pa->desc_ = i->description;
|
||||||
|
pa->monitor_ = i->monitor_source_name;
|
||||||
pa->port_name_ = i->active_port != nullptr ? i->active_port->name : "Unknown";
|
pa->port_name_ = i->active_port != nullptr ? i->active_port->name : "Unknown";
|
||||||
pa->dp.emit();
|
pa->dp.emit();
|
||||||
}
|
}
|
||||||
|
@ -192,7 +193,7 @@ auto waybar::modules::Pulseaudio::update() -> void {
|
||||||
label_.get_style_context()->add_class("muted");
|
label_.get_style_context()->add_class("muted");
|
||||||
} else {
|
} else {
|
||||||
label_.get_style_context()->remove_class("muted");
|
label_.get_style_context()->remove_class("muted");
|
||||||
if (port_name_.find("a2dp_sink") != std::string::npos) {
|
if (monitor_.find("a2dp_sink") != std::string::npos) {
|
||||||
format =
|
format =
|
||||||
config_["format-bluetooth"].isString() ? config_["format-bluetooth"].asString() : format;
|
config_["format-bluetooth"].isString() ? config_["format-bluetooth"].asString() : format;
|
||||||
label_.get_style_context()->add_class("bluetooth");
|
label_.get_style_context()->add_class("bluetooth");
|
||||||
|
|
Loading…
Reference in New Issue