12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- #pragma once
- #include "Containers/UnrealString.h"
- #include "Containers/Array.h"
- #include "Dom/JsonObject.h"
- #include "HAL/ThreadSafeBool.h"
- #include "Widgets/Notifications/SNotificationList.h"
- #include "AssetManagement/WwiseProjectInfo.h"
- #include "WwiseUnrealHelper.h"
- DECLARE_STATS_GROUP(TEXT("AkSoundBankGeneration"), STATGROUP_AkSoundBankGenerationSource, STATCAT_Wwise);
- class AkSoundBankGenerationManager : public TSharedFromThis<AkSoundBankGenerationManager, ESPMode::ThreadSafe>
- {
- public:
- enum ESoundBankGenerationMode
- {
- WwiseConsole = 0,
- Commandlet,
- WAAPI
- };
- struct FInitParameters
- {
- TArray<FString> Platforms;
- TArray<FString> Languages;
- bool SkipLanguages = false;
- ESoundBankGenerationMode GenerationMode = WwiseConsole;
- };
- AkSoundBankGenerationManager(const FInitParameters& InitParameters);
- ~AkSoundBankGenerationManager();
- void Init();
- void DoGeneration();
- void SetOverrideWwiseConsolePath(const FString& value) { OverrideWwiseConsolePath = value; }
- private:
- void CreateNotificationItem();
- void Notify(const FString& key, const FString& message, const FString& AudioCuePath, bool bSuccess);
- void NotifyGenerationFailed();
- void NotifyGenerationSucceeded();
- void NotifyProfilingInProgress();
- void NotifyAuthoringUnavailable();
- void WrapUpGeneration(const bool bSuccess, const FString& BuilderName);
- void SetIsBuilding(bool bIsBuilding);
- TSharedPtr<SNotificationItem> NotificationItem;
- uint64 StartTime;
- FInitParameters InitParameters;
- IPlatformFile* PlatformFile = nullptr;
-
- bool WwiseConsoleGenerate();
- bool RunWwiseConsole(const FString& WwiseConsoleCommand, const FString& WwiseConsoleArguments);
- FString OverrideWwiseConsolePath;
-
- #if AK_SUPPORT_WAAPI
- bool WAAPIGenerate();
- bool SubscribeToGenerationDone();
- void CleanupWaapiSubscriptions();
- void OnSoundBankGenerationDone(uint64_t Id, TSharedPtr<FJsonObject> ResponseJson);
- #endif
- uint64 GenerationDoneSubscriptionId = 0;
- FDelegateHandle ConnectionLostHandle;
- FEvent* WaitForGenerationDoneEvent = nullptr;
- FThreadSafeBool WaapiGenerationSuccess = true;
- FThreadSafeBool bIsBuildingData = false;
- };
|