From 7efbeeaf6ce9232f7479f76c1c79ff73c0db49e4 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Tue, 22 Jan 2019 23:45:51 -0800 Subject: Implement %devicename specifier for volume module (#325) This commit implements the %devicename specifier for the volume module for both PulseAudio and ALSA. This way, i3status will be able to display the specific device that corresponds to the volume indicator. Note that this is not implemented for the OSS API but is left in a state where someone can pick it up for the future. --- include/i3status.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/i3status.h b/include/i3status.h index d79ab28..7c22cbc 100644 --- a/include/i3status.h +++ b/include/i3status.h @@ -36,6 +36,7 @@ extern char *pct_mark; #define COMPOSE_VOLUME_MUTE(vol, mute) ((vol) | ((mute) ? (1 << 30) : 0)) #define DECOMPOSE_VOLUME(cvol) ((cvol) & ~(1 << 30)) #define DECOMPOSE_MUTED(cvol) (((cvol) & (1 << 30)) != 0) +#define MAX_SINK_DESCRIPTION_LEN (128) /* arbitrary */ #if defined(LINUX) @@ -228,6 +229,7 @@ void print_memory(yajl_gen json_gen, char *buffer, const char *format, const cha void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *fmt_muted, const char *device, const char *mixer, int mixer_idx); bool process_runs(const char *path); int volume_pulseaudio(uint32_t sink_idx, const char *sink_name); +bool description_pulseaudio(uint32_t sink_idx, const char *sink_name, char buffer[MAX_SINK_DESCRIPTION_LEN]); bool pulse_initialize(void); /* socket file descriptor for general purposes */ -- cgit v1.2.3