123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- #pragma once
- #include "AkAudioDevice.h"
- #include "AkGameplayTypes.h"
- #include "Components/SceneComponent.h"
- #include "AkGameObject.generated.h"
- UCLASS(ClassGroup=Audiokinetic, BlueprintType, Blueprintable, hidecategories=(Transform,Rendering,Mobility,LOD,Component,Activation), AutoExpandCategories=AkComponent, meta=(BlueprintSpawnableComponent))
- class AKAUDIO_API UAkGameObject: public USceneComponent
- {
- GENERATED_BODY()
- public:
- UAkGameObject(const class FObjectInitializer& ObjectInitializer);
-
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="AkEvent")
- UAkAudioEvent* AkAudioEvent = nullptr;
-
- UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category = "AkEvent")
- FString EventName;
-
- UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category="Audiokinetic|AkGameObject", meta = (AdvancedDisplay = "2", AutoCreateRefTerm = "PostEventCallback,ExternalSources"))
- virtual int32 PostAssociatedAkEvent(
- UPARAM(meta = (Bitmask, BitmaskEnum = "/Script/AkAudio.EAkCallbackType")) int32 CallbackMask,
- const FOnAkPostEventCallback& PostEventCallback);
- UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkGameObject", meta = (AutoCreateRefTerm = "PostEventCallback,ExternalSources", Latent, LatentInfo = "LatentInfo", WorldContext = "WorldContextObject"))
- virtual void PostAssociatedAkEventAsync(const UObject* WorldContextObject,
- UPARAM(meta = (Bitmask, BitmaskEnum = "/Script/AkAudio.EAkCallbackType")) int32 CallbackMask,
- const FOnAkPostEventCallback& PostEventCallback,
- FLatentActionInfo LatentInfo,
- int32& PlayingID);
-
- UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkGameObject", meta = (AdvancedDisplay = "1", AutoCreateRefTerm = "PostEventCallback,ExternalSources"))
- virtual int32 PostAkEvent(
- class UAkAudioEvent * AkEvent,
- UPARAM(meta = (Bitmask, BitmaskEnum = "/Script/AkAudio.EAkCallbackType")) int32 CallbackMask,
- const FOnAkPostEventCallback& PostEventCallback,
- const FString& InEventName
- );
- virtual AkPlayingID PostAkEvent(UAkAudioEvent* AkEvent, AkUInt32 Flags = 0, AkCallbackFunc UserCallback = nullptr, void* UserCookie = nullptr);
-
- UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkGameObject", meta = (AdvancedDisplay = "3", AutoCreateRefTerm = "PostEventCallback,ExternalSources", Latent, LatentInfo = "LatentInfo", WorldContext = "WorldContextObject"))
- virtual void PostAkEventAsync(const UObject* WorldContextObject,
- class UAkAudioEvent* AkEvent,
- int32& PlayingID,
- UPARAM(meta = (Bitmask, BitmaskEnum = "/Script/AkAudio.EAkCallbackType")) int32 CallbackMask,
- const FOnAkPostEventCallback& PostEventCallback,
- FLatentActionInfo LatentInfo
- );
-
- UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkComponent")
- virtual void Stop();
-
- AK_DEPRECATED(2022.1, "Use PostAkEvent.")
- virtual AkPlayingID PostAkEventByNameWithDelegate(
- UAkAudioEvent* AkEvent,
- const FString& InEventName,
- int32 CallbackMask,
- const FOnAkPostEventCallback& PostEventCallback);
-
- AK_DEPRECATED(2022.1, "Use PostAkEvent.")
- virtual void PostAkEventAsyncByEvent(const UObject* WorldContextObject,
- class UAkAudioEvent* AkEvent,
- int32 CallbackMask,
- const FOnAkPostEventCallback& PostEventCallback,
- FLatentActionInfo LatentInfo,
- int32& PlayingID
- );
-
- UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkGameObject", meta = (AdvancedDisplay = "3"))
- void SetRTPCValue(class UAkRtpc const* RTPCValue, float Value, int32 InterpolationTimeMs, FString RTPC) const;
-
- UFUNCTION(BlueprintCallable, BlueprintCosmetic, Category = "Audiokinetic|AkGameObject", meta = (AdvancedDisplay = "RTPC"))
- void GetRTPCValue(class UAkRtpc const* RTPCValue, ERTPCValueType InputValueType, float& Value, ERTPCValueType& OutputValueType, FString RTPC, int32 PlayingID = 0) const;
- AK_DEPRECATED(2019.1.3, "This function is deprecated and will be removed in future releases.")
- void GetRTPCValue(FString RTPC, int32 PlayingID, ERTPCValueType InputValueType, float& Value, ERTPCValueType& OutputValueType) const;
- #if CPP
- bool VerifyEventName(const FString& InEventName) const;
- bool AllowAudioPlayback() const;
- AkGameObjectID GetAkGameObjectID() const;
- virtual void UpdateObstructionAndOcclusion() {};
- bool HasActiveEvents() const;
- #endif
- bool HasBeenRegisteredWithWwise() const { return IsRegisteredWithWwise; }
- void EventPosted() {bEventPosted = true;}
- protected:
-
- bool bEventPosted;
- bool IsRegisteredWithWwise = false;
- };
|