You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Revive UMetaSound Asset type - Revive MS Output generation - Fix copy pasta'ed type name so MetaSound Source shows up properly in editor - Clean-up to dynamic doc version reporting if required (show the new version number in log) - Add versioning to update the RootGraphClass name & add DisplayName MetaSound Registry Scaffolding Part 1 (From Phil Popp) #rb phil.popp #jira UE-117108 #jira UE-117109 #jira UE-117110 #preflight 60bf11780c76f90001db5f5f #ROBOMERGE-SOURCE: CL 16587155 #ROBOMERGE-BOT: (v828-16531559) [CL 16587204 by rob gay in ue5-main branch]
124 lines
4.3 KiB
C++
124 lines
4.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "EdGraph/EdGraph.h"
|
|
#include "MetasoundAssetBase.h"
|
|
#include "MetasoundFrontend.h"
|
|
#include "MetasoundFrontendDocument.h"
|
|
#include "MetasoundOperatorSettings.h"
|
|
#include "MetasoundRouter.h"
|
|
#include "MetasoundSource.h"
|
|
|
|
#include "Metasound.generated.h"
|
|
|
|
|
|
/**
|
|
* This asset type is used for Metasound assets that can only be used as nodes in other Metasound graphs.
|
|
* Because of this, they contain no required inputs or outputs.
|
|
*/
|
|
UCLASS(hidecategories = object, BlueprintType)
|
|
class METASOUNDENGINE_API UMetaSound : public UObject, public FMetasoundAssetBase
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
protected:
|
|
UPROPERTY(EditAnywhere, Category = CustomView)
|
|
FMetasoundFrontendDocument RootMetaSoundDocument;
|
|
|
|
#if WITH_EDITORONLY_DATA
|
|
UPROPERTY(AssetRegistrySearchable)
|
|
FMetasoundFrontendClassAssetTags AssetTags;
|
|
|
|
UPROPERTY()
|
|
UMetasoundEditorGraphBase* Graph;
|
|
#endif // WITH_EDITORONLY_DATA
|
|
|
|
public:
|
|
UMetaSound(const FObjectInitializer& ObjectInitializer);
|
|
|
|
#if WITH_EDITORONLY_DATA
|
|
// Returns document name (for editor purposes, and avoids making document public for edit
|
|
// while allowing editor to reference directly)
|
|
static FName GetDocumentPropertyName()
|
|
{
|
|
return GET_MEMBER_NAME_CHECKED(UMetaSound, RootMetaSoundDocument);
|
|
}
|
|
|
|
// Name to display in editors
|
|
virtual FText GetDisplayName() const override;
|
|
|
|
// Returns the graph associated with this Metasound. Graph is required to be referenced on
|
|
// Metasound UObject for editor serialization purposes.
|
|
// @return Editor graph associated with UMetaSoundSource.
|
|
virtual UEdGraph* GetGraph() override;
|
|
virtual const UEdGraph* GetGraph() const override;
|
|
virtual UEdGraph& GetGraphChecked() override;
|
|
virtual const UEdGraph& GetGraphChecked() const override;
|
|
|
|
// Sets the graph associated with this Metasound. Graph is required to be referenced on
|
|
// Metasound UObject for editor serialization purposes.
|
|
// @param Editor graph associated with UMetaSoundSource.
|
|
virtual void SetGraph(UEdGraph* InGraph) override
|
|
{
|
|
Graph = CastChecked<UMetasoundEditorGraphBase>(InGraph);
|
|
}
|
|
#endif // #if WITH_EDITORONLY_DATA
|
|
|
|
#if WITH_EDITOR
|
|
virtual void PreSave(FObjectPreSaveContext SaveContext) override;
|
|
virtual void PostEditUndo() override;
|
|
virtual void PostEditChangeProperty(FPropertyChangedEvent& InEvent) override;
|
|
#endif // WITH_EDITOR
|
|
|
|
virtual const FMetasoundFrontendArchetype& GetArchetype() const override;
|
|
|
|
// If set to be a preset, converts to a full-access MetaSound,
|
|
// removing edit restrictions and excluding it from automatic
|
|
// interface versioning.
|
|
UFUNCTION(Category = Metasound, meta = (CallInEditor = "true"))
|
|
void ConvertFromPreset();
|
|
|
|
UObject* GetOwningAsset() override
|
|
{
|
|
return this;
|
|
}
|
|
|
|
const UObject* GetOwningAsset() const override
|
|
{
|
|
return this;
|
|
}
|
|
|
|
TUniquePtr<IAudioInstanceTransmitter> CreateInstanceTransmitter(const FAudioInstanceTransmitterInitParams& InParams) const;
|
|
|
|
// Get the most up to date archetype for metasound sources.
|
|
const TArray<FMetasoundFrontendArchetype>& GetPreferredArchetypes() const override;
|
|
|
|
protected:
|
|
|
|
Metasound::Frontend::FDocumentAccessPtr GetDocument() override
|
|
{
|
|
using namespace Metasound::Frontend;
|
|
// Return document using FAccessPoint to inform the TAccessPtr when the
|
|
// object is no longer valid.
|
|
return MakeAccessPtr<FDocumentAccessPtr>(RootMetaSoundDocument.AccessPoint, RootMetaSoundDocument);
|
|
}
|
|
|
|
Metasound::Frontend::FConstDocumentAccessPtr GetDocument() const override
|
|
{
|
|
using namespace Metasound::Frontend;
|
|
// Return document using FAccessPoint to inform the TAccessPtr when the
|
|
// object is no longer valid.
|
|
return MakeAccessPtr<FConstDocumentAccessPtr>(RootMetaSoundDocument.AccessPoint, RootMetaSoundDocument);
|
|
}
|
|
|
|
bool CopyDocumentAndInjectReceiveNodes(uint64 InInstanceID, const FMetasoundFrontendDocument& InSourceDoc, FMetasoundFrontendDocument& OutDestDoc) const;
|
|
|
|
private:
|
|
TArray<FString> GetTransmittableInputVertexNames() const;
|
|
Metasound::FOperatorSettings GetOperatorSettings(Metasound::FSampleRate InSampleRate) const;
|
|
Metasound::FSendAddress CreateSendAddress(uint64 InInstanceID, const FString& InVertexName, const FName& InDataTypeName) const;
|
|
static const FString& GetAudioDeviceHandleVariableName();
|
|
static const FMetasoundFrontendArchetype& GetBaseArchetype();
|
|
};
|