AkInitBank.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 "AkAudioType.h"
  17. #include "Wwise/CookedData/WwiseInitBankCookedData.h"
  18. #include "Wwise/Loaded/WwiseLoadedInitBank.h"
  19. #if WITH_EDITORONLY_DATA
  20. #include "Wwise/Info/WwiseObjectInfo.h"
  21. #endif
  22. #include "AkInitBank.generated.h"
  23. UCLASS()
  24. class AKAUDIO_API UAkInitBank : public UAkAudioType
  25. {
  26. GENERATED_BODY()
  27. public:
  28. UPROPERTY(Transient)
  29. FWwiseInitBankCookedData InitBankCookedData;
  30. #if WITH_EDITORONLY_DATA
  31. void PrepareCookedData();
  32. #endif
  33. TArray<FWwiseLanguageCookedData> GetLanguages();
  34. public:
  35. UAkInitBank():LoadedInitBank(nullptr){}
  36. #if WITH_EDITORONLY_DATA
  37. void CookAdditionalFilesOverride(const TCHAR* PackageFilename, const ITargetPlatform* TargetPlatform,
  38. TFunctionRef<void(const TCHAR* Filename, void* Data, int64 Size)> WriteAdditionalFile) override;
  39. virtual void BeginCacheForCookedPlatformData(const ITargetPlatform* TargetPlatform) override;
  40. virtual FWwiseObjectInfo* GetInfoMutable() override;
  41. #endif
  42. virtual void UnloadData(bool bAsync = false) override;
  43. void LoadInitBank();
  44. void UnloadInitBank(bool bAsync);
  45. protected:
  46. void Serialize(FArchive& Ar) override;
  47. #if WITH_EDITORONLY_DATA
  48. virtual void MigrateWwiseObjectInfo() override;
  49. #endif
  50. FWwiseLoadedInitBankPtrAtomic LoadedInitBank{nullptr};
  51. };