diff options
author | ben <benjaminfranzke@googlemail.com> | 2010-07-15 11:15:22 +0200 |
---|---|---|
committer | ben <benjaminfranzke@googlemail.com> | 2010-07-15 11:15:22 +0200 |
commit | 5eff48dddb547a4c7f9914b5430b28fe31c3d144 (patch) | |
tree | e123f8784c130314bf4b997c792eb4c09b65a7bc | |
parent | b9357271148229d36c42b59508c89940bbbcd708 (diff) | |
download | pa-sink-ctl-5eff48dddb547a4c7f9914b5430b28fe31c3d144.tar.gz pa-sink-ctl-5eff48dddb547a4c7f9914b5430b28fe31c3d144.tar.bz2 pa-sink-ctl-5eff48dddb547a4c7f9914b5430b28fe31c3d144.zip |
use pa_cvolume_set instead of iterating manually
-rw-r--r-- | src/interface.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/interface.c b/src/interface.c index 771127b..76fb29e 100644 --- a/src/interface.c +++ b/src/interface.c @@ -187,10 +187,11 @@ void get_input(void) }; } else break; - int input_vol = tmp.tmp_vol + 2 * volume_mult * (VOLUME_MAX / 100); - tmp.tmp_vol = CLAMP(input_vol, VOLUME_MIN, VOLUME_MAX); /* force input_vol in [0, VOL_NORM] */ - for (int i = 0; i < tmp.volume.channels; ++i) - tmp.volume.values[i] = tmp.tmp_vol; + + pa_cvolume_set(&tmp.volume, tmp.volume.channels, + CLAMP(tmp.tmp_vol + 2 * volume_mult * (VOLUME_MAX / 100), + VOLUME_MIN, VOLUME_MAX) /* force vol in [0, VOL_MAX] */ + ); pa_operation_unref(tmp.volume_set(context, tmp.index, &tmp.volume, change_callback, NULL)); return; |