Files
UnrealEngineUWP/Engine/Plugins/Runtime/Metasound/Source/MetasoundEngine/Public/MetasoundWave.h
jimmy smith 39745ac8ae WavePlayer Backcompat with old ICompressedAudioInfo
#rb ethan.geller phil.popp aaron.mcleran
#jira UEAU-591

[CL 14275071 by jimmy smith in ue5-main branch]
2020-09-08 18:12:55 -04:00

56 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MetasoundDataReference.h"
#include "MetasoundDataTypeRegistrationMacro.h"
#include "IAudioProxyInitializer.h"
#include "Sound/SoundWave.h"
// Forward declares
namespace Audio
{
struct IDecoderInput;
}
class USoundWave;
namespace Metasound
{
// Forward declare ReadRef
class FWaveAsset;
typedef TDataReadReference<FWaveAsset> FWaveAssetReadRef;
// Metasound data type that holds onto a weak ptr. Mostly used as a placeholder until we have a proper proxy type.
class METASOUNDENGINE_API FWaveAsset
{
private:
TWeakObjectPtr<USoundWave> SoundWave;
public:
FWaveAsset() = default;
FWaveAsset(const Audio::IProxyData& InInitData)
{
const FSoundWaveProxy& SoundWaveProxy = InInitData.GetAs<FSoundWaveProxy>();
SoundWave = SoundWaveProxy.SoundWavePtr;
}
USoundWave* GetSoundWave()
{
return SoundWave.Get();
}
const USoundWave* GetSoundWave() const
{
return SoundWave.Get();
}
using FDecoderInputPtr = TSharedPtr<Audio::IDecoderInput,ESPMode::ThreadSafe>;
static FDecoderInputPtr CreateDecoderInput(
const FWaveAssetReadRef& InWaveRef);
};
DECLARE_METASOUND_DATA_REFERENCE_TYPES(FWaveAsset, METASOUNDENGINE_API, FWaveAssetTypeInfo, FWaveAssetReadRef, FWaveAssetWriteRef)
}