2022-05-10 16:51:39 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Analysis/MetasoundFrontendVertexAnalyzer.h"
|
2022-05-12 13:47:17 -04:00
|
|
|
#include "Containers/Array.h"
|
2022-05-10 16:51:39 -04:00
|
|
|
#include "HAL/Platform.h"
|
|
|
|
|
#include "MetasoundAssetBase.h"
|
|
|
|
|
#include "MetasoundRouter.h"
|
|
|
|
|
#include "Templates/UniquePtr.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Forward Declarations
|
|
|
|
|
class FMetasoundAssetBase;
|
|
|
|
|
class UAudioComponent;
|
|
|
|
|
|
|
|
|
|
namespace Metasound
|
|
|
|
|
{
|
2022-05-12 13:47:17 -04:00
|
|
|
// Forward Declarations
|
|
|
|
|
class FOperatorSettings;
|
|
|
|
|
|
2022-05-10 16:51:39 -04:00
|
|
|
namespace Frontend
|
|
|
|
|
{
|
|
|
|
|
// Pairs an IReceiver with a given AnalyzerAddress, which enables
|
|
|
|
|
// watching a particular analyzer result on any given thread.
|
|
|
|
|
class METASOUNDFRONTEND_API FMetasoundAnalyzerView
|
|
|
|
|
{
|
2022-05-12 13:47:17 -04:00
|
|
|
TMap<FName, TSharedPtr<IReceiver>> OutputReceivers;
|
2022-05-10 16:51:39 -04:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
const FAnalyzerAddress AnalyzerAddress = { };
|
|
|
|
|
|
|
|
|
|
FMetasoundAnalyzerView() = default;
|
2022-05-12 13:47:17 -04:00
|
|
|
FMetasoundAnalyzerView(FAnalyzerAddress&& InAnalyzerAddress);
|
2022-05-10 16:51:39 -04:00
|
|
|
|
2022-05-12 13:47:17 -04:00
|
|
|
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;
|
|
|
|
|
}
|
2023-03-20 17:13:25 -04:00
|
|
|
|
|
|
|
|
struct FBoundOutputDescription
|
|
|
|
|
{
|
|
|
|
|
FName Name;
|
|
|
|
|
FName TypeName;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
TArray<FBoundOutputDescription> GetBoundOutputDescriptions() const;
|
2022-05-10 16:51:39 -04:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|