| 42 | }; |
| 43 | |
| 44 | const std::vector<std::string> waybar::modules::Pulseaudio::getPulseIcon() const { |
| 45 | std::vector<std::string> res; |
| 46 | auto sink_muted = backend->getSinkMuted(); |
| 47 | if (sink_muted) { |
| 48 | res.emplace_back(backend->getCurrentSinkName() + "-muted"); |
| 49 | } |
| 50 | res.push_back(backend->getCurrentSinkName()); |
| 51 | res.push_back(backend->getDefaultSourceName()); |
| 52 | std::string nameLC = backend->getSinkPortName() + backend->getFormFactor(); |
| 53 | std::transform(nameLC.begin(), nameLC.end(), nameLC.begin(), ::tolower); |
| 54 | for (auto const& port : ports) { |
| 55 | if (nameLC.find(port) != std::string::npos) { |
| 56 | if (sink_muted) { |
| 57 | res.emplace_back(port + "-muted"); |
| 58 | } |
| 59 | res.push_back(port); |
| 60 | break; |
| 61 | } |
| 62 | } |
| 63 | if (sink_muted) { |
| 64 | res.emplace_back("default-muted"); |
| 65 | } |
| 66 | return res; |
| 67 | } |
| 68 | |
| 69 | auto waybar::modules::Pulseaudio::update() -> void { |
| 70 | auto format = format_; |
nothing calls this directly
no test coverage detected