You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Archetype to Interface rename & support for multiple interface versions stored on MetaSoundBase - Added ability to register interfaces - Added spatialization/attenuation interfaces - Added UX to add/remove Interfaces - Fix ensure when deleting UMetaSound asset #rb phil.popp #jira UE-135000 #jira UE-120656 #rnx #preflight 619bd9e33a7219926732337c #ROBOMERGE-AUTHOR: rob.gay #ROBOMERGE-SOURCE: CL 18262648 in //UE5/Release-5.0/... via CL 18262703 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469) [CL 18262725 by rob gay in ue5-release-engine-test branch]
145 lines
3.5 KiB
C++
145 lines
3.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#include "Metasound.h"
|
|
|
|
#include "AssetRegistryModule.h"
|
|
#include "CoreMinimal.h"
|
|
#include "Internationalization/Text.h"
|
|
#include "MetasoundAssetBase.h"
|
|
#include "MetasoundAudioFormats.h"
|
|
#include "MetasoundEngineArchetypes.h"
|
|
#include "MetasoundEngineEnvironment.h"
|
|
#include "MetasoundEnvironment.h"
|
|
#include "MetasoundFrontendController.h"
|
|
#include "MetasoundFrontendQuery.h"
|
|
#include "MetasoundFrontendQuerySteps.h"
|
|
#include "MetasoundFrontendRegistries.h"
|
|
#include "MetasoundFrontendSearchEngine.h"
|
|
#include "MetasoundGenerator.h"
|
|
#include "MetasoundLog.h"
|
|
#include "MetasoundOperatorSettings.h"
|
|
#include "MetasoundParameterTransmitter.h"
|
|
#include "MetasoundPrimitives.h"
|
|
#include "MetasoundReceiveNode.h"
|
|
#include "MetasoundTrigger.h"
|
|
#include "MetasoundUObjectRegistry.h"
|
|
#include "UObject/ObjectSaveContext.h"
|
|
|
|
#if WITH_EDITORONLY_DATA
|
|
#include "EdGraph/EdGraph.h"
|
|
#endif // WITH_EDITORONLY_DATA
|
|
|
|
#define LOCTEXT_NAMESPACE "MetaSound"
|
|
|
|
|
|
UMetaSound::UMetaSound(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
, FMetasoundAssetBase()
|
|
{
|
|
}
|
|
|
|
#if WITH_EDITOR
|
|
void UMetaSound::PostDuplicate(EDuplicateMode::Type InDuplicateMode)
|
|
{
|
|
Super::PostDuplicate(InDuplicateMode);
|
|
|
|
// Guid is reset as asset may share implementation from
|
|
// asset duplicated from but should not be registered as such.
|
|
if (InDuplicateMode == EDuplicateMode::Normal)
|
|
{
|
|
Metasound::Frontend::FRegenerateAssetClassName().Transform(GetDocumentHandle());
|
|
}
|
|
}
|
|
|
|
void UMetaSound::PostEditUndo()
|
|
{
|
|
Super::PostEditUndo();
|
|
bSynchronizationRequired = true;
|
|
}
|
|
|
|
void UMetaSound::PostEditChangeProperty(FPropertyChangedEvent& InEvent)
|
|
{
|
|
Super::PostEditChangeProperty(InEvent);
|
|
Metasound::PostEditChangeProperty(*this, InEvent);
|
|
}
|
|
#endif // WITHEDITOR
|
|
|
|
void UMetaSound::BeginDestroy()
|
|
{
|
|
UnregisterGraphWithFrontend();
|
|
Super::BeginDestroy();
|
|
}
|
|
|
|
void UMetaSound::PreSave(FObjectPreSaveContext InSaveContext)
|
|
{
|
|
Super::PreSave(InSaveContext);
|
|
Metasound::PreSaveAsset(*this, InSaveContext);
|
|
}
|
|
|
|
void UMetaSound::Serialize(FArchive& InArchive)
|
|
{
|
|
Super::Serialize(InArchive);
|
|
Metasound::SerializeToArchive(*this, InArchive);
|
|
}
|
|
|
|
#if WITH_EDITORONLY_DATA
|
|
UEdGraph* UMetaSound::GetGraph()
|
|
{
|
|
return Graph;
|
|
}
|
|
|
|
const UEdGraph* UMetaSound::GetGraph() const
|
|
{
|
|
return Graph;
|
|
}
|
|
|
|
UEdGraph& UMetaSound::GetGraphChecked()
|
|
{
|
|
check(Graph);
|
|
return *Graph;
|
|
}
|
|
|
|
const UEdGraph& UMetaSound::GetGraphChecked() const
|
|
{
|
|
check(Graph);
|
|
return *Graph;
|
|
}
|
|
|
|
FText UMetaSound::GetDisplayName() const
|
|
{
|
|
FString TypeName = UMetaSound::StaticClass()->GetName();
|
|
return FMetasoundAssetBase::GetDisplayName(MoveTemp(TypeName));
|
|
}
|
|
|
|
void UMetaSound::SetRegistryAssetClassInfo(const Metasound::Frontend::FNodeClassInfo& InNodeInfo)
|
|
{
|
|
Metasound::SetMetaSoundRegistryAssetClassInfo(*this, InNodeInfo);
|
|
}
|
|
#endif // WITH_EDITORONLY_DATA
|
|
|
|
Metasound::Frontend::FNodeClassInfo UMetaSound::GetAssetClassInfo() const
|
|
{
|
|
return { GetDocumentChecked().RootGraph, *GetPathName() };
|
|
}
|
|
|
|
void UMetaSound::SetReferencedAssetClassKeys(TSet<Metasound::Frontend::FNodeRegistryKey>&& InKeys)
|
|
{
|
|
ReferencedAssetClassKeys = MoveTemp(InKeys);
|
|
}
|
|
|
|
TSet<FSoftObjectPath>& UMetaSound::GetReferencedAssetClassCache()
|
|
{
|
|
return ReferenceAssetClassCache;
|
|
}
|
|
|
|
const TSet<FSoftObjectPath>& UMetaSound::GetReferencedAssetClassCache() const
|
|
{
|
|
return ReferenceAssetClassCache;
|
|
}
|
|
|
|
const FMetasoundFrontendVersion& UMetaSound::GetDefaultArchetypeVersion() const
|
|
{
|
|
static const FMetasoundFrontendVersion DefaultArchetypeVersion = Metasound::Engine::MetasoundV1_0::GetVersion();
|
|
return DefaultArchetypeVersion;
|
|
}
|
|
#undef LOCTEXT_NAMESPACE // MetaSound
|