mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 22:52:30 +02:00
refactor: move backlight backend out of backlight module
This commit is contained in:
@ -10,12 +10,10 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "util/backend_common.hpp"
|
||||
|
||||
namespace waybar::util {
|
||||
|
||||
enum class ChangeType : char { Increase, Decrease };
|
||||
|
||||
void noop();
|
||||
|
||||
class AudioBackend {
|
||||
private:
|
||||
static void subscribeCb(pa_context*, pa_subscription_event_type_t, uint32_t, void*);
|
||||
@ -50,7 +48,7 @@ class AudioBackend {
|
||||
|
||||
std::vector<std::string> ignored_sinks_;
|
||||
|
||||
std::function<void()> on_updated_cb_ = noop;
|
||||
std::function<void()> on_updated_cb_ = NOOP;
|
||||
|
||||
/* Hack to keep constructor inaccessible but still public.
|
||||
* This is required to be able to use std::make_shared.
|
||||
@ -61,7 +59,7 @@ class AudioBackend {
|
||||
struct private_constructor_tag {};
|
||||
|
||||
public:
|
||||
static std::shared_ptr<AudioBackend> getInstance(std::function<void()> on_updated_cb = noop);
|
||||
static std::shared_ptr<AudioBackend> getInstance(std::function<void()> on_updated_cb = NOOP);
|
||||
|
||||
AudioBackend(std::function<void()> on_updated_cb, private_constructor_tag tag);
|
||||
~AudioBackend();
|
||||
|
Reference in New Issue
Block a user