diff options
author | Denton Liu <liu.denton+github@gmail.com> | 2019-01-22 23:45:51 -0800 |
---|---|---|
committer | Michael Stapelberg <stapelberg@users.noreply.github.com> | 2019-01-23 08:45:51 +0100 |
commit | 7efbeeaf6ce9232f7479f76c1c79ff73c0db49e4 (patch) | |
tree | 6782b5540b224b2fb1fc5e7387276f92215adf81 /include/i3status.h | |
parent | be0be599d9a5ebe5685c4a0e83ae4c70ebd0cb96 (diff) |
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.
Diffstat (limited to 'include/i3status.h')
-rw-r--r-- | include/i3status.h | 2 |
1 files changed, 2 insertions, 0 deletions
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 */ |