AkAudioModule.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 "AkAudioDevice.h"
  17. #include "WwiseUEFeatures.h"
  18. #include "Modules/ModuleManager.h"
  19. #include "Containers/Ticker.h"
  20. /**
  21. * The public interface to this module. In most cases, this interface is only public to sibling modules
  22. * within this plugin.
  23. */
  24. class IAkAudioModule : public IModuleInterface
  25. {
  26. public:
  27. /**
  28. * Singleton-like access to this module's interface. This is just for convenience!
  29. * Beware of calling this during the shutdown phase, though. Your module might have been unloaded already.
  30. *
  31. * @return Returns singleton instance, loading the module on demand if needed
  32. */
  33. static inline IAkAudioModule& Get()
  34. {
  35. return FModuleManager::LoadModuleChecked< IAkAudioModule >(TEXT("AkAudio"));
  36. }
  37. /**
  38. * Checks to see if this module is loaded and ready. It is only valid to call Get() if IsAvailable() returns true.
  39. *
  40. * @return True if the module is loaded and ready to use
  41. */
  42. static inline bool IsAvailable()
  43. {
  44. return FModuleManager::Get().IsModuleLoaded(TEXT("AkAudio"));
  45. }
  46. };
  47. class AKAUDIO_API FAkAudioModule : public IAkAudioModule
  48. {
  49. public:
  50. static FAkAudioModule* AkAudioModuleInstance;
  51. static FSimpleMulticastDelegate OnModuleInitialized;
  52. static FSimpleMulticastDelegate OnWwiseAssetDataReloaded;
  53. bool bModuleInitialized;
  54. /** IModuleInterface implementation */
  55. virtual void StartupModule() override;
  56. virtual void ShutdownModule() override;
  57. FAkAudioDevice* GetAkAudioDevice() const;
  58. void ReloadWwiseAssetData() const;
  59. static void UpdateWwiseResourceLoaderSettings();
  60. #if WITH_EDITORONLY_DATA
  61. static void ParseGeneratedSoundBankData();
  62. #endif
  63. FAkAudioDevice* AkAudioDevice;
  64. /** Call to update AkAudioDevice. */
  65. FTickerDelegate OnTick;
  66. /** Handle for OnTick. */
  67. FTickerDelegateHandle TickDelegateHandle;
  68. };