WwiseSoundEngineModule.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 "Wwise/WwiseSoundEngineVersionModule.h"
  17. #include "Modules/ModuleManager.h"
  18. class FWwiseGlobalCallbacks;
  19. class IWwiseSoundEngineModule : public IModuleInterface
  20. {
  21. public:
  22. static WWISESOUNDENGINE_API IWwiseCommAPI* Comm;
  23. static WWISESOUNDENGINE_API IWwiseMemoryMgrAPI* MemoryMgr;
  24. static WWISESOUNDENGINE_API IWwiseMonitorAPI* Monitor;
  25. static WWISESOUNDENGINE_API IWwiseMusicEngineAPI* MusicEngine;
  26. static WWISESOUNDENGINE_API IWwiseSoundEngineAPI* SoundEngine;
  27. static WWISESOUNDENGINE_API IWwiseSpatialAudioAPI* SpatialAudio;
  28. static WWISESOUNDENGINE_API IWwiseStreamMgrAPI* StreamMgr;
  29. static WWISESOUNDENGINE_API IWwisePlatformAPI* Platform;
  30. static WWISESOUNDENGINE_API IWAAPI* WAAPI;
  31. static WWISESOUNDENGINE_API IWwiseSoundEngineVersionModule* VersionInterface;
  32. /**
  33. * Checks to see if this module and the appropriate Sound Engine API are loaded and ready.
  34. *
  35. * @return True if the module is loaded and ready to use
  36. */
  37. static bool IsAvailable()
  38. {
  39. return FModuleManager::Get().IsModuleLoaded(TEXT("WwiseSoundEngine"));
  40. }
  41. static void ForceLoadModule()
  42. {
  43. FModuleManager& ModuleManager = FModuleManager::Get();
  44. if (!IsAvailable())
  45. {
  46. if (IsEngineExitRequested())
  47. {
  48. UE_LOG(LogLoad, Verbose, TEXT("Skipping reloading missing WwiseSoundEngine: Exiting."));
  49. }
  50. else if (!IsInGameThread())
  51. {
  52. UE_LOG(LogLoad, Warning, TEXT("Skipping loading missing WwiseSoundEngine: Not in game thread"));
  53. }
  54. else
  55. {
  56. ModuleManager.LoadModule("WwiseSoundEngine");
  57. }
  58. }
  59. }
  60. };
  61. class WWISESOUNDENGINE_API FWwiseSoundEngineModule : public IWwiseSoundEngineModule
  62. {
  63. void StartupModule() override;
  64. void ShutdownModule() override;
  65. static void DeleteInterface();
  66. };