au.3dVisualize.VirtualLoops

au.3dVisualize.VirtualLoops

#Overview

name: au.3dVisualize.VirtualLoops

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of au.3dVisualize.VirtualLoops is to control the visibility of virtualized audio loops when 3D visualization is enabled in Unreal Engine’s audio system.

This setting variable is primarily used in the audio debugging subsystem of Unreal Engine. It’s part of the Engine module, specifically within the audio visualization and debugging features.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1 (enabled) but can be changed at runtime through console commands or programmatically.

The associated variable VirtualLoopsVisualizeEnabledCVar directly interacts with au.3dVisualize.VirtualLoops. They share the same value, with VirtualLoopsVisualizeEnabledCVar being the actual integer variable used in the code to check the setting’s state.

Developers should be aware that this variable affects the visualization of virtual audio loops, which are typically used for optimization in audio systems. When enabled (set to 1), it allows these virtual loops to be visible in the 3D visualization debug mode.

Best practices for using this variable include:

  1. Use it in conjunction with other audio debugging tools for a comprehensive view of the audio system.
  2. Be aware that enabling this visualization might have a performance impact, especially in complex scenes with many audio sources.
  3. Consider disabling it in shipping builds to avoid any potential performance overhead.

Regarding the associated variable VirtualLoopsVisualizeEnabledCVar:

The purpose of VirtualLoopsVisualizeEnabledCVar is to serve as the actual storage and access point for the au.3dVisualize.VirtualLoops setting within the C++ code.

This variable is used directly in the Engine module, specifically in the audio debugging system. It’s checked in various places to determine whether virtual loop visualization should be performed.

The value of VirtualLoopsVisualizeEnabledCVar is set through the CVar system, mirroring the value of au.3dVisualize.VirtualLoops.

It interacts directly with the au.3dVisualize.VirtualLoops console variable, effectively serving as its in-code representation.

Developers should be aware that this variable is used in boolean contexts (e.g., in if statements) despite being an int32. A value of 0 is treated as false, while any non-zero value is true.

Best practices for using this variable include:

  1. Avoid modifying it directly; instead, use the CVar system to change the value of au.3dVisualize.VirtualLoops.
  2. When adding new audio debugging features, consider this variable’s state to maintain consistency with the user’s visualization preferences.
  3. Remember that changes to this variable will affect all code paths that check for virtual loop visualization, so thorough testing is advisable when modifying related systems.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:62

Scope: file

Source code excerpt:

static int32 VirtualLoopsVisualizeEnabledCVar = 1;
FAutoConsoleVariableRef CVarAudioVisualizeVirtualLoopsEnabled(
	TEXT("au.3dVisualize.VirtualLoops"),
	VirtualLoopsVisualizeEnabledCVar,
	TEXT("Whether or not virtualized loops are visible when 3d visualize is enabled. \n")
	TEXT("0: Not Enabled, 1: Enabled"),
	ECVF_Default);

static int32 AudioDebugSoundMaxNumDisplayedCVar = 32;

#Associated Variable and Callsites

This variable is associated with another variable named VirtualLoopsVisualizeEnabledCVar. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:60

Scope: file

Source code excerpt:

	ECVF_Default);

static int32 VirtualLoopsVisualizeEnabledCVar = 1;
FAutoConsoleVariableRef CVarAudioVisualizeVirtualLoopsEnabled(
	TEXT("au.3dVisualize.VirtualLoops"),
	VirtualLoopsVisualizeEnabledCVar,
	TEXT("Whether or not virtualized loops are visible when 3d visualize is enabled. \n")
	TEXT("0: Not Enabled, 1: Enabled"),
	ECVF_Default);

static int32 AudioDebugSoundMaxNumDisplayedCVar = 32;
FAutoConsoleVariableRef CVarAudioDebugSoundMaxNumDisplayed(

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:847

Scope (from outer to inner):

file
namespace    Audio
function     bool FAudioDebugger::IsVirtualLoopVisualizeEnabled

Source code excerpt:

	bool FAudioDebugger::IsVirtualLoopVisualizeEnabled()
	{
		return static_cast<bool>(VirtualLoopsVisualizeEnabledCVar);
	}

	#if WITH_EDITOR
	void FAudioDebugger::OnBeginPIE()
	{
		FAudioDeviceManager* DeviceManager = GEngine->GetAudioDeviceManager();

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/AudioDebug.cpp:1246

Scope (from outer to inner):

file
namespace    Audio
function     void FAudioDebugger::DrawDebugInfo

Source code excerpt:

		}

		if (!VirtualLoopsVisualizeEnabledCVar)
		{
			return;
		}

		FAudioDeviceManager* DeviceManager = GEngine->GetAudioDeviceManager();
		if (DeviceManager && DeviceManager->IsVisualizeDebug3dEnabled())