AkAssetDatabase.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 "HAL/CriticalSection.h"
  17. #include "Misc/Guid.h"
  18. #include "AssetRegistry/AssetData.h"
  19. class FAssetRegistryModule;
  20. class FAssetToolsModule;
  21. struct FAssetRenameData;
  22. class AUDIOKINETICTOOLS_API AkAssetDatabase
  23. {
  24. public:
  25. static AkAssetDatabase& Get();
  26. bool FindAllAssets(TArray<FAssetData>& OutData);
  27. bool FindAssets(const FGuid& AkGuid, TArray<FAssetData>& OutData);
  28. bool FindAssets(const FString& AkAssetName, TArray<FAssetData>& OutData);
  29. FAssetData FindAssetByObjectPath(const FSoftObjectPath& AssetPath);
  30. bool FindFirstAsset(const FGuid& AkGuid, FAssetData& OutAsset);
  31. bool FindFirstAsset(const FString& AkAssetName, FAssetData& OutAsset);
  32. bool FindAssetsByGuidAndClass(const FGuid& AkGuid, const UClass* StaticClass, TArray<FAssetData>& OutWwiseAssets);
  33. bool RenameAsset(const FGuid& Id, const FString& AssetName, const FString& RelativePath);
  34. void DeleteAsset(const FGuid& Id);
  35. void DeleteAssets(const TSet<FGuid>& AssetsId);
  36. void FixUpRedirectors(const FString& AssetPackagePath);
  37. bool CheckIfLoadingAssets();
  38. mutable FCriticalSection InitBankLock;
  39. private:
  40. AkAssetDatabase();
  41. bool IsAkAudioType(const FAssetData& AssetData);
  42. private:
  43. FAssetRegistryModule* AssetRegistryModule = nullptr;
  44. FAssetToolsModule* AssetToolsModule = nullptr;
  45. };