Documentation for the Unreal C++ Plugin
Loading...
Searching...
No Matches
SoundManager.h
Go to the documentation of this file.
1// Copyright(c) Pixo Group. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "Sound/SoundCue.h"
8#include "Engine/DataTable.h"
9#include "SoundManager.generated.h"
10
14USTRUCT(BlueprintType)
15struct FStepVO : public FTableRowBase
16{
18 UPROPERTY(EditAnywhere, BlueprintReadOnly)
19 FText StepName;
20 UPROPERTY(EditAnywhere, BlueprintReadOnly)
21 USoundCue* SoundCue;
22};
23
27USTRUCT(BlueprintType)
29{
31 UPROPERTY(EditAnywhere, BlueprintReadOnly)
32 TArray<FText> ParametersName;
33 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
34 int32 StoryIndex;
35 UPROPERTY(EditAnywhere, BlueprintReadOnly)
36 UDataTable* DependentSoundTable;
37};
38
42USTRUCT(BlueprintType)
46 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Background Sound")
47 USoundBase* Sound;
48 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Background Sound")
49 TArray<FText> AppropriateStoryParams;
50};
51
55UCLASS()
57{
59
60public:
61 UPROPERTY(EditAnywhere, BlueprintReadOnly)
63};
64
66
70UCLASS(Blueprintable)
71class PIXOCORE_API USoundManager : public UBaseManager
92 UFUNCTION(BlueprintCallable)
93 USoundCue* GetSoundBasedOnStep(FText stepName, UDataTable* DataTable);
94 UFUNCTION(BlueprintCallable, Category = "Play Sound")
95 void PlaySound(USoundCue* soundToPlay);
100 UFUNCTION(BlueprintCallable, meta = (AdvancedDisplay = 1), Category = "Play Sound")
101 void PlayBackgroundSound(
102 USoundBase* soundToPlay,
103 float volumeMultiplier = 1.f,
104 float pitchMultiplier = 1.f,
105 float startTime = 0.f,
106 USoundConcurrency* concurrencySettings = nullptr,
107 AActor* owningActor = nullptr,
108 bool bIsUISound = false);
112 UFUNCTION(BlueprintCallable, Category = "Play Sound")
113 void PlaySFXSound(USoundBase* soundToPlay);
117 UFUNCTION(BlueprintCallable)
118 void OnStepChange(FText stepName);
122 UFUNCTION()
123 void OnAudioEndPlaying();
125 UPROPERTY(BlueprintReadWrite, Category = "Components")
126 UAudioComponent* AudioComponent;
127 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
128 TArray<UDataTable*> StepVODataTablesArray;
129 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
130 TArray<UDataTable*> StepHintVODataTablesArray;
131 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = 0.f), Category = "SoundManager")
132 float GeneralSoundVolumeMultiplier = 1.f;
133 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = 0.f), Category = "SoundManager")
134 float SFXVolumeMultiplier = 1.f;
135 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SoundManager")
136 USoundManagerParametersData* SoundManagerParametersData;
137 // Background Sound parameters
138 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SoundManager")
139 bool bPlayBackgroundSound = false;
140 UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (EditCondition="bPlayBackgroundSound", EditConditionHides="bPlayBackgroundSound"), Category = "SoundManager")
141 TArray<FBackgroundSound> BackgroundSounds {};
142 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta = (ClampMin = 0.f, EditCondition="bPlayBackgroundSound", EditConditionHides="bPlayBackgroundSound"), Category = "SoundManager")
143 float BackgroundVolumeMultiplier = 1.f;
145 UPROPERTY(BlueprintReadWrite, Category = "Components")
146 UDataTable* CurrentStepVODataTable;
147 UPROPERTY(BlueprintReadWrite, Category = "Components")
148 UDataTable* CurrentStepHintVODataTable;
149 UPROPERTY(BlueprintAssignable)
150 FOnVOEndPlaying OnVoEndPlaying;
151
152protected:
153 UPROPERTY()
154 USoundCue* ActiveSound;
155 FText CurrentStep;
156};
#define DECLARE_EVENT_HANDLER(TEvent)
Definition BaseManager.h:11
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnVOEndPlaying)
It provides functionalities for handling events, sending events, and managing a private owner....
Definition BaseManager.h:32
Event used to call when hint activated or deactivated.
Event called when we on init experience.
Event called when new step is loaded.
Event called when new story is loaded.
Event used to call to play sound.
Manager that provides functionality for managing VOs and Hint VOs. To use this class you must attach ...
DECLARE_EVENT_HANDLER(UNewStepLoadedEvent)
USoundCue * ActiveSound
UPROPERTY()
TArray< UDataTable * > StepVODataTablesArray
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
DECLARE_EVENT_HANDLER(UNewStoryLoadedEvent)
DECLARE_EVENT_HANDLER(UInitializationEvent)
FOnVOEndPlaying OnVoEndPlaying
UPROPERTY(BlueprintAssignable)
UAudioComponent * AudioComponent
UPROPERTY(BlueprintReadWrite, Category = "Components")
DECLARE_EVENT_HANDLER(UPlaySoundEvent)
UDataTable * CurrentStepHintVODataTable
UPROPERTY(BlueprintReadWrite, Category = "Components")
TArray< UDataTable * > StepHintVODataTablesArray
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
DECLARE_EVENT_HANDLER(UHintActivatedEvent)
USoundManagerParametersData * SoundManagerParametersData
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SoundManager")
UDataTable * CurrentStepVODataTable
UPROPERTY(BlueprintReadWrite, Category = "Components")
Represents a data asset containing Sound Manager parameters. Setup this data asset if you want to hav...
TArray< FSoundManagerParameter > Data
UPROPERTY(EditAnywhere, BlueprintReadOnly)
Represents a parameter used by the Background Sound.
TArray< FText > AppropriateStoryParams
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Background Sound")
USoundBase * Sound
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Background Sound")
Represents a parameter used by the Sound Manager that will be passed as you load story.
int32 StoryIndex
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
TArray< FText > ParametersName
UPROPERTY(EditAnywhere, BlueprintReadOnly)
UDataTable * DependentSoundTable
UPROPERTY(EditAnywhere, BlueprintReadOnly)
Represents a Step Value Object used for storing step data in a data table.
USoundCue * SoundCue
UPROPERTY(EditAnywhere, BlueprintReadOnly)
GENERATED_BODY()
FText StepName
UPROPERTY(EditAnywhere, BlueprintReadOnly)