WwiseDatabaseIdentifiers.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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 "CoreMinimal.h"
  17. #include "WwiseDatabaseIdentifiers.generated.h"
  18. USTRUCT()
  19. struct WWISEPROJECTDATABASE_API FWwiseDatabaseMediaIdKey
  20. {
  21. GENERATED_BODY()
  22. UPROPERTY() uint32 MediaId = 0;
  23. UPROPERTY() uint32 SoundBankId = 0;
  24. FWwiseDatabaseMediaIdKey()
  25. {}
  26. FWwiseDatabaseMediaIdKey(uint32 InMediaId, uint32 InSoundBankId) :
  27. MediaId(InMediaId),
  28. SoundBankId(InSoundBankId)
  29. {}
  30. bool operator==(const FWwiseDatabaseMediaIdKey& Rhs) const
  31. {
  32. return MediaId == Rhs.MediaId
  33. && SoundBankId == Rhs.SoundBankId;
  34. }
  35. bool operator<(const FWwiseDatabaseMediaIdKey& Rhs) const
  36. {
  37. return (MediaId < Rhs.MediaId)
  38. || (MediaId == Rhs.MediaId && SoundBankId < Rhs.SoundBankId);
  39. }
  40. };
  41. USTRUCT()
  42. struct WWISEPROJECTDATABASE_API FWwiseDatabaseLocalizableIdKey
  43. {
  44. GENERATED_BODY()
  45. static constexpr uint32 GENERIC_LANGUAGE = 0;
  46. UPROPERTY() uint32 Id = 0;
  47. UPROPERTY() uint32 LanguageId = 0;
  48. UPROPERTY() uint32 SoundBankId = 0;
  49. FWwiseDatabaseLocalizableIdKey()
  50. {}
  51. FWwiseDatabaseLocalizableIdKey(uint32 InId, uint32 InLanguageId) :
  52. Id(InId),
  53. LanguageId(InLanguageId)
  54. {}
  55. FWwiseDatabaseLocalizableIdKey(uint32 InId, uint32 InLanguageId, uint32 InSoundBankId) :
  56. Id(InId),
  57. LanguageId(InLanguageId),
  58. SoundBankId(InSoundBankId)
  59. {}
  60. bool operator==(const FWwiseDatabaseLocalizableIdKey& Rhs) const
  61. {
  62. return Id == Rhs.Id
  63. && LanguageId == Rhs.LanguageId
  64. && SoundBankId == Rhs.SoundBankId;
  65. }
  66. bool operator<(const FWwiseDatabaseLocalizableIdKey& Rhs) const
  67. {
  68. return (Id < Rhs.Id)
  69. || (Id == Rhs.Id && LanguageId < Rhs.LanguageId)
  70. || (Id == Rhs.Id && LanguageId == Rhs.LanguageId && SoundBankId < Rhs.SoundBankId);
  71. }
  72. };
  73. USTRUCT()
  74. struct WWISEPROJECTDATABASE_API FWwiseDatabaseGroupValueKey
  75. {
  76. GENERATED_BODY()
  77. UPROPERTY() uint32 GroupId = 0;
  78. UPROPERTY() uint32 Id = 0;
  79. FWwiseDatabaseGroupValueKey()
  80. {}
  81. FWwiseDatabaseGroupValueKey(uint32 InGroupId, uint32 InId) :
  82. GroupId(InGroupId),
  83. Id(InId)
  84. {}
  85. bool operator==(const FWwiseDatabaseGroupValueKey& Rhs) const
  86. {
  87. return GroupId == Rhs.GroupId
  88. && Id == Rhs.Id;
  89. }
  90. bool operator<(const FWwiseDatabaseGroupValueKey& Rhs) const
  91. {
  92. return (GroupId < Rhs.GroupId)
  93. || (GroupId == Rhs.GroupId && Id < Rhs.Id);
  94. }
  95. };
  96. USTRUCT()
  97. struct WWISEPROJECTDATABASE_API FWwiseDatabaseLocalizableGroupValueKey
  98. {
  99. GENERATED_BODY()
  100. static constexpr uint32 GENERIC_LANGUAGE = 0;
  101. UPROPERTY() FWwiseDatabaseGroupValueKey GroupValue;
  102. UPROPERTY() uint32 LanguageId = 0;
  103. FWwiseDatabaseLocalizableGroupValueKey()
  104. {}
  105. FWwiseDatabaseLocalizableGroupValueKey(uint32 InGroup, uint32 InId, uint32 InLanguageId) :
  106. GroupValue(InGroup, InId),
  107. LanguageId(InLanguageId)
  108. {}
  109. FWwiseDatabaseLocalizableGroupValueKey(FWwiseDatabaseGroupValueKey InGroupValue, uint32 InLanguageId) :
  110. GroupValue(InGroupValue),
  111. LanguageId(InLanguageId)
  112. {}
  113. bool operator==(const FWwiseDatabaseLocalizableGroupValueKey& Rhs) const
  114. {
  115. return GroupValue == Rhs.GroupValue
  116. && LanguageId == Rhs.LanguageId;
  117. }
  118. bool operator<(const FWwiseDatabaseLocalizableGroupValueKey& Rhs) const
  119. {
  120. return (GroupValue < Rhs.GroupValue)
  121. || (GroupValue == Rhs.GroupValue && LanguageId < Rhs.LanguageId);
  122. }
  123. };
  124. USTRUCT()
  125. struct WWISEPROJECTDATABASE_API FWwiseDatabaseLocalizableGuidKey
  126. {
  127. GENERATED_BODY()
  128. static constexpr uint32 GENERIC_LANGUAGE = FWwiseDatabaseLocalizableIdKey::GENERIC_LANGUAGE;
  129. UPROPERTY() FGuid Guid;
  130. UPROPERTY() uint32 LanguageId = 0; // 0 if no Language
  131. FWwiseDatabaseLocalizableGuidKey()
  132. {}
  133. FWwiseDatabaseLocalizableGuidKey(FGuid InGuid, uint32 InLanguageId) :
  134. Guid(InGuid),
  135. LanguageId(InLanguageId)
  136. {}
  137. bool operator==(const FWwiseDatabaseLocalizableGuidKey& Rhs) const
  138. {
  139. return Guid == Rhs.Guid
  140. && LanguageId == Rhs.LanguageId;
  141. }
  142. bool operator<(const FWwiseDatabaseLocalizableGuidKey& Rhs) const
  143. {
  144. return (Guid < Rhs.Guid)
  145. || (Guid == Rhs.Guid && LanguageId < Rhs.LanguageId);
  146. }
  147. };
  148. USTRUCT()
  149. struct WWISEPROJECTDATABASE_API FWwiseDatabaseLocalizableNameKey
  150. {
  151. GENERATED_BODY()
  152. static constexpr uint32 GENERIC_LANGUAGE = FWwiseDatabaseLocalizableIdKey::GENERIC_LANGUAGE;
  153. UPROPERTY() FName Name;
  154. UPROPERTY() uint32 LanguageId = 0; // 0 if no Language
  155. FWwiseDatabaseLocalizableNameKey()
  156. {}
  157. FWwiseDatabaseLocalizableNameKey(FName InName, uint32 InLanguageId) :
  158. Name(InName),
  159. LanguageId(InLanguageId)
  160. {}
  161. bool operator==(const FWwiseDatabaseLocalizableNameKey& Rhs) const
  162. {
  163. return Name == Rhs.Name
  164. && LanguageId == Rhs.LanguageId;
  165. }
  166. bool operator<(const FWwiseDatabaseLocalizableNameKey& Rhs) const
  167. {
  168. return (Name.FastLess(Rhs.Name))
  169. || (Name == Rhs.Name && LanguageId < Rhs.LanguageId);
  170. }
  171. };
  172. uint32 WWISEPROJECTDATABASE_API GetTypeHash(const FWwiseDatabaseMediaIdKey& FileId);
  173. uint32 WWISEPROJECTDATABASE_API GetTypeHash(const FWwiseDatabaseLocalizableIdKey& LocalizableId);
  174. uint32 WWISEPROJECTDATABASE_API GetTypeHash(const FWwiseDatabaseGroupValueKey& LocalizableGroupValue);
  175. uint32 WWISEPROJECTDATABASE_API GetTypeHash(const FWwiseDatabaseLocalizableGroupValueKey& LocalizableGroupValue);
  176. uint32 WWISEPROJECTDATABASE_API GetTypeHash(const FWwiseDatabaseLocalizableIdKey& EventId);
  177. uint32 WWISEPROJECTDATABASE_API GetTypeHash(const FWwiseDatabaseLocalizableGuidKey& LocalizableGuid);
  178. uint32 WWISEPROJECTDATABASE_API GetTypeHash(const FWwiseDatabaseLocalizableNameKey& LocalizableName);