mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-28 08:42:25 +03:00
feat(sound): apply channel group volume in SESoundInternal::GetVolume
This commit is contained in:
1 file changed
+16
-1
@@ -20,11 +20,26 @@ float SESoundInternal::GetVolume() {
|
|||||||
|
|
||||||
float volume = this->m_volume;
|
float volume = this->m_volume;
|
||||||
|
|
||||||
|
// Apply fade volume
|
||||||
|
|
||||||
if (this->m_fadeIn || this->m_fadeOut) {
|
if (this->m_fadeIn || this->m_fadeOut) {
|
||||||
volume *= this->m_fadeVolume;
|
volume *= this->m_fadeVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// Apply channel group volume
|
||||||
|
|
||||||
|
if (SESound::s_ChannelGroups.Count()) {
|
||||||
|
auto channelGroupIndex = this->m_channelGroup;
|
||||||
|
|
||||||
|
while (channelGroupIndex != -1) {
|
||||||
|
auto channelGroup = &SESound::s_ChannelGroups[this->m_channelGroup];
|
||||||
|
auto channelGroupVolume = channelGroup->m_volume * channelGroup->m_muteVolume;
|
||||||
|
|
||||||
|
volume *= channelGroupVolume;
|
||||||
|
|
||||||
|
channelGroupIndex = channelGroup->m_parentChannelGroup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return volume;
|
return volume;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user