Files
UnrealEngineUWP/Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Private/MetasoundFrontendVariableController.h
rob gay 45e4645008 Compile out editor-only data from MetaSoundFrontend
- Move Author field to FString to avoid generated text collisions (Authors should always be culture invariant anyway) & add option to override default in MetaSound user settings
#rb helen.yang
#jira UE-142159
#preflight 62055c89057375a802938669

#ROBOMERGE-AUTHOR: rob.gay
#ROBOMERGE-SOURCE: CL 18941073 in //UE5/Release-5.0/... via CL 18941268 via CL 18941634
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18941665 by rob gay in ue5-main branch]
2022-02-10 15:07:39 -05:00

97 lines
3.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/Array.h"
#include "MetasoundFrontendController.h"
#include "MetasoundFrontendDocument.h"
#include "MetasoundFrontendDocumentAccessPtr.h"
#include "Misc/Guid.h"
namespace Metasound
{
namespace Frontend
{
class METASOUNDFRONTEND_API FVariableController : public IVariableController
{
public:
struct FInitParams
{
FVariableAccessPtr VariablePtr;
FGraphHandle OwningGraph;
};
FVariableController(const FInitParams& InParams);
virtual ~FVariableController() = default;
/** Returns true if the controller is in a valid state. */
virtual bool IsValid() const override;
virtual FGuid GetID() const override;
/** Returns the data type name associated with this variable. */
virtual const FName& GetDataType() const override;
/** Returns the name associated with this variable. */
virtual const FName& GetName() const override;
/** Sets the name associated with this variable. */
virtual void SetName(const FName& InName) override;
#if WITH_EDITOR
/** Returns the human readable name associated with this variable. */
virtual FText GetDisplayName() const override;
/** Sets the human readable name associated with this variable. */
virtual void SetDisplayName(const FText& InDisplayName) override;
/** Returns the human readable description associated with this variable. */
virtual FText GetDescription() const override;
/** Sets the human readable description associated with this variable. */
virtual void SetDescription(const FText& InDescription) override;
#endif // WITH_EDITOR
/** Returns the mutator node associated with this variable. */
virtual FNodeHandle FindMutatorNode() override;
/** Returns the mutator node associated with this variable. */
virtual FConstNodeHandle FindMutatorNode() const override;
/** Returns the accessor nodes associated with this variable. */
virtual TArray<FNodeHandle> FindAccessorNodes() override;
/** Returns the accessor nodes associated with this variable. */
virtual TArray<FConstNodeHandle> FindAccessorNodes() const override;
/** Returns the deferred accessor nodes associated with this variable. */
virtual TArray<FNodeHandle> FindDeferredAccessorNodes() override;
/** Returns the deferred accessor nodes associated with this variable. */
virtual TArray<FConstNodeHandle> FindDeferredAccessorNodes() const override;
/** Returns a FGraphHandle to the node which owns this variable. */
virtual FGraphHandle GetOwningGraph() override;
/** Returns a FConstGraphHandle to the node which owns this variable. */
virtual FConstGraphHandle GetOwningGraph() const override;
/** Returns the value for the given variable instance if set. */
virtual const FMetasoundFrontendLiteral& GetLiteral() const override;
/** Sets the value for the given variable instance */
virtual bool SetLiteral(const FMetasoundFrontendLiteral& InLiteral) override;
private:
virtual FConstDocumentAccess ShareAccess() const override;
virtual FDocumentAccess ShareAccess() override;
TArray<FNodeHandle> GetNodeArray(const TArray<FGuid>& InNodeIDs);
TArray<FConstNodeHandle> GetNodeArray(const TArray<FGuid>& InNodeIDs) const;
FVariableAccessPtr VariablePtr;
FGraphHandle OwningGraph;
};
}
}