Files
nicholas howe 1cff9d7ff8 MetaSound Frontend allows derived classes to attach to base class pins at runtime.
FDataTypeRegistry::GetDataTypeInfo walks up the class hierarchy searching for a registered class.
Adds FDataTypeRegistryInfo::bIsExplicit to replace the editor's IsExplicitProxyClass and enable the same functionality of requiring exact types at runtime.

#rb rob.gay
[REVIEW] [at]phil.popp
#preflight 6470afe55d3ca2dfd99ab6a1

[CL 25649438 by nicholas howe in ue5-main branch]
2023-05-26 13:55:21 -04:00

60 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "MetasoundDataReference.h"
#include "MetasoundDataTypeRegistrationMacro.h"
#include "IAudioProxyInitializer.h"
#include "Sound/SoundWave.h"
#include "IAudioCodecRegistry.h"
#include "IAudioCodec.h"
#include "DSP/InterpolatedLinearPitchShifter.h"
namespace Metasound
{
// Forward declare ReadRef
class FWaveAsset;
typedef TDataReadReference<FWaveAsset> FWaveAssetReadRef;
// Helper utility to test if exact types are required for a datatype.
template <>
struct TIsExplicit<FWaveAsset>
{
static constexpr bool Value = true;
};
// 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
{
FSoundWaveProxyPtr SoundWaveProxy;
public:
FWaveAsset() = default;
FWaveAsset(const FWaveAsset&) = default;
FWaveAsset& operator=(const FWaveAsset& Other) = default;
FWaveAsset(const TSharedPtr<Audio::IProxyData>& InInitData);
bool IsSoundWaveValid() const;
const FSoundWaveProxyPtr& GetSoundWaveProxy() const
{
return SoundWaveProxy;
}
const FSoundWaveProxy* operator->() const
{
return SoundWaveProxy.Get();
}
FSoundWaveProxy* operator->()
{
return SoundWaveProxy.Get();
}
};
DECLARE_METASOUND_DATA_REFERENCE_TYPES(FWaveAsset, METASOUNDENGINE_API, FWaveAssetTypeInfo, FWaveAssetReadRef, FWaveAssetWriteRef)
}