mirror of
https://github.com/polybar/polybar.git
synced 2024-10-27 05:23:39 -04:00
42 lines
738 B
C++
42 lines
738 B
C++
#pragma once
|
|
|
|
#include <mutex>
|
|
|
|
#include "common.hpp"
|
|
|
|
// fwd
|
|
struct _snd_ctl;
|
|
struct _snd_hctl_elem;
|
|
struct _snd_hctl;
|
|
typedef struct _snd_ctl snd_ctl_t;
|
|
typedef struct _snd_hctl_elem snd_hctl_elem_t;
|
|
typedef struct _snd_hctl snd_hctl_t;
|
|
|
|
POLYBAR_NS
|
|
|
|
namespace alsa {
|
|
class control {
|
|
public:
|
|
explicit control(int numid);
|
|
~control();
|
|
|
|
control(const control& o) = delete;
|
|
control& operator=(const control& o) = delete;
|
|
|
|
int get_numid();
|
|
bool wait(int timeout = -1);
|
|
bool test_device_plugged();
|
|
void process_events();
|
|
|
|
private:
|
|
std::mutex m_lock{};
|
|
|
|
int m_numid{0};
|
|
|
|
snd_ctl_t* m_ctl{nullptr};
|
|
snd_hctl_t* m_hctl{nullptr};
|
|
snd_hctl_elem_t* m_elem{nullptr};
|
|
};
|
|
}
|
|
|
|
POLYBAR_NS_END
|