Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
USoundManager Class ReferenceBlueprintable

Manager that provides functionality for managing VOs and Hint VOs. To use this class you must attach data table to StepVODataTable, struct for the data table is FSteVO. More...

#include <SoundManager.h>

Inheritance diagram for USoundManager:
[legend]

Public Member Functions

 USoundManager ()
 
 DECLARE_EVENT_HANDLER (UHintActivatedEvent)
 
 DECLARE_EVENT_HANDLER (UInitializationEvent)
 
 DECLARE_EVENT_HANDLER (UNewStepLoadedEvent)
 
 DECLARE_EVENT_HANDLER (UNewStoryLoadedEvent)
 
 DECLARE_EVENT_HANDLER (UPlaySoundEvent)
 
APlayerController * GetPrivateOwner () const
 
USoundCue * GetSoundBasedOnStep (FText stepName, UDataTable *DataTable)
 Retrieves a sound cue based on the step name.
 
void HandleEvent (UBaseEvent *Event)
 
void OnAudioEndPlaying ()
 Called when audio playback ends.
 
void OnStepChange (FText stepName)
 Play SFX sound (don't interrupt others)
 
void PlayBackgroundSound (USoundBase *soundToPlay, float volumeMultiplier=1.f, float pitchMultiplier=1.f, float startTime=0.f, USoundConcurrency *concurrencySettings=nullptr, AActor *owningActor=nullptr, bool bIsUISound=false)
 Play sound based on the new step.
 
void PlaySFXSound (USoundBase *soundToPlay)
 Play independent background sound (don't interrupt others)
 
void PlaySound (USoundCue *soundToPlay)
 UFUNCTION(BlueprintCallable, Category = "Play Sound")
 
template<typename TEventType , typename... TInitializeArgs>
void SendEvent (TInitializeArgs... Arguments)
 
void SetPrivateOwner (APlayerController *Owner)
 

Public Attributes

UAudioComponent * AudioComponent
 UPROPERTY(BlueprintReadWrite, Category = "Components")
 
TArray< FBackgroundSoundBackgroundSounds {}
 UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (EditCondition="bPlayBackgroundSound", EditConditionHides="bPlayBackgroundSound"), Category = "SoundManager")
 
float BackgroundVolumeMultiplier = 1.f
 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = 0.f, EditCondition="bPlayBackgroundSound", EditConditionHides="bPlayBackgroundSound"), Category = "SoundManager")
 
bool bPlayBackgroundSound = false
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SoundManager")
 
UDataTable * CurrentStepHintVODataTable
 UPROPERTY(BlueprintReadWrite, Category = "Components")
 
UDataTable * CurrentStepVODataTable
 UPROPERTY(BlueprintReadWrite, Category = "Components")
 
float GeneralSoundVolumeMultiplier = 1.f
 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = 0.f), Category = "SoundManager")
 
FOnVOEndPlaying OnVoEndPlaying
 UPROPERTY(BlueprintAssignable)
 
float SFXVolumeMultiplier = 1.f
 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = 0.f), Category = "SoundManager")
 
USoundManagerParametersDataSoundManagerParametersData
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SoundManager")
 
TArray< UDataTable * > StepHintVODataTablesArray
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
 
TArray< UDataTable * > StepVODataTablesArray
 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
 

Protected Member Functions

void HandleEvent_Impl (class UBaseEvent *Event)
 

Protected Attributes

USoundCue * ActiveSound
 UPROPERTY()
 
FText CurrentStep
 
THandlers Handlers
 

Private Types

using THandler = TFunction<void(UBaseEvent*)>
 
using THandlerKey = UClass*
 
using THandlers = std::unordered_map<THandlerKey, THandler, THandlerHash, THandlerComp>
 

Private Member Functions

 GENERATED_BODY ()
 

Private Attributes

APlayerController * PrivateOwner
 UPROPERTY()
 

Detailed Description

Manager that provides functionality for managing VOs and Hint VOs. To use this class you must attach data table to StepVODataTable, struct for the data table is FSteVO.

UCLASS(Blueprintable)

Definition at line 117 of file SoundManager.h.

Member Typedef Documentation

◆ THandler

using UBaseManager::THandler = TFunction<void(UBaseEvent*)>
privateinherited

