UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SoundNodeWavePlayer.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3
4#pragma once
5
6#include "CoreMinimal.h"
10#include "SoundNodeWavePlayer.generated.h"
11
12class FAudioDevice;
13class USoundWave;
14struct FActiveSound;
17struct FWaveInstance;
18
22UCLASS(hidecategories=Object, editinlinenew, MinimalAPI, meta=( DisplayName="Wave Player" ))
24{
26
27private:
28 UPROPERTY(EditAnywhere, Category=WavePlayer, meta=(DisplayName="Sound Wave"))
29 TSoftObjectPtr<USoundWave> SoundWaveAssetPtr;
30
33
34 void OnSoundWaveLoaded(const FName& PackageName, UPackage * Package, EAsyncLoadingResult::Type Result, bool bAddToRoot);
35
36 uint8 bAsyncLoading:1;
37
38public:
39
40 UPROPERTY(EditAnywhere, Category=WavePlayer)
41 uint8 bLooping:1;
42
44 // Set to true when we enqueue a task to the game thread to load
45 // the asset associated with this thread.
46 // This only occurs if ClearAssetReferences() was called and we still tried to play this wave player,
47 // likely because the quality level was changed.
48 FThreadSafeBool bAsyncLoadRequestPending;
49
50public:
51
52 USoundWave* GetSoundWave() const { return SoundWave; }
53 ENGINE_API void SetSoundWave(USoundWave* SoundWave);
54
55 //~ Begin UObject Interface
56 virtual void Serialize(FArchive& Ar) override;
57#if WITH_EDITOR
58 virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
59#endif
60 //~ End UObject Interface
61
62 //~ Begin USoundNode Interface
63 virtual int32 GetMaxChildNodes() const override;
64 virtual float GetDuration() override;
65 virtual bool IsPlayWhenSilent() const override;
67 virtual void ParseNodes(FAudioDevice* AudioDevice, const UPTRINT NodeWaveInstanceHash, FActiveSound& ActiveSound, const FSoundParseParameters& ParseParams, TArray<FWaveInstance*>& WaveInstances) override;
68#if WITH_EDITOR
69 virtual FText GetTitle() const override;
70#endif
71 //~ End USoundNode Interface
72
73 //~ Begin USoundNodeAssetReferencer Interface
74 virtual void LoadAsset(bool bAddToRoot = false) override;
75 virtual void ClearAssetReferences() override;
76 virtual bool ContainsProceduralSoundReference() const override;
77 //~ End USoundNode Interface
78
79 // If this returns true, this wave player currently has an async load for the USoundWave in flight.
80 bool IsCurrentlyAsyncLoadingAsset() const { return bAsyncLoading; }
81};
82
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::UPTRINT UPTRINT
An unsigned integer the same size as a pointer.
Definition Platform.h:1146
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
int32 ParseParams(const FString &ParamStr, TArray< FString > &OutArray)
Definition NativeJSScripting.cpp:193
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UCLASS(...)
Definition ObjectMacros.h:776
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
Definition AudioDevice.h:417
Definition NameTypes.h:617
Definition Text.h:385
Definition ThreadSafeBool.h:17
Definition Array.h:670
Definition Package.h:216
Definition SoundNodeAssetReferencer.h:16
Definition SoundNodeWavePlayer.h:24
bool IsCurrentlyAsyncLoadingAsset() const
Definition SoundNodeWavePlayer.h:80
virtual int32 GetNumSounds(const UPTRINT NodeWaveInstanceHash, FActiveSound &ActiveSound) const
Definition SoundNodeWavePlayer.h:66
Definition SoundWave.h:417
Type
Definition UObjectGlobals.h:694
Definition ActiveSound.h:283
Definition UnrealType.h:6865
Definition ActiveSound.h:64
Definition Audio.h:180
FActiveSound * ActiveSound
Definition Audio.h:208
Definition ObjectPtr.h:488
Definition SoftObjectPtr.h:174