WwiseMediaFileState.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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/WwiseFileState.h"
  17. #include "Wwise/WwiseStreamableFileStateInfo.h"
  18. #include "Wwise/CookedData/WwiseMediaCookedData.h"
  19. class WWISEFILEHANDLER_API FWwiseMediaFileState : public FWwiseFileState, public FWwiseMediaCookedData
  20. {
  21. public:
  22. const FString RootPath;
  23. protected:
  24. FWwiseMediaFileState(const FWwiseMediaCookedData& InCookedData, const FString& InRootPath);
  25. public:
  26. ~FWwiseMediaFileState() override;
  27. const TCHAR* GetManagingTypeName() const override final { return TEXT("Media"); }
  28. uint32 GetShortId() const override final { return MediaId; }
  29. };
  30. class WWISEFILEHANDLER_API FWwiseInMemoryMediaFileState : public FWwiseMediaFileState, public AkSourceSettings
  31. {
  32. public:
  33. FWwiseInMemoryMediaFileState(const FWwiseMediaCookedData& InCookedData, const FString& InRootPath);
  34. ~FWwiseInMemoryMediaFileState() override { Term(); }
  35. void OpenFile(FOpenFileCallback&& InCallback) override;
  36. void LoadInSoundEngine(FLoadInSoundEngineCallback&& InCallback) override;
  37. void UnloadFromSoundEngine(FUnloadFromSoundEngineCallback&& InCallback) override;
  38. void CloseFile(FCloseFileCallback&& InCallback) override;
  39. };
  40. class WWISEFILEHANDLER_API FWwiseStreamedMediaFileState : public FWwiseMediaFileState, protected FWwiseStreamableFileStateInfo, protected AkSourceSettings
  41. {
  42. public:
  43. const uint32 StreamingGranularity;
  44. FWwiseFileCacheHandle* StreamedFile;
  45. FWwiseStreamedMediaFileState(const FWwiseMediaCookedData& InCookedData, const FString& InRootPath, uint32 InStreamingGranularity);
  46. ~FWwiseStreamedMediaFileState() override { Term(); }
  47. void CloseStreaming() override;
  48. FWwiseStreamableFileStateInfo* GetStreamableFileStateInfo() override { return this; }
  49. const FWwiseStreamableFileStateInfo* GetStreamableFileStateInfo() const override { return this; }
  50. void OpenFile(FOpenFileCallback&& InCallback) override;
  51. void LoadInSoundEngine(FLoadInSoundEngineCallback&& InCallback) override;
  52. void UnloadFromSoundEngine(FUnloadFromSoundEngineCallback&& InCallback) override;
  53. void CloseFile(FCloseFileCallback&& InCallback) override;
  54. bool CanProcessFileOp() const override;
  55. AKRESULT ProcessRead(AkFileDesc& InFileDesc, const AkIoHeuristics& InHeuristics, AkAsyncIOTransferInfo& OutTransferInfo, FWwiseAkFileOperationDone&& InFileOpDoneCallback) override;
  56. };