You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
[FYI] rob.gay Original CL Desc ----------------------------------------------------------------- MetaSounds Interfaces Checkpoint 2: - Version up source archetypes to become two interfaces: channel interfaces (mono/stereo) & base source namespace - Clean-up Interface panel to support namespacing better - Fix bugs with assuming interfaces are always and the only base namespace members - Allow namespacing for any arbitrary interface member - Add lock icon to clarify what interface members cannot be modified individually (i.e. cannot add, remove, or rename them as they are interface members) - Organize members alphabetically #jira UE-135000 #rnx #rb phil.popp #preflight 61a7d1079c77d610079303ec #p4v-cherrypick 18344347 #ROBOMERGE-AUTHOR: aurel.cordonnier #ROBOMERGE-SOURCE: CL 18369256 via CL 18369273 via CL 18369290 via CL 18434224 via CL 18435611 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271) [CL 18436532 by aurel cordonnier in ue5-release-engine-test branch]
103 lines
2.7 KiB
C++
103 lines
2.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#pragma once
|
|
|
|
#include "Algo/Transform.h"
|
|
#include "AudioParameterInterface.h"
|
|
#include "IAudioGeneratorInterfaceRegistry.h"
|
|
#include "MetasoundFrontendDataTypeRegistry.h"
|
|
#include "MetasoundFrontendDocument.h"
|
|
#include "MetasoundFrontendTransform.h"
|
|
#include "MetasoundLog.h"
|
|
#include "MetasoundParameterTransmitter.h"
|
|
#include "MetasoundSource.h"
|
|
#include "MetasoundUObjectRegistry.h"
|
|
#include "Templates/UniquePtr.h"
|
|
#include "UObject/Class.h"
|
|
#include "UObject/NoExportTypes.h"
|
|
|
|
|
|
namespace Metasound
|
|
{
|
|
namespace Engine
|
|
{
|
|
void RegisterExternalInterfaces();
|
|
|
|
struct FInterfaceRegistryOptions
|
|
{
|
|
bool bIsDefault = false;
|
|
FName InputSystemName;
|
|
FName UClassName;
|
|
};
|
|
|
|
// Entry for registered interface.
|
|
class FInterfaceRegistryEntry : public Frontend::IInterfaceRegistryEntry
|
|
{
|
|
public:
|
|
FInterfaceRegistryEntry(
|
|
const FMetasoundFrontendInterface& InInterface,
|
|
TUniquePtr<Frontend::IDocumentTransform>&& InUpdateTransform,
|
|
FInterfaceRegistryOptions&& InOptions
|
|
)
|
|
: Interface(InInterface)
|
|
, UpdateTransform(MoveTemp(InUpdateTransform))
|
|
, Options(MoveTemp(InOptions))
|
|
{
|
|
}
|
|
|
|
virtual bool UClassIsSupported(FName InUClassName) const override
|
|
{
|
|
if (Options.UClassName.IsNone())
|
|
{
|
|
return true;
|
|
}
|
|
|
|
// TODO: Support child asset class types.
|
|
return Options.UClassName == InUClassName;
|
|
}
|
|
|
|
virtual bool IsDefault() const override
|
|
{
|
|
return Options.bIsDefault;
|
|
}
|
|
|
|
virtual FName GetRouterName() const override
|
|
{
|
|
return Options.InputSystemName;
|
|
}
|
|
|
|
virtual const FMetasoundFrontendInterface& GetInterface() const override
|
|
{
|
|
return Interface;
|
|
}
|
|
|
|
virtual bool UpdateRootGraphInterface(Frontend::FDocumentHandle InDocument) const override
|
|
{
|
|
if (UpdateTransform.IsValid())
|
|
{
|
|
return UpdateTransform->Transform(InDocument);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
private:
|
|
FMetasoundFrontendInterface Interface;
|
|
TUniquePtr<Frontend::IDocumentTransform> UpdateTransform;
|
|
FInterfaceRegistryOptions Options;
|
|
};
|
|
|
|
template <typename UClassType>
|
|
void RegisterInterface(const FMetasoundFrontendInterface& InInterface, TUniquePtr<Frontend::IDocumentTransform>&& UpdateTransform, bool bInIsDefault, FName InRouterName)
|
|
{
|
|
FInterfaceRegistryOptions Options
|
|
{
|
|
bInIsDefault,
|
|
InRouterName,
|
|
UClassType::StaticClass()->GetFName()
|
|
};
|
|
|
|
IMetasoundUObjectRegistry::Get().RegisterUClassInterface(MakeUnique<TMetasoundUObjectRegistryEntry<UClassType>>(InInterface.Version));
|
|
Frontend::IInterfaceRegistry::Get().RegisterInterface(MakeUnique<FInterfaceRegistryEntry>(InInterface, MoveTemp(UpdateTransform), MoveTemp(Options)));
|
|
}
|
|
} // namespace Engine
|
|
} // namespace Metasound
|