2018-08-09 21:55:38 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <fmt/format.h>
|
2022-04-06 06:37:19 +00:00
|
|
|
|
2018-08-13 20:33:07 +00:00
|
|
|
#include <algorithm>
|
2019-08-09 09:05:34 +00:00
|
|
|
#include <array>
|
2023-10-15 13:16:49 +00:00
|
|
|
#include <memory>
|
2022-04-06 06:37:19 +00:00
|
|
|
|
2022-11-24 11:28:52 +00:00
|
|
|
#include "ALabel.hpp"
|
2023-10-15 13:16:49 +00:00
|
|
|
#include "util/audio_backend.hpp"
|
2018-08-09 21:55:38 +00:00
|
|
|
|
|
|
|
namespace waybar::modules {
|
|
|
|
|
2022-11-24 11:28:52 +00:00
|
|
|
class Pulseaudio : public ALabel {
|
2019-04-18 15:52:00 +00:00
|
|
|
public:
|
|
|
|
Pulseaudio(const std::string&, const Json::Value&);
|
2023-10-15 13:16:49 +00:00
|
|
|
virtual ~Pulseaudio() = default;
|
2023-03-02 13:57:07 +00:00
|
|
|
auto update() -> void override;
|
2018-08-16 12:29:41 +00:00
|
|
|
|
2019-04-18 15:52:00 +00:00
|
|
|
private:
|
2023-03-02 13:57:07 +00:00
|
|
|
bool handleScroll(GdkEventScroll* e) override;
|
2021-07-15 06:52:02 +00:00
|
|
|
const std::vector<std::string> getPulseIcon() const;
|
2019-04-18 15:52:00 +00:00
|
|
|
|
2023-10-15 13:16:49 +00:00
|
|
|
std::shared_ptr<util::AudioBackend> backend = nullptr;
|
2018-08-16 12:29:41 +00:00
|
|
|
};
|
2018-08-09 21:55:38 +00:00
|
|
|
|
2018-10-29 16:18:35 +00:00
|
|
|
} // namespace waybar::modules
|