MovieSceneAkAudioRTPCSection.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*******************************************************************************
  2. The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
  3. Technology released in source code form as part of the game integration package.
  4. The content of this file may not be used without valid licenses to the
  5. AUDIOKINETIC Wwise Technology.
  6. Note that the use of the game engine is subject to the Unreal(R) Engine End User
  7. License Agreement at https://www.unrealengine.com/en-US/eula/unreal
  8. License Usage
  9. Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
  10. this file in accordance with the end user license agreement provided with the
  11. software or, alternatively, in accordance with the terms contained
  12. in a written agreement between you and Audiokinetic Inc.
  13. Copyright (c) 2023 Audiokinetic Inc.
  14. *******************************************************************************/
  15. #pragma once
  16. #include "AkInclude.h"
  17. #include "WwiseDefines.h"
  18. #include "AkRtpc.h"
  19. #include "Curves/RichCurve.h"
  20. #include "MovieSceneSection.h"
  21. #include "MovieSceneFloatChannelSerializationHelper.h"
  22. #include "Channels/MovieSceneFloatChannel.h"
  23. #include "MovieSceneAkAudioRTPCSection.generated.h"
  24. /**
  25. * A single floating point section
  26. */
  27. UCLASS()
  28. class AKAUDIO_API UMovieSceneAkAudioRTPCSection
  29. : public UMovieSceneSection
  30. {
  31. GENERATED_BODY()
  32. UMovieSceneAkAudioRTPCSection(const FObjectInitializer& Init);
  33. virtual void PostLoad() override;
  34. virtual void Serialize(FArchive& Ar) override;
  35. public:
  36. FMovieSceneFloatChannel GetChannel() const { return RTPCChannel; }
  37. float GetStartTime() const;
  38. float GetEndTime() const;
  39. #if !UE_4_26_OR_LATER
  40. virtual FMovieSceneEvalTemplatePtr GenerateTemplate() const override;
  41. #endif
  42. /** @return the name of the RTPC being modified by this track */
  43. FString GetRTPCName() const { return RTPC ? RTPC->GetName() : Name; }
  44. /**
  45. * Sets the name of the RTPC being modified by this track
  46. *
  47. * @param InRTPCName The RTPC being modified
  48. */
  49. void SetRTPCName(const FString& InRTPCName) { Name = InRTPCName; }
  50. void SetRTPC(UAkRtpc* InRTPC) { RTPC = InRTPC; }
  51. #if WITH_EDITOR
  52. virtual void PreEditChange(FProperty* PropertyAboutToChange) override;
  53. virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
  54. #endif
  55. protected:
  56. UPROPERTY(EditAnywhere, Category = "AkAudioRTPC", meta = (NoResetToDefault))
  57. UAkRtpc* RTPC = nullptr;
  58. /** Name of the RTPC to modify. */
  59. UPROPERTY(EditAnywhere, AdvancedDisplay, Category = "AkAudioRTPC", meta = (NoResetToDefault))
  60. FString Name;
  61. /** Curve data */
  62. UPROPERTY()
  63. FRichCurve FloatCurve;
  64. // Enabled serialization of RTPCChannel when 4.24 support was added.
  65. UPROPERTY()
  66. FMovieSceneFloatChannelSerializationHelper FloatChannelSerializationHelper;
  67. UPROPERTY()
  68. FMovieSceneFloatChannel RTPCChannel;
  69. private:
  70. #if WITH_EDITOR
  71. bool IsRTPCNameValid();
  72. FString PreviousName;
  73. #endif
  74. };