Files
UnrealEngineUWP/Engine/Plugins/Runtime/Metasound/Source/MetasoundEngine/Public/Metasound.h
rob gay adb961b654 Rename Metasound to MetaSound (PascalCase) in all places in UX. (Code-side to be cleaned up post EA)
#rb trivial
#jira nojira
#preflight 6066ab3dc5a3a100016fc8a0

#ROBOMERGE-SOURCE: CL 15899490 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15899491 by rob gay in ue5-main branch]
2021-04-02 02:09:50 -04:00

88 lines
2.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "MetasoundFrontend.h"
#include "MetasoundFrontendDocument.h"
#include "MetasoundAssetBase.h"
#if WITH_EDITORONLY_DATA
#include "EdGraph/EdGraph.h"
#include "Misc/AssertionMacros.h"
#endif // WITH_EDITORONLY_DATA
#include "Metasound.generated.h"
// Forward Declarations
class FEditPropertyChain;
struct FPropertyChangedEvent;
/**
* This asset type is used for Metasound assets that can only be used as nodes in other Metasound graphs.
* Because of this, they can have any inputs or outputs they need.
*/
UCLASS(hidecategories = object, BlueprintType)
class METASOUNDENGINE_API UMetaSound : public UObject, public FMetasoundAssetBase
{
GENERATED_BODY()
protected:
UPROPERTY(EditAnywhere, Category = CustomView)
FMetasoundFrontendDocument MetasoundDocument;
// Returns document object responsible for serializing asset
Metasound::Frontend::TAccessPtr<FMetasoundFrontendDocument> GetDocument() override;
// Returns document object responsible for serializing asset
Metasound::Frontend::TAccessPtr<const FMetasoundFrontendDocument> GetDocument() const override;
#if WITH_EDITORONLY_DATA
UPROPERTY()
UEdGraph* 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, MetasoundDocument);
}
// 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 UMetaSound.
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 UMetaSound.
virtual void SetGraph(UEdGraph* InGraph) override;
#endif // WITH_EDITORONLY_DATA
UObject* GetOwningAsset() override
{
return this;
}
const UObject* GetOwningAsset() const override
{
return this;
}
const TArray<FMetasoundFrontendArchetype>& GetPreferredMetasoundArchetypes() const override;
bool IsMetasoundArchetypeSupported(const FMetasoundFrontendArchetype& InArchetype) const override;
const FMetasoundFrontendArchetype& GetPreferredMetasoundArchetype(const FMetasoundFrontendDocument& InDocument) const override;
};