PlayheadColor
PlayheadColor
#Overview
name: PlayheadColor
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 13
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of PlayheadColor is to define the color of the playhead in audio waveform editing tools within Unreal Engine 5. This variable is used to visually represent the current playback position in audio editing interfaces.
The PlayheadColor setting variable is primarily used in the WaveformEditor plugin and the AudioWidgets module. These are part of Unreal Engine’s audio editing and visualization subsystems.
The value of this variable is typically set in the UWaveformEditorWidgetsSettings class, which is a subclass of UDeveloperSettings. It can be configured through the project settings in the Unreal Engine editor.
PlayheadColor interacts with other variables related to audio visualization, such as WaveformColor, RulerBackgroundColor, and RulerTicksColor. These variables work together to create a cohesive visual style for audio editing interfaces.
Developers should be aware that changes to PlayheadColor will affect multiple components of the audio editing interface, including the playhead overlay and time ruler. It’s important to choose a color that contrasts well with the waveform and background colors for optimal visibility.
Best practices when using this variable include:
- Ensuring the chosen color provides good contrast against the waveform and background.
- Considering accessibility for color-blind users when selecting the color.
- Maintaining consistency with the overall color scheme of the audio editing interface.
- Using the provided setter methods (e.g., SetPlayheadColor) when modifying the value programmatically to ensure proper updates to the UI.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Plugins/Editor/WaveformEditor/Config/BaseWaveformEditor.ini:2, section: [/Script/WaveformEditorWidgets.WaveformEditorWidgetsSettings]
- INI Section:
/Script/WaveformEditorWidgets.WaveformEditorWidgetsSettings
- Raw value:
(R=1.000000,G=0.100000,B=0.200000,A=1.000000)
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Editor/WaveformEditor/Source/WaveformEditorWidgets/Private/WaveformEditorStyle.cpp:107
Scope: file
Source code excerpt:
CreateWaveformViewerStyleFromSettings(*Settings);
}
else if (PropertyName == GET_MEMBER_NAME_CHECKED(UWaveformEditorWidgetsSettings, PlayheadColor))
{
CreatePlayheadOverlayStyleFromSettings(*Settings);
CreateTimeRulerStyleFromSettings(*Settings);
}
else if (PropertyName == GET_MEMBER_NAME_CHECKED(UWaveformEditorWidgetsSettings, RulerBackgroundColor))
{
#Loc: <Workspace>/Engine/Plugins/Editor/WaveformEditor/Source/WaveformEditorWidgets/Private/WaveformEditorStyle.cpp:167
Scope (from outer to inner):
file
function FPlayheadOverlayStyle FWaveformEditorStyle::CreatePlayheadOverlayStyleFromSettings
Source code excerpt:
FPlayheadOverlayStyle FWaveformEditorStyle::CreatePlayheadOverlayStyleFromSettings(const UWaveformEditorWidgetsSettings& InSettings)
{
FPlayheadOverlayStyle PlayheadOverlayStyle = FPlayheadOverlayStyle().SetPlayheadColor(InSettings.PlayheadColor);
OnNewPlayheadOverlayStyle.Broadcast(PlayheadOverlayStyle);
return PlayheadOverlayStyle;
}
#Loc: <Workspace>/Engine/Plugins/Editor/WaveformEditor/Source/WaveformEditorWidgets/Private/WaveformEditorStyle.cpp:177
Scope (from outer to inner):
file
function FFixedSampleSequenceRulerStyle FWaveformEditorStyle::CreateTimeRulerStyleFromSettings
Source code excerpt:
{
FFixedSampleSequenceRulerStyle TimeRulerStyle = FFixedSampleSequenceRulerStyle()
.SetHandleColor(InSettings.PlayheadColor)
.SetTicksColor(InSettings.RulerTicksColor)
.SetTicksTextColor(InSettings.RulerTextColor)
.SetHandleColor(InSettings.PlayheadColor)
.SetFontSize(InSettings.RulerFontSize)
.SetBackgroundColor(InSettings.RulerBackgroundColor);
const ISlateStyle* AudioWidgetsStyle = FSlateStyleRegistry::FindSlateStyle("AudioWidgetsStyle");
if (ensure(AudioWidgetsStyle))
{
#Loc: <Workspace>/Engine/Plugins/Editor/WaveformEditor/Source/WaveformEditorWidgets/Private/WaveformEditorWidgetsSettings.cpp:4
Scope (from outer to inner):
file
function UWaveformEditorWidgetsSettings::UWaveformEditorWidgetsSettings
Source code excerpt:
UWaveformEditorWidgetsSettings::UWaveformEditorWidgetsSettings(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, PlayheadColor(FLinearColor(255.f, 0.1f, 0.2f, 1.f))
, WaveformColor(FLinearColor::White)
, WaveformLineThickness(1.f)
, SampleMarkersSize(2.5f)
, WaveformBackgroundColor(FLinearColor(0.02f, 0.02f, 0.02f, 1.f))
, ZeroCrossingLineThickness(1.f)
, MajorGridColor(FLinearColor::Black)
#Loc: <Workspace>/Engine/Plugins/Editor/WaveformEditor/Source/WaveformEditorWidgets/Private/WaveformEditorWidgetsSettings.h:33
Scope (from outer to inner):
file
class class UWaveformEditorWidgetsSettings : public UDeveloperSettings
Source code excerpt:
UPROPERTY(config, EditAnywhere, Category = "Playhead")
FLinearColor PlayheadColor;
UPROPERTY(config, EditAnywhere, Category = "Waveform Viewer")
FLinearColor WaveformColor;
UPROPERTY(config, EditAnywhere, Category = "Waveform Viewer", Meta = (ClampMin = "1", ClampMax = "10"))
float WaveformLineThickness;
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioWidgets/Source/AudioWidgets/Private/AudioWidgetsSlateTypes.cpp:12
Scope (from outer to inner):
file
namespace AudioWidgetStylesSharedParams
Source code excerpt:
{
const FLazyName BackgroundBrushName = "WhiteBrush";
const FLinearColor PlayheadColor = FLinearColor(255.f, 0.1f, 0.2f, 1.f);
const FLinearColor RulerTicksColor = FLinearColor(1.f, 1.f, 1.f, 0.9f);
const float DefaultHeight = 720.f;
const float DefaultWidth = 1280.f;
}
// Audio Text Box Style
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioWidgets/Source/AudioWidgets/Private/AudioWidgetsSlateTypes.cpp:114
Scope (from outer to inner):
file
function FPlayheadOverlayStyle::FPlayheadOverlayStyle
Source code excerpt:
FPlayheadOverlayStyle::FPlayheadOverlayStyle()
: PlayheadColor(AudioWidgetStylesSharedParams::PlayheadColor)
, PlayheadWidth(1.0f)
, DesiredWidth(AudioWidgetStylesSharedParams::DefaultWidth)
, DesiredHeight(AudioWidgetStylesSharedParams::DefaultHeight)
{
}
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioWidgets/Source/AudioWidgets/Private/AudioWidgetsSlateTypes.cpp:131
Scope (from outer to inner):
file
function FFixedSampleSequenceRulerStyle::FFixedSampleSequenceRulerStyle
Source code excerpt:
FFixedSampleSequenceRulerStyle::FFixedSampleSequenceRulerStyle()
: HandleWidth(15.f)
, HandleColor(AudioWidgetStylesSharedParams::PlayheadColor)
, HandleBrush()
, TicksColor(AudioWidgetStylesSharedParams::RulerTicksColor)
, TicksTextColor(AudioWidgetStylesSharedParams::RulerTicksColor)
, TicksTextFont(FAppStyle::GetFontStyle("Regular"))
, TicksTextOffset(5.f)
, BackgroundColor(FLinearColor::Black)
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioWidgets/Source/AudioWidgets/Private/SPlayheadOverlay.cpp:5
Scope (from outer to inner):
file
function void SPlayheadOverlay::Construct
Source code excerpt:
{
check(InArgs._Style);
PlayheadColor = InArgs._Style->PlayheadColor;
PlayheadWidth = InArgs._Style->PlayheadWidth;
DesiredWidth = InArgs._Style->DesiredWidth;
DesiredHeight = InArgs._Style->DesiredHeight;
}
void SPlayheadOverlay::SetPlayheadPosition(const float InNewPosition)
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioWidgets/Source/AudioWidgets/Private/SPlayheadOverlay.cpp:18
Scope (from outer to inner):
file
function void SPlayheadOverlay::OnStyleUpdated
Source code excerpt:
void SPlayheadOverlay::OnStyleUpdated(const FPlayheadOverlayStyle UpdatedStyle)
{
PlayheadColor = UpdatedStyle.PlayheadColor;
PlayheadWidth = UpdatedStyle.PlayheadWidth;
DesiredWidth = UpdatedStyle.DesiredWidth;
DesiredHeight = UpdatedStyle.DesiredHeight;
}
int32 SPlayheadOverlay::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioWidgets/Source/AudioWidgets/Private/SPlayheadOverlay.cpp:44
Scope (from outer to inner):
file
function int32 SPlayheadOverlay::DrawPlayhead
Source code excerpt:
LinePoints,
ESlateDrawEffect::None,
PlayheadColor.GetSpecifiedColor(),
true,
PlayheadWidth
);
return ++LayerId;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioWidgets/Source/AudioWidgets/Public/AudioWidgetsSlateTypes.h:248
Scope: file
Source code excerpt:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Appearance)
FSlateColor PlayheadColor;
FPlayheadOverlayStyle& SetPlayheadColor(const FSlateColor InPlayheadColor) { PlayheadColor = InPlayheadColor; return *this; }
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Appearance)
float PlayheadWidth;
FPlayheadOverlayStyle& SetPlayheadWidth(const float InPlayheadWidth) { PlayheadWidth = InPlayheadWidth; return *this; }
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Appearance)
#Loc: <Workspace>/Engine/Plugins/Runtime/AudioWidgets/Source/AudioWidgets/Public/SPlayheadOverlay.h:30
Scope (from outer to inner):
file
class class SPlayheadOverlay : public SLeafWidget
Source code excerpt:
const FPlayheadOverlayStyle* Style = nullptr;
FSlateColor PlayheadColor = FLinearColor(255.f, 0.1f, 0.2f, 1.f);
float PlayheadWidth = 1.0;
float DesiredWidth = 0.f;
float DesiredHeight = 0.f;
float PlayheadPosition = 0.f;
};