2022-05-10 16:51:39 -04:00
|
|
|
// 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
|
|
|
|
|
{
|
2022-05-12 13:47:17 -04:00
|
|
|
class METASOUNDFRONTEND_API FVertexAnalyzerTriggerDensity : public FVertexAnalyzerBase
|
2022-05-10 16:51:39 -04:00
|
|
|
{
|
|
|
|
|
public:
|
2022-05-12 13:47:17 -04:00
|
|
|
static const FName& GetAnalyzerName();
|
|
|
|
|
static const FName& GetDataType();
|
2022-05-10 16:51:39 -04:00
|
|
|
|
|
|
|
|
struct METASOUNDFRONTEND_API FOutputs
|
|
|
|
|
{
|
2022-05-12 13:47:17 -04:00
|
|
|
static const FAnalyzerOutput& GetValue();
|
2022-05-10 16:51:39 -04:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class METASOUNDFRONTEND_API FFactory : public TVertexAnalyzerFactory<FVertexAnalyzerTriggerDensity>
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual const TArray<FAnalyzerOutput>& GetAnalyzerOutputs() const override
|
|
|
|
|
{
|
2022-05-12 13:47:17 -04:00
|
|
|
static const TArray<FAnalyzerOutput> Outputs { FOutputs::GetValue() };
|
2022-05-10 16:51:39 -04:00
|
|
|
return Outputs;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FVertexAnalyzerTriggerDensity(const FCreateAnalyzerParams& InParams);
|
|
|
|
|
virtual ~FVertexAnalyzerTriggerDensity() = default;
|
|
|
|
|
|
|
|
|
|
virtual void Execute() override;
|
2022-05-12 13:47:17 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
Audio::FEnvelopeFollower EnvelopeFollower;
|
|
|
|
|
TDataWriteReference<float> EnvelopeValue;
|
|
|
|
|
int32 NumFramesPerBlock = 0;
|
|
|
|
|
Audio::FAlignedFloatBuffer ScratchBuffer;
|
2022-05-10 16:51:39 -04:00
|
|
|
};
|
|
|
|
|
} // namespace Frontend
|
|
|
|
|
} // namespace Metasound
|