au.Debug.Sounds.TextColor

au.Debug.Sounds.TextColor

#Overview

name: au.Debug.Sounds.TextColor

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

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of au.Debug.Sounds.TextColor is to control the color of body text in audio debug views within Unreal Engine 5. This setting variable is specifically used for debugging and visualization purposes in the audio system.

This setting variable is primarily used in the Engine module, specifically within the audio debugging subsystem. Based on the callsites, it’s clear that this variable is utilized in the AudioDebug.cpp file, which is part of the Engine’s runtime.

The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of “White” and can be changed at runtime using console commands.

The au.Debug.Sounds.TextColor variable interacts directly with the AudioDebugStatSoundTextColorCVar variable. They share the same value, with AudioDebugStatSoundTextColorCVar being the actual storage for the color string.

Developers should be aware that this variable accepts specific color string values: “White”, “Red”, “Orange”, “Yellow”, “Blue”, “Magenta”, “Purple”, and “Black”. Any other value will default to white.

Best practices when using this variable include:

  1. Using it only for debugging purposes, not for release builds.
  2. Changing the color to improve visibility based on the game’s visual style or debugging needs.
  3. Being consistent with color usage across different debug views for better readability.

Regarding the associated variable AudioDebugStatSoundTextColorCVar:

The purpose of AudioDebugStatSoundTextColorCVar is to store the actual string value of the selected color for audio debug text.

This variable is used directly in the GetStatSoundBodyColor() function within the Audio namespace. This function translates the string color name into an actual FColor object used for rendering.

The value of AudioDebugStatSoundTextColorCVar is set indirectly through the au.Debug.Sounds.TextColor console variable.

AudioDebugStatSoundTextColorCVar interacts primarily with the au.Debug.Sounds.TextColor console variable and is used in the color translation function.

Developers should be aware that this variable is a string and should contain only valid color names as mentioned earlier.

Best practices for AudioDebugStatSoundTextColorCVar include:

  1. Not modifying it directly, but rather using the console variable system to change its value.
  2. Ensuring that any custom debug rendering code checks for all possible color string values to avoid unexpected behavior.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

static FString AudioDebugStatSoundTextColorCVar = TEXT("White");
FAutoConsoleVariableRef CVarAudioDebugStatSoundColor(
	TEXT("au.Debug.Sounds.TextColor"),
	AudioDebugStatSoundTextColorCVar,
	TEXT("Color of body text in audio debug views. \n")
	TEXT("White, Red, Orange, Yellow, Blue, Magenta, Purple, Black"),
	ECVF_Default);

static int32 SoundCueDebugShowPathCVar = 1;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

	ECVF_Default);

static FString AudioDebugStatSoundTextColorCVar = TEXT("White");
FAutoConsoleVariableRef CVarAudioDebugStatSoundColor(
	TEXT("au.Debug.Sounds.TextColor"),
	AudioDebugStatSoundTextColorCVar,
	TEXT("Color of body text in audio debug views. \n")
	TEXT("White, Red, Orange, Yellow, Blue, Magenta, Purple, Black"),
	ECVF_Default);

static int32 SoundCueDebugShowPathCVar = 1;
FAutoConsoleVariableRef CVarAudioSoundCueDebugShowPath(

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

Scope (from outer to inner):

file
namespace    Audio
function     FColor GetStatSoundBodyColor

Source code excerpt:

	FColor GetStatSoundBodyColor()
	{
		if (AudioDebugStatSoundTextColorCVar == TEXT("Red"))
		{
			return FColor::Red;
		}
		if (AudioDebugStatSoundTextColorCVar == TEXT("Orange"))
		{
			return FColor::Orange;
		}
		if (AudioDebugStatSoundTextColorCVar == TEXT("Yellow"))
		{
			return FColor::Yellow;
		}
		if (AudioDebugStatSoundTextColorCVar == TEXT("Green"))
		{
			return FColor::Green;
		}
		if (AudioDebugStatSoundTextColorCVar == TEXT("Blue"))
		{
			return FColor::Blue;
		}
		if (AudioDebugStatSoundTextColorCVar == TEXT("Magenta"))
		{
			return FColor::Magenta;
		}
		if (AudioDebugStatSoundTextColorCVar == TEXT("Purple"))
		{
			return FColor::Purple;
		}
		if (AudioDebugStatSoundTextColorCVar == TEXT("Black"))
		{
			return FColor::Black;
		}

		return FColor::White;
	}