MovieSceneAkAudioRTPCTrack.cpp 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #include "MovieSceneAkAudioRTPCTrack.h"
  16. #include "AkAudioDevice.h"
  17. #include "IMovieScenePlayer.h"
  18. #include "MovieSceneCommonHelpers.h"
  19. #include "MovieSceneAkAudioRTPCSection.h"
  20. #include "MovieSceneAkAudioRTPCTemplate.h"
  21. FMovieSceneEvalTemplatePtr UMovieSceneAkAudioRTPCTrack::CreateTemplateForSection(const UMovieSceneSection& InSection) const
  22. {
  23. #if UE_4_26_OR_LATER
  24. return FMovieSceneAkAudioRTPCTemplate(*CastChecked<UMovieSceneAkAudioRTPCSection>(&InSection));
  25. #else
  26. return InSection.GenerateTemplate();
  27. #endif
  28. }
  29. UMovieSceneSection* UMovieSceneAkAudioRTPCTrack::CreateNewSection()
  30. {
  31. return NewObject<UMovieSceneSection>(this, UMovieSceneAkAudioRTPCSection::StaticClass(), NAME_None, RF_Transactional);
  32. }
  33. #if WITH_EDITORONLY_DATA
  34. FText UMovieSceneAkAudioRTPCTrack::GetDisplayName() const
  35. {
  36. auto AllSections = GetAllSections();
  37. FString DisplayName("AkAudioRTPC");
  38. if (AllSections.Num() > 0)
  39. {
  40. UMovieSceneAkAudioRTPCSection* RTPCSection = CastChecked<UMovieSceneAkAudioRTPCSection>(AllSections[0]);
  41. DisplayName += TEXT(" - ") + RTPCSection->GetRTPCName();
  42. }
  43. if (AllSections.Num() > 1)
  44. {
  45. DisplayName += TEXT(" and more.");
  46. }
  47. return FText::FromString(DisplayName);
  48. }
  49. #endif
  50. FName UMovieSceneAkAudioRTPCTrack::GetTrackName() const
  51. {
  52. const auto Section = CastChecked<UMovieSceneAkAudioRTPCSection>(MovieSceneHelpers::FindNearestSectionAtTime(Sections, 0));
  53. return (Section != nullptr) ? FName(*Section->GetRTPCName()) : FName(NAME_None);
  54. }
  55. bool UMovieSceneAkAudioRTPCTrack::SupportsType(TSubclassOf<UMovieSceneSection> SectionClass) const
  56. {
  57. return SectionClass == UMovieSceneAkAudioRTPCSection::StaticClass();
  58. }