Files
UnrealEngineUWP/Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Public/Analysis/MetasoundFrontendVertexAnalyzerTriggerDensity.h
Rob Gay 20742757be - Narrow/privitize template implementation scope for MetaSound Analyzers
- 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]
2022-05-12 13:47:17 -04:00

51 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Analysis/MetasoundFrontendAnalyzerFactory.h"
#include "Containers/Array.h"
#include "DSP/BufferVectorOperations.h"
#include "DSP/EnvelopeFollower.h"
#include "MetasoundTrigger.h"
namespace Metasound
{
namespace Frontend
{
class METASOUNDFRONTEND_API FVertexAnalyzerTriggerDensity : public FVertexAnalyzerBase
{
public:
static const FName& GetAnalyzerName();
static const FName& GetDataType();
struct METASOUNDFRONTEND_API FOutputs
{
static const FAnalyzerOutput& GetValue();
};
class METASOUNDFRONTEND_API FFactory : public TVertexAnalyzerFactory<FVertexAnalyzerTriggerDensity>
{
public:
virtual const TArray<FAnalyzerOutput>& GetAnalyzerOutputs() const override
{
static const TArray<FAnalyzerOutput> Outputs { FOutputs::GetValue() };
return Outputs;
}
};
FVertexAnalyzerTriggerDensity(const FCreateAnalyzerParams& InParams);
virtual ~FVertexAnalyzerTriggerDensity() = default;
virtual void Execute() override;
private:
Audio::FEnvelopeFollower EnvelopeFollower;
TDataWriteReference<float> EnvelopeValue;
int32 NumFramesPerBlock = 0;
Audio::FAlignedFloatBuffer ScratchBuffer;
};
} // namespace Frontend
} // namespace Metasound