au.EnableUserSoundwaveImport
au.EnableUserSoundwaveImport
#Overview
name: au.EnableUserSoundwaveImport
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables letting the user import soundwaves in editor.\n0: Disabled, 1: Enabled
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.EnableUserSoundwaveImport is to control whether users can import soundwaves in the Unreal Engine editor. This setting is part of the audio system and specifically relates to the sound import functionality.
This setting variable is primarily used in the AudioEditor module, specifically within the SoundFactory.cpp file. It’s a part of the editor’s audio import system.
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 configuration files.
The associated variable EnableUserSoundwaveImportCvar directly interacts with au.EnableUserSoundwaveImport. They share the same value, with EnableUserSoundwaveImportCvar being the actual integer variable that’s checked in the code.
Developers must be aware that setting this variable to 0 will disable the ability for users to import soundwaves in the editor. This could significantly impact workflow if audio designers or developers need to import new sound assets.
Best practices when using this variable include:
- Ensuring it’s enabled (set to 1) during development to allow for sound asset imports.
- Considering disabling it (set to 0) in shipping builds to prevent unauthorized sound imports.
- Documenting any changes to this setting in project configuration files to maintain consistency across the development team.
Regarding the associated variable EnableUserSoundwaveImportCvar:
The purpose of EnableUserSoundwaveImportCvar is to serve as the actual integer variable that stores the state of the sound import setting.
This variable is used within the AudioEditor module, specifically in the CanImportSoundWaves() function to determine if sound wave import is allowed.
The value of EnableUserSoundwaveImportCvar is set through the CVar system, linked to the au.EnableUserSoundwaveImport console variable.
It directly interacts with au.EnableUserSoundwaveImport, serving as the actual variable that’s checked in the code to determine if sound import is enabled.
Developers should be aware that this variable is the one actually checked in the code, so any runtime changes to au.EnableUserSoundwaveImport will be reflected in EnableUserSoundwaveImportCvar.
Best practices include:
- Not modifying EnableUserSoundwaveImportCvar directly, but instead using the au.EnableUserSoundwaveImport console variable to change its value.
- Being cautious when reading this variable in other parts of the code, as its value can change at runtime.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/AudioEditor/Private/Factories/SoundFactory.cpp:31
Scope: file
Source code excerpt:
static int32 EnableUserSoundwaveImportCvar = 1;
FAutoConsoleVariableRef CVarEnableUserSoundwaveImport(
TEXT("au.EnableUserSoundwaveImport"),
EnableUserSoundwaveImportCvar,
TEXT("Enables letting the user import soundwaves in editor.\n")
TEXT("0: Disabled, 1: Enabled"),
ECVF_Default);
static float SoundWaveImportLengthLimitInSecondsCVar = -1.f;
#Associated Variable and Callsites
This variable is associated with another variable named EnableUserSoundwaveImportCvar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/AudioEditor/Private/Factories/SoundFactory.cpp:29
Scope: file
Source code excerpt:
// Disable user import
static int32 EnableUserSoundwaveImportCvar = 1;
FAutoConsoleVariableRef CVarEnableUserSoundwaveImport(
TEXT("au.EnableUserSoundwaveImport"),
EnableUserSoundwaveImportCvar,
TEXT("Enables letting the user import soundwaves in editor.\n")
TEXT("0: Disabled, 1: Enabled"),
ECVF_Default);
static float SoundWaveImportLengthLimitInSecondsCVar = -1.f;
FAutoConsoleVariableRef CVarSoundWaveImportLengthLimitInSeconds(
#Loc: <Workspace>/Engine/Source/Editor/AudioEditor/Private/Factories/SoundFactory.cpp:52
Scope (from outer to inner):
file
namespace anonymous
function bool CanImportSoundWaves
Source code excerpt:
{
// disabled via cvar?
if(EnableUserSoundwaveImportCvar == 0)
{
return false;
}
IAssetTools& AssetTools = FAssetToolsModule::GetModule().Get();
TSharedPtr<FPathPermissionList> AssetClassPermissionList = AssetTools.GetAssetClassPathPermissionList(EAssetClassAction::ImportAsset);