You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Implement/encapsulate binding for analyzer output/sender logic - Move to using FAnyDataReferences where possible over collections for analyzers - Misc clean-up #jira UE-147027 #rb phil.popp #preflight 627d3884332e182a583f19b3 [CL 20167469 by Rob Gay in ue5-main branch]
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#pragma once
|
|
|
|
#include "Analysis/MetasoundFrontendVertexAnalyzer.h"
|
|
#include "Containers/Array.h"
|
|
#include "HAL/Platform.h"
|
|
#include "MetasoundAssetBase.h"
|
|
#include "MetasoundRouter.h"
|
|
#include "Templates/UniquePtr.h"
|
|
|
|
|
|
// Forward Declarations
|
|
class FMetasoundAssetBase;
|
|
class UAudioComponent;
|
|
|
|
namespace Metasound
|
|
{
|
|
// Forward Declarations
|
|
class FOperatorSettings;
|
|
|
|
namespace Frontend
|
|
{
|
|
// Pairs an IReceiver with a given AnalyzerAddress, which enables
|
|
// watching a particular analyzer result on any given thread.
|
|
class METASOUNDFRONTEND_API FMetasoundAnalyzerView
|
|
{
|
|
TMap<FName, TSharedPtr<IReceiver>> OutputReceivers;
|
|
|
|
public:
|
|
const FAnalyzerAddress AnalyzerAddress = { };
|
|
|
|
FMetasoundAnalyzerView() = default;
|
|
FMetasoundAnalyzerView(FAnalyzerAddress&& InAnalyzerAddress);
|
|
|
|
void BindToAllOutputs(const FOperatorSettings& InOperatorSettings);
|
|
bool UnbindOutput(FName InOutputName);
|
|
|
|
template <typename DataType>
|
|
bool TryGetOutputData(FName InOutputName, DataType& OutValue)
|
|
{
|
|
TSharedPtr<IReceiver>* Receiver = OutputReceivers.Find(InOutputName);
|
|
if (Receiver && Receiver->IsValid())
|
|
{
|
|
TReceiver<DataType>& TypedReceiver = (*Receiver)->GetAs<TReceiver<DataType>>();
|
|
if (TypedReceiver.CanPop())
|
|
{
|
|
TypedReceiver.Pop(OutValue);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
};
|
|
}
|
|
}
|