1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #pragma once
- #include "DirectoryWatcher/Public/IDirectoryWatcher.h"
- #include "Widgets/Notifications/SNotificationList.h"
- DECLARE_MULTICAST_DELEGATE(OnSoundBankGenerationDoneDelegate);
- class AUDIOKINETICTOOLS_API GeneratedSoundBanksDirectoryWatcher
- {
- public:
- bool DoesWwiseProjectExist();
- void CheckIfCachePathChanged();
- void Initialize();
- void Uninitialize(const bool bIsModuleShutdown = false);
- void StartWatchers();
-
- bool StartCacheWatcher(const FString& CachePath);
-
- void StartSoundBanksWatcher(const FString& GeneratedSoundBanksFolder);
- void StopWatchers();
- void StopSoundBanksWatcher();
- void StopCacheWatcher();
- void RestartWatchers();
- void ConditionalRestartWatchers();
- bool ShouldRestartWatchers();
- OnSoundBankGenerationDoneDelegate OnSoundBanksGenerated;
- private:
- FString CachePath;
- FString SoundBankDirectory;
- void OnCacheChanged(const TArray<FFileChangeData>& ChangedFiles);
- void OnGeneratedSoundBanksChanged(const TArray<FFileChangeData>& ChangedFiles);
- void TimerTick(float DeltaSeconds);
- void EndParseTimer();
- void OnSoundBankGenerationDone() const;
- void NotifyFilesChanged();
- void HideNotification();
- void UpdateNotificationOnGenerationComplete() const;
- void UpdateNotification() const;
- FDelegateHandle GeneratedSoundBanksHandle;
- FDelegateHandle CacheChangedHandle;
- FDelegateHandle PostEditorTickHandle;
- FDelegateHandle ProjectParsedHandle;
- FDelegateHandle SettingsChangedHandle;
- FDelegateHandle UserSettingsChangedHandle;
- bool bParseTimerRunning = false;
- float ParseTimer= 0;
- const float ParseDelaySeconds = 10.0f;
- TSharedPtr<SNotificationItem> NotificationItem;
- bool bCacheFolderExists = false;
- bool bGeneratedSoundBanksFolderExists = false;
- };
|