From 13df2ef94b44d633a7a0dbfdfd06b54e0843f9fe Mon Sep 17 00:00:00 2001 From: rob gay Date: Mon, 3 Jun 2019 09:21:48 -0400 Subject: [PATCH] Fix build from merge conflict. Required exposing WaveInstance getter on ActiveSound (internal member hiding conflicted with newly refactored code for Audio Debugger) #rb none [FYI] Kevin.Neilson [FYI] Aaron.Mcleran [FYI] Ethan.Geller #ROBOMERGE-OWNER: lina.halper #ROBOMERGE-AUTHOR: rob.gay #ROBOMERGE-SOURCE: CL 6762865 in //UE4/Main/... #ROBOMERGE-BOT: ANIM (Main -> Dev-Anim) (v365-6733468) [CL 6797348 by rob gay in Dev-Anim branch] --- Engine/Source/Runtime/Engine/Private/AudioDebug.cpp | 2 +- Engine/Source/Runtime/Engine/Private/SoundNodeWavePlayer.cpp | 4 ++-- Engine/Source/Runtime/Engine/Private/SoundWave.cpp | 4 ++-- Engine/Source/Runtime/Engine/Public/ActiveSound.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp b/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp index 9bdcb922d020..c70abf7acf1a 100644 --- a/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp +++ b/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp @@ -415,7 +415,7 @@ void FAudioDebugger::DumpActiveSounds() const { UE_LOG(LogAudio, Display, TEXT("%s (%.3g) - %s"), *ActiveSound->GetSound()->GetName(), ActiveSound->GetSound()->GetDuration(), *ActiveSound->GetAudioComponentName()); - for (const TPair& WaveInstancePair : ActiveSound->WaveInstances) + for (const TPair& WaveInstancePair : ActiveSound->GetWaveInstances()) { const FWaveInstance* WaveInstance = WaveInstancePair.Value; UE_LOG(LogAudio, Display, TEXT(" %s (%.3g) (%d) - %.3g"), diff --git a/Engine/Source/Runtime/Engine/Private/SoundNodeWavePlayer.cpp b/Engine/Source/Runtime/Engine/Private/SoundNodeWavePlayer.cpp index d506d8fb5651..7e2a2230a724 100644 --- a/Engine/Source/Runtime/Engine/Private/SoundNodeWavePlayer.cpp +++ b/Engine/Source/Runtime/Engine/Private/SoundNodeWavePlayer.cpp @@ -153,7 +153,7 @@ void USoundNodeWavePlayer::ParseNodes( FAudioDevice* AudioDevice, const UPTRINT bPlayFailed = 0; } - const int32 InitActiveSoundWaveInstanceNum = ActiveSound.GetWaveInstanceNum(); + const int32 InitActiveSoundWaveInstanceNum = ActiveSound.GetWaveInstances().Num(); const int32 InitWaveInstancesNum = WaveInstances.Num(); // Guard against continual parsing if wave instance was created but not added to transient @@ -165,7 +165,7 @@ void USoundNodeWavePlayer::ParseNodes( FAudioDevice* AudioDevice, const UPTRINT if (*RequiresInitialization != 0) { - if (ActiveSound.GetWaveInstanceNum() == InitActiveSoundWaveInstanceNum) + if (ActiveSound.GetWaveInstances().Num() == InitActiveSoundWaveInstanceNum) { if (WaveInstances.Num() == InitWaveInstancesNum) { diff --git a/Engine/Source/Runtime/Engine/Private/SoundWave.cpp b/Engine/Source/Runtime/Engine/Private/SoundWave.cpp index 90b0de215b80..7fa098309df0 100644 --- a/Engine/Source/Runtime/Engine/Private/SoundWave.cpp +++ b/Engine/Source/Runtime/Engine/Private/SoundWave.cpp @@ -1640,8 +1640,8 @@ void USoundWave::Parse(FAudioDevice* AudioDevice, const UPTRINT NodeWaveInstance bool bHasSubtitles = ActiveSound.bHandleSubtitles && (ActiveSound.bHasExternalSubtitles || (Subtitles.Num() > 0)); // When the BypassVirtualizeWhenSilent cvar is enabled, we should only honor bVirtualizeWhenSilent for procedural sounds: - const bool bShouldVirtualize = bVirtualizeWhenSilent && (!BypassVirtualizeWhenSilentCVar || bProcedural); - if (WaveInstance->GetVolumeWithDistanceAttenuation() > KINDA_SMALL_NUMBER || ((bShouldVirtualize || bHasSubtitles) && AudioDevice->VirtualSoundsEnabled())) + const bool bCanPlayWhenSilent = IsPlayWhenSilent() && (!BypassPlayWhenSilentCVar || bProcedural); + const float WaveInstanceVolume = WaveInstance->GetVolumeWithDistanceAttenuation() * WaveInstance->GetDynamicVolume(); { WaveInstances.Add(WaveInstance); ActiveSound.bFinished = false; diff --git a/Engine/Source/Runtime/Engine/Public/ActiveSound.h b/Engine/Source/Runtime/Engine/Public/ActiveSound.h index 08c611fff86c..a505c8a03fb3 100644 --- a/Engine/Source/Runtime/Engine/Public/ActiveSound.h +++ b/Engine/Source/Runtime/Engine/Public/ActiveSound.h @@ -504,9 +504,9 @@ public: void RemoveWaveInstance(const UPTRINT WaveInstanceHash); - int32 GetWaveInstanceNum() const + const TMap& GetWaveInstances() const { - return WaveInstances.Num(); + return WaveInstances; } /**