2023-10-26 21:08:57 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <pipewire/pipewire.h>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2023-10-28 22:17:53 +00:00
|
|
|
#include "util/gtk_icon.hpp"
|
|
|
|
|
2023-10-26 21:08:57 +00:00
|
|
|
namespace waybar::util::PipewireBackend {
|
|
|
|
|
|
|
|
enum PrivacyNodeType {
|
|
|
|
PRIVACY_NODE_TYPE_NONE,
|
|
|
|
PRIVACY_NODE_TYPE_VIDEO_INPUT,
|
|
|
|
PRIVACY_NODE_TYPE_AUDIO_INPUT,
|
|
|
|
PRIVACY_NODE_TYPE_AUDIO_OUTPUT
|
|
|
|
};
|
|
|
|
|
|
|
|
class PrivacyNodeInfo {
|
|
|
|
public:
|
|
|
|
PrivacyNodeType type = PRIVACY_NODE_TYPE_NONE;
|
|
|
|
uint32_t id;
|
|
|
|
uint32_t client_id;
|
|
|
|
enum pw_node_state state = PW_NODE_STATE_IDLE;
|
|
|
|
std::string media_class;
|
|
|
|
std::string media_name;
|
|
|
|
std::string node_name;
|
2023-10-28 22:17:53 +00:00
|
|
|
std::string application_name;
|
|
|
|
|
|
|
|
std::string pipewire_access_portal_app_id;
|
|
|
|
std::string application_icon_name;
|
2023-10-26 21:08:57 +00:00
|
|
|
|
2023-10-31 07:46:21 +00:00
|
|
|
struct spa_hook object_listener;
|
|
|
|
struct spa_hook proxy_listener;
|
2023-10-26 21:08:57 +00:00
|
|
|
|
2023-10-28 22:17:53 +00:00
|
|
|
void *data;
|
2023-10-26 21:08:57 +00:00
|
|
|
|
2024-03-25 18:40:23 +00:00
|
|
|
std::string getName();
|
|
|
|
std::string getIconName();
|
|
|
|
|
|
|
|
// Handlers for PipeWire events
|
|
|
|
void handleProxyEventDestroy();
|
|
|
|
void handleNodeEventInfo(const struct pw_node_info *info);
|
2023-10-26 21:08:57 +00:00
|
|
|
};
|
2024-03-25 18:40:23 +00:00
|
|
|
|
2023-10-26 22:01:40 +00:00
|
|
|
} // namespace waybar::util::PipewireBackend
|