WwiseProjectInfo.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 "Containers/Array.h"
  17. #include "Containers/Set.h"
  18. #include "Containers/UnrealString.h"
  19. #include "FastXml.h"
  20. struct FWwiseLanguageInfo
  21. {
  22. FGuid ID;
  23. FString Name;
  24. uint32 ShortID;
  25. };
  26. struct FWwisePlatformInfo
  27. {
  28. FGuid ID;
  29. FString Name;
  30. };
  31. class AKAUDIO_API WwiseProjectInfo : public IFastXmlCallback
  32. {
  33. public:
  34. virtual ~WwiseProjectInfo() {}
  35. void Parse();
  36. void ParseCacheDirectory(const FString ProjectFileString);
  37. static void SanitizeProjectFileString(FString& InOutProjectFileString);
  38. FString const& GetCacheDirectory() const { return CacheDirectory; }
  39. const TArray<FWwisePlatformInfo>& GetSupportedPlatforms() const { return SupportedPlatforms; }
  40. const TArray<FWwiseLanguageInfo>& GetSupportedLanguages() const { return SupportedLanguages; }
  41. const FString& GetDefaultLanguage() { return DefaultLanguage; }
  42. bool ProcessAttribute(const TCHAR* AttributeName, const TCHAR* AttributeValue) override;
  43. bool ProcessClose(const TCHAR* Element) override;
  44. bool ProcessComment(const TCHAR* Comment) override;
  45. bool ProcessElement(const TCHAR* ElementName, const TCHAR* ElementData, int32 XmlFileLineNumber) override;
  46. bool ProcessXmlDeclaration(const TCHAR* ElementData, int32 XmlFileLineNumber) override;
  47. bool IsProjectInfoParsed() const {return bProjectInfoParsed;}
  48. private:
  49. FString GetProjectPath() const;
  50. private:
  51. TArray<FWwiseLanguageInfo> SupportedLanguages;
  52. TArray<FWwisePlatformInfo> SupportedPlatforms;
  53. FString DefaultLanguage;
  54. FString CacheDirectory;
  55. bool bInsidePlatformElement = false;
  56. bool bInsideLanguageElement = false;
  57. bool bInsidePropertyElement = false;
  58. bool bInsideDefaultLanguage = false;
  59. bool bProjectInfoParsed = false ;
  60. FWwiseLanguageInfo CurrentLanguageInfo;
  61. FWwisePlatformInfo CurrentPlatformInfo;
  62. };