AkUnrealHelper.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 "AkUnrealHelper.generated.h"
  18. namespace AkUnrealHelper
  19. {
  20. template <typename T>
  21. struct TMallocDelete
  22. {
  23. DECLARE_INLINE_TYPE_LAYOUT(TMallocDelete, NonVirtual);
  24. TMallocDelete() = default;
  25. TMallocDelete(const TMallocDelete&) = default;
  26. TMallocDelete& operator=(const TMallocDelete&) = default;
  27. ~TMallocDelete() = default;
  28. template <
  29. typename U,
  30. typename = decltype(ImplicitConv<T*>((U*)nullptr))
  31. >
  32. TMallocDelete(const TMallocDelete<U>&)
  33. {
  34. }
  35. template <
  36. typename U,
  37. typename = decltype(ImplicitConv<T*>((U*)nullptr))
  38. >
  39. TMallocDelete& operator=(const TMallocDelete<U>&)
  40. {
  41. return *this;
  42. }
  43. void operator()(T* Ptr) const
  44. {
  45. FMemory::Free(Ptr);
  46. }
  47. };
  48. WWISESOUNDENGINE_API void SetHelperFunctions(
  49. FString(*GetWwisePluginDirectoryImpl)(),
  50. FString(*GetWwiseProjectPathImpl)(),
  51. FString(*GetSoundBankDirectoryImpl)(),
  52. FString(*GetStagePathImpl)()
  53. );
  54. WWISESOUNDENGINE_API FString GetWwisePluginDirectory();
  55. WWISESOUNDENGINE_API FString GetWwiseProjectPath();
  56. WWISESOUNDENGINE_API FString GetSoundBankDirectory();
  57. WWISESOUNDENGINE_API void TrimPath(FString& Path);
  58. WWISESOUNDENGINE_API FString GetProjectDirectory();
  59. WWISESOUNDENGINE_API FString GetThirdPartyDirectory();
  60. WWISESOUNDENGINE_API FString GetContentDirectory();
  61. WWISESOUNDENGINE_API FString GetExternalSourceDirectory();
  62. WWISESOUNDENGINE_API FString GetWwiseProjectDirectoryPath();
  63. WWISESOUNDENGINE_API FString GetWwiseSoundBankInfoCachePath();
  64. WWISESOUNDENGINE_API FString FormatFolderPath(FString folderPath);
  65. WWISESOUNDENGINE_API bool MakePathRelativeToWwiseProject(FString& AbsolutePath);
  66. WWISESOUNDENGINE_API const TCHAR* GetResultString(AKRESULT InResult);
  67. extern WWISESOUNDENGINE_API const TCHAR* MediaFolderName;
  68. extern WWISESOUNDENGINE_API const FGuid InitBankID;
  69. #if WITH_EDITOR
  70. WWISESOUNDENGINE_API FString GuidToBankName(const FGuid& Guid);
  71. WWISESOUNDENGINE_API FGuid BankNameToGuid(const FString& BankName);
  72. #endif
  73. }
  74. USTRUCT(BlueprintType, Meta = (Category = "Wwise|Types", DisplayName = "AkUint64"))
  75. struct FAkUInt64Wrapper
  76. {
  77. GENERATED_BODY()
  78. public:
  79. UPROPERTY(EditAnywhere, Category = "Value", DisplayName = "UInt64 Value")
  80. uint64 UInt64Value = 0;
  81. };
  82. USTRUCT(BlueprintType, Meta = (Category = "Wwise|Types", DisplayName = "AkUInt32"))
  83. struct FAkUInt32Wrapper
  84. {
  85. GENERATED_BODY()
  86. public:
  87. UPROPERTY(EditAnywhere, Category = "Value", DisplayName = "UInt32 Value")
  88. uint32 UInt32Value = 0;
  89. };
  90. USTRUCT(BlueprintType, Meta = (Category = "Wwise|Types", DisplayName = "AkOutputDeviceID"))
  91. struct FAkOutputDeviceID : public FAkUInt64Wrapper
  92. {
  93. GENERATED_BODY()
  94. };
  95. USTRUCT(BlueprintType, Meta = (Category = "Wwise|Types", DisplayName = "AkUniqueID"))
  96. struct FAkUniqueID : public FAkUInt32Wrapper
  97. {
  98. GENERATED_BODY()
  99. };