1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-11 13:50:56 -05:00
polybar/include/adapters/alsa/control.hpp

42 lines
736 B
C++
Raw Normal View History

#pragma once
#include <mutex>
#include "common.hpp"
2017-01-10 21:07:28 -05:00
#include "settings.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();
2016-12-14 21:30:41 -05:00
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:
int m_numid{0};
2016-12-14 09:04:10 -05:00
snd_ctl_t* m_ctl{nullptr};
snd_hctl_t* m_hctl{nullptr};
snd_hctl_elem_t* m_elem{nullptr};
};
}
POLYBAR_NS_END