From 84e6bd7b5850797b5e829b6fb944277cd9adf0a3 Mon Sep 17 00:00:00 2001 From: Nanako <469449812@qq.com> Date: Sun, 26 May 2024 17:18:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86mixer=5Ftrack=E7=9A=84volume=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/audio/mixer/mixer_track.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/audio/mixer/mixer_track.h b/core/audio/mixer/mixer_track.h index 795b751..c98d39e 100644 --- a/core/audio/mixer/mixer_track.h +++ b/core/audio/mixer/mixer_track.h @@ -43,9 +43,11 @@ public: [[nodiscard]] channel_interface* get_channel_interface() const { return channel_interface_; } + void set_volume(float in_volume) { volume = in_volume; } + [[nodiscard]] float get_volume() const { return volume; } + audio_buffer buffer; std::shared_ptr>> ui_buffers; - std::atomic volume = 1.0f; std::vector effects{}; std::vector children{}; multicast_delegate on_processed; @@ -53,6 +55,7 @@ public: multicast_delegate on_remove_effect; private: const mixer_track_type type_; + std::atomic volume = 1.0f; channel_interface* channel_interface_ = nullptr; };