waybar/include/modules/jack.hpp

36 lines
774 B
C++
Raw Normal View History

#pragma once
#include <fmt/format.h>
#include <fstream>
#include <jack/jack.h>
2022-02-12 07:51:11 +01:00
#include <jack/thread.h>
#include <proc/readproc.h>
#include "ALabel.hpp"
#include "util/sleeper_thread.hpp"
namespace waybar::modules {
class JACK : public ALabel {
public:
JACK(const std::string&, const Json::Value&);
~JACK() = default;
auto update() -> void;
jack_nframes_t bufsize_;
jack_client_t* client_;
unsigned int xruns_;
std::string state_;
2022-02-12 07:51:11 +01:00
pthread_t jack_thread_;
private:
std::string JACKState();
jack_nframes_t samplerate_;
util::SleeperThread thread_;
};
} // namespace waybar::modules
2022-02-12 07:51:11 +01:00
int bufSizeCallback(unsigned int size, void *obj);
int xrunCallback(void *obj);
void shutdownCallback(void *obj);