void USoundWave::UpdatePlatformData() { if (IsStreaming()) { // Make sure there are no pending requests in flight. while (IStreamingManager::Get().GetAudioStreamingManager().IsStreamingInProgress(this)) { // Give up timeslice. FPlatformProcess::Sleep(0); } #if WITH_EDITORONLY_DATA // Temporarily remove from streaming manager to release currently used data chunks IStreamingManager::Get().GetAudioStreamingManager().RemoveStreamingSoundWave(this); // Recache platform data if the source has changed. CachePlatformData(); // Add back to the streaming manager to reload first chunk IStreamingManager::Get().GetAudioStreamingManager().AddStreamingSoundWave(this); #endif } else { IStreamingManager::Get().GetAudioStreamingManager().RemoveStreamingSoundWave(this); } }
void UTextureCube::UpdateResource() { #if WITH_EDITOR // Recache platform data if the source has changed. CachePlatformData(); #endif // #if WITH_EDITOR // Route to super. Super::UpdateResource(); }
void USoundWave::BeginCachePlatformData() { CachePlatformData(true); #if WITH_EDITOR // enable caching in postload for derived data cache commandlet and cook by the book ITargetPlatformManagerModule* TPM = GetTargetPlatformManager(); if (TPM && (TPM->RestrictFormatsToRuntimeOnly() == false)) { TArray<ITargetPlatform*> Platforms = TPM->GetActiveTargetPlatforms(); // Cache for all the audio formats that the cooking target requires for (int32 FormatIndex = 0; FormatIndex < Platforms.Num(); FormatIndex++) { BeginCacheForCookedPlatformData(Platforms[FormatIndex]); } } #endif }
void USoundWave::FinishCachePlatformData() { if (RunningPlatformData == NULL) { // begin cache never called CachePlatformData(); } else { // make sure async requests are finished RunningPlatformData->FinishCache(); } #if DO_CHECK FString DerivedDataKey; FName AudioFormat = GetWaveFormatForRunningPlatform(*this); GetStreamedAudioDerivedDataKey(*this, AudioFormat, DerivedDataKey); check(RunningPlatformData->DerivedDataKey == DerivedDataKey); #endif }