From e89d06bb57b3cf3a0cef80fff5b1a003a14f35e1 Mon Sep 17 00:00:00 2001 From: Vadim Zubkov Date: Mon, 27 Nov 2023 00:32:08 +0300 Subject: [PATCH] feat(client): add channel parameter to addVolumeEffect --- client/src/bindings/AudioFilter.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/bindings/AudioFilter.cpp b/client/src/bindings/AudioFilter.cpp index 9a6d2c03..af9ae234 100644 --- a/client/src/bindings/AudioFilter.cpp +++ b/client/src/bindings/AudioFilter.cpp @@ -91,11 +91,19 @@ static void AddVolumeEffect(const v8::FunctionCallbackInfo& info) V8_GET_THIS_BASE_OBJECT(filter, alt::IAudioFilter); - V8_CHECK_ARGS_LEN(2); + V8_CHECK_ARGS_LEN2(2, 3); V8_ARG_TO_NUMBER(1, fVolume); V8_ARG_TO_INT(2, priority); - V8_RETURN_UINT(filter->AddVolumeEffect(fVolume, priority)); + int channel = -1; + if (info.Length() > 2) + { + V8_TO_UINT(info[2], channel2); + channel = channel2; + } + + Log::Info << "VolumeEffect2: " << fVolume << ", " << priority << ", " << channel << Log::Endl; + V8_RETURN_UINT(filter->AddVolumeEffect(fVolume, priority, channel)); } static void AddPeakeqEffect(const v8::FunctionCallbackInfo& info)