diff options
author | Al McElrath <hello@yrns.org> | 2015-04-29 21:08:16 -0700 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2015-04-30 08:51:59 -0400 |
commit | 973f396fdc6be24e14956813338fdd0f4532beae (patch) | |
tree | 8e337b9fdab727f41ad1927a98621b9af3fa7d0c | |
parent | a6738322ff7d752b6c5583a2ad010f3c12ce49b7 (diff) | |
download | mirror-ponymix-973f396fdc6be24e14956813338fdd0f4532beae.tar.gz mirror-ponymix-973f396fdc6be24e14956813338fdd0f4532beae.tar.bz2 mirror-ponymix-973f396fdc6be24e14956813338fdd0f4532beae.zip |
set volume via scale, so as to keep balance
-rw-r--r-- | pulse.cc | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -69,12 +69,11 @@ static void server_info_cb(pa_context* context __attribute__((unused)), } static pa_cvolume* value_to_cvol(long value, pa_cvolume *cvol) { - return pa_cvolume_set(cvol, cvol->channels, - std::max(value * PA_VOLUME_NORM / 100.0, 0.0)); + return pa_cvolume_scale(cvol, std::max(value * PA_VOLUME_NORM / 100.0, 0.0)); } static int volume_as_percent(const pa_cvolume* cvol) { - return round(pa_cvolume_avg(cvol) * 100.0 / PA_VOLUME_NORM); + return round(pa_cvolume_max(cvol) * 100.0 / PA_VOLUME_NORM); } static int xstrtol(const char *str, long *out) { |