状态栏添加音量显示并添加音量调节功能

This commit is contained in:
2026-02-11 02:22:49 +08:00
parent 194c2b000d
commit a69f3bbc64
9 changed files with 246 additions and 2 deletions

20
src/audio.h Normal file
View File

@@ -0,0 +1,20 @@
#pragma once
#include <glib.h>
#include <stdint.h>
typedef struct pulse_context_t pulse_context_t;
typedef struct pulse_t {
int volume_percent;
bool mute;
bool inited;
char device_name[254];
} pulse_t;
typedef void (*pulse_notify_t)(pulse_t *pulse);
pulse_context_t *init_pulse(GMainContext *context, pulse_notify_t callback);
void change_pulse_volume(pulse_context_t *context, int step);
void toggle_pulse_mute(pulse_context_t *context);
void clean_pulse(pulse_context_t *context);