You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
See unit tests for usage examples. #rb buzz.burrowes, phil.popp, rob.gay #preflight 64078acf5515f4f57b4cb220 [CL 24551990 by charlie huguenard in ue5-main branch]
46 lines
1.6 KiB
C++
46 lines
1.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "MetasoundFrontendController.h"
|
|
#include "MetasoundFrontendDocument.h"
|
|
#include "MetasoundGenerator.h"
|
|
#include "MetasoundNodeInterface.h"
|
|
#include "MetasoundOperatorInterface.h"
|
|
|
|
namespace Metasound::Test
|
|
{
|
|
/** Helper to make testing nodes simpler. */
|
|
class METASOUNDENGINETEST_API FNodeTestGraphBuilder
|
|
{
|
|
public:
|
|
FNodeTestGraphBuilder();
|
|
|
|
/** Add a node to the graph */
|
|
Frontend::FNodeHandle AddNode(const FNodeClassName& ClassName, int32 MajorVersion);
|
|
|
|
/** Add an input node to the graph */
|
|
Frontend::FNodeHandle AddInput(const FName& InputName, const FName& TypeName);
|
|
|
|
/** Add an output node to the graph */
|
|
Frontend::FNodeHandle AddOutput(const FName& OutputName, const FName& TypeName);
|
|
|
|
/** Build the graph and get the graph's operator to work with */
|
|
TUniquePtr<IOperator> BuildGraph(FSampleRate SampleRate = 48000, int32 SamplesPerBlock = 256);
|
|
|
|
TUniquePtr<FMetasoundGenerator> BuildGenerator(FSampleRate SampleRate = 48000, int32 SamplesPerBlock = 256);
|
|
|
|
/** Helper that will add a single node, wire up the node's inputs and outputs, and hand back the graph's operator */
|
|
static TUniquePtr<IOperator> MakeSingleNodeGraph(
|
|
const FNodeClassName& ClassName,
|
|
int32 MajorVersion,
|
|
FSampleRate SampleRate = 48000,
|
|
int32 SamplesPerBlock = 256);
|
|
|
|
private:
|
|
FMetasoundFrontendDocument Document;
|
|
Frontend::FDocumentHandle DocumentHandle = Frontend::IDocumentController::GetInvalidHandle();
|
|
Frontend::FGraphHandle RootGraph = Frontend::IGraphController::GetInvalidHandle();
|
|
};
|
|
}
|