2023-10-26 21:08:57 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "gtkmm/box.h"
|
|
|
|
#include "modules/privacy/privacy_item.hpp"
|
|
|
|
#include "util/pipewire/pipewire_backend.hpp"
|
|
|
|
#include "util/pipewire/privacy_node_info.hpp"
|
|
|
|
|
|
|
|
using waybar::util::PipewireBackend::PrivacyNodeInfo;
|
|
|
|
|
|
|
|
namespace waybar::modules::privacy {
|
|
|
|
|
|
|
|
class Privacy : public AModule {
|
|
|
|
public:
|
|
|
|
Privacy(const std::string &, const Json::Value &, const std::string &pos);
|
|
|
|
auto update() -> void override;
|
|
|
|
|
|
|
|
void onPrivacyNodesChanged();
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::list<PrivacyNodeInfo *> nodes_screenshare; // Screen is being shared
|
|
|
|
std::list<PrivacyNodeInfo *> nodes_audio_in; // Application is using the microphone
|
|
|
|
std::list<PrivacyNodeInfo *> nodes_audio_out; // Application is outputting audio
|
|
|
|
|
2023-10-26 21:37:10 +00:00
|
|
|
std::mutex mutex_;
|
2023-10-26 21:08:57 +00:00
|
|
|
sigc::connection visibility_conn;
|
|
|
|
|
|
|
|
// Config
|
|
|
|
Gtk::Box box_;
|
|
|
|
uint iconSpacing = 4;
|
|
|
|
uint iconSize = 20;
|
2023-11-04 13:12:45 +00:00
|
|
|
uint transition_duration = 250;
|
2023-10-26 21:08:57 +00:00
|
|
|
|
|
|
|
std::shared_ptr<util::PipewireBackend::PipewireBackend> backend = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace waybar::modules::privacy
|