mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Initial commit for Waybar JACK monitoring module
-DSP load -xruns -connected/disconnected state -only tested with Pipewire so far but should work with JACK2 as well On branch dsp Changes to be committed: modified: include/factory.hpp new file: include/modules/jack.hpp modified: meson.build modified: meson_options.txt modified: src/factory.cpp new file: src/modules/jack.cpp
This commit is contained in:

committed by
kennypm

parent
d906080f26
commit
8fc8bb40bf
@ -67,6 +67,10 @@
|
||||
#include "modules/custom.hpp"
|
||||
#include "modules/temperature.hpp"
|
||||
|
||||
#ifdef HAVE_LIBJACK
|
||||
#include "modules/jack.hpp"
|
||||
#endif
|
||||
|
||||
namespace waybar {
|
||||
|
||||
class Factory {
|
||||
|
29
include/modules/jack.hpp
Normal file
29
include/modules/jack.hpp
Normal file
@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <fstream>
|
||||
#include <jack/jack.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_;
|
||||
|
||||
private:
|
||||
std::string JACKState();
|
||||
|
||||
jack_nframes_t samplerate_;
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
Reference in New Issue
Block a user