Definition at line 56 of file BaseManager.h.

◆ THandlerKey

using UBaseManager::THandlerKey = UClass*
privateinherited

Definition at line 55 of file BaseManager.h.

◆ THandlers

using UBaseManager::THandlers = std::unordered_map<THandlerKey, THandler, THandlerHash, THandlerComp>
privateinherited

Definition at line 74 of file BaseManager.h.

Constructor & Destructor Documentation

◆ USoundManager()

USoundManager::USoundManager ( )

Definition at line 12 of file SoundManager.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ DECLARE_EVENT_HANDLER() [1/5]

USoundManager::DECLARE_EVENT_HANDLER ( UHintActivatedEvent )

◆ DECLARE_EVENT_HANDLER() [2/5]

USoundManager::DECLARE_EVENT_HANDLER ( UInitializationEvent )

◆ DECLARE_EVENT_HANDLER() [3/5]

USoundManager::DECLARE_EVENT_HANDLER ( UNewStepLoadedEvent )

◆ DECLARE_EVENT_HANDLER() [4/5]

USoundManager::DECLARE_EVENT_HANDLER ( UNewStoryLoadedEvent )

◆ DECLARE_EVENT_HANDLER() [5/5]

USoundManager::DECLARE_EVENT_HANDLER ( UPlaySoundEvent )

◆ GENERATED_BODY()

USoundManager::GENERATED_BODY ( )
private

◆ GetPrivateOwner()

APlayerController * UBaseManager::GetPrivateOwner ( ) const
inlineinherited

Definition at line 47 of file BaseManager.h.

Here is the caller graph for this function:

◆ GetSoundBasedOnStep()

USoundCue * USoundManager::GetSoundBasedOnStep ( FText stepName,
UDataTable * DataTable )
BlueprintCallable

Retrieves a sound cue based on the step name.

Parameters
stepNameThe name of the step.
DataTableThe data table containing the sound cues.
Returns
The sound cue associated with the step name.

UFUNCTION(BlueprintCallable)

Definition at line 24 of file SoundManager.cpp.

Here is the caller graph for this function:

◆ HandleEvent()

void UBaseManager::HandleEvent ( UBaseEvent * Event)
inherited

Definition at line 11 of file BaseManager.cpp.

◆ HandleEvent_Impl()

void UBaseManager::HandleEvent_Impl ( class UBaseEvent * Event)
protectedinherited

Definition at line 24 of file BaseManager.cpp.

◆ OnAudioEndPlaying()

void USoundManager::OnAudioEndPlaying ( )

Called when audio playback ends.

UFUNCTION()

Definition at line 96 of file SoundManager.cpp.

Here is the caller graph for this function:

◆ OnStepChange()

void USoundManager::OnStepChange ( FText stepName)
BlueprintCallable

Play SFX sound (don't interrupt others)

UFUNCTION(BlueprintCallable)

Definition at line 91 of file SoundManager.cpp.

Here is the call graph for this function:

◆ PlayBackgroundSound()

void USoundManager::PlayBackgroundSound ( USoundBase * soundToPlay,
float volumeMultiplier = 1.f,
float pitchMultiplier = 1.f,
float startTime = 0.f,
USoundConcurrency * concurrencySettings = nullptr,
AActor * owningActor = nullptr,
bool bIsUISound = false )
BlueprintCallable

Play sound based on the new step.

Parameters
stepNameThe name of the new step.

UFUNCTION(BlueprintCallable, meta = (AdvancedDisplay = 1), Category = "Play Sound")

Definition at line 58 of file SoundManager.cpp.

◆ PlaySFXSound()

void USoundManager::PlaySFXSound ( USoundBase * soundToPlay)
BlueprintCallable

Play independent background sound (don't interrupt others)

UFUNCTION(BlueprintCallable, Category = "Play Sound")

Definition at line 82 of file SoundManager.cpp.

◆ PlaySound()

void USoundManager::PlaySound ( USoundCue * soundToPlay)
BlueprintCallable

UFUNCTION(BlueprintCallable, Category = "Play Sound")

Definition at line 49 of file SoundManager.cpp.

Here is the caller graph for this function:

◆ SendEvent()

template<typename TEventType , typename... TInitializeArgs>
void UBaseManager::SendEvent ( TInitializeArgs... Arguments)
inlineinherited

Definition at line 40 of file BaseManager.h.

Here is the call graph for this function:

◆ SetPrivateOwner()

void UBaseManager::SetPrivateOwner ( APlayerController * Owner)
inlineinherited

Definition at line 46 of file BaseManager.h.

Member Data Documentation

◆ ActiveSound

USoundCue* USoundManager::ActiveSound
protected

UPROPERTY()

Definition at line 263 of file SoundManager.h.

◆ AudioComponent

UAudioComponent* USoundManager::AudioComponent
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "Components")

Audio component used for playing sounds.

Definition at line 192 of file SoundManager.h.

◆ BackgroundSounds

TArray<FBackgroundSound> USoundManager::BackgroundSounds {}
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (EditCondition="bPlayBackgroundSound", EditConditionHides="bPlayBackgroundSound"), Category = "SoundManager")

Array of the background sounds to play

Definition at line 235 of file SoundManager.h.

◆ BackgroundVolumeMultiplier

float USoundManager::BackgroundVolumeMultiplier = 1.f
EditDefaultsOnlyBlueprintReadOnly

UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = 0.f, EditCondition="bPlayBackgroundSound", EditConditionHides="bPlayBackgroundSound"), Category = "SoundManager")

Volume Multiplier of background sounds Data object containing parameters for the Sound Manager. Setup this data asset if you want to have different params depending on story.

Definition at line 241 of file SoundManager.h.

◆ bPlayBackgroundSound

bool USoundManager::bPlayBackgroundSound = false
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SoundManager")

Variable indicates whether background sounds will be played

Definition at line 229 of file SoundManager.h.

◆ CurrentStep

FText USoundManager::CurrentStep
protected

Definition at line 264 of file SoundManager.h.

◆ CurrentStepHintVODataTable

UDataTable* USoundManager::CurrentStepHintVODataTable
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "Components")

Data table for the current story with step hint voice-over (VO) data.

Definition at line 252 of file SoundManager.h.

◆ CurrentStepVODataTable

UDataTable* USoundManager::CurrentStepVODataTable
BlueprintReadWrite

UPROPERTY(BlueprintReadWrite, Category = "Components")

Data table for the current story with step voice-over (VO) data.

Definition at line 247 of file SoundManager.h.

◆ GeneralSoundVolumeMultiplier

float USoundManager::GeneralSoundVolumeMultiplier = 1.f
EditDefaultsOnlyBlueprintReadOnly

UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = 0.f), Category = "SoundManager")

Volume Multiplier of general sound

Definition at line 210 of file SoundManager.h.

◆ Handlers

THandlers UBaseManager::Handlers
protectedinherited

Definition at line 77 of file BaseManager.h.

◆ OnVoEndPlaying

FOnVOEndPlaying USoundManager::OnVoEndPlaying
BlueprintAssignable

UPROPERTY(BlueprintAssignable)

Delegate called when voice-over (VO) playback ends.

Definition at line 257 of file SoundManager.h.

◆ PrivateOwner

APlayerController* UBaseManager::PrivateOwner
privateinherited

UPROPERTY()

Definition at line 53 of file BaseManager.h.

◆ SFXVolumeMultiplier

float USoundManager::SFXVolumeMultiplier = 1.f
EditDefaultsOnlyBlueprintReadOnly

UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = 0.f), Category = "SoundManager")

Volume Multiplier of sfx

Definition at line 216 of file SoundManager.h.

◆ SoundManagerParametersData

USoundManagerParametersData* USoundManager::SoundManagerParametersData
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SoundManager")

Definition at line 222 of file SoundManager.h.

◆ StepHintVODataTablesArray

TArray<UDataTable*> USoundManager::StepHintVODataTablesArray
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")

Array of step hint voice-over (VO) data tables for each story.

Definition at line 204 of file SoundManager.h.

◆ StepVODataTablesArray

TArray<UDataTable*> USoundManager::StepVODataTablesArray
BlueprintReadWriteEditAnywhere

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")

Array of step voice-over (VO) data tables for each story.

Definition at line 198 of file SoundManager.h.


The documentation for this class was generated from the following files: