You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#preflight 64513fbb4d593c0b42b03cc8 #rb phil.popp [CL 25320519 by charlie huguenard in ue5-main branch]
103 lines
4.8 KiB
C++
103 lines
4.8 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#include "MetasoundEngineModule.h"
|
|
|
|
#include "Metasound.h"
|
|
#include "MetasoundAudioBus.h"
|
|
#include "MetasoundDataReference.h"
|
|
#include "MetasoundDataTypeRegistrationMacro.h"
|
|
#include "MetasoundFrontendDocumentBuilder.h"
|
|
#include "MetasoundOutputSubsystem.h"
|
|
#include "MetasoundSource.h"
|
|
#include "MetasoundTrace.h"
|
|
#include "MetasoundUObjectRegistry.h"
|
|
#include "MetasoundWave.h"
|
|
#include "MetasoundWaveTable.h"
|
|
#include "Analysis/MetasoundFrontendAnalyzerRegistry.h"
|
|
#include "Analysis/MetasoundFrontendVertexAnalyzerEnvelopeFollower.h"
|
|
#include "Analysis/MetasoundFrontendVertexAnalyzerForwardValue.h"
|
|
#include "Analysis/MetasoundFrontendVertexAnalyzerTriggerDensity.h"
|
|
#include "Analysis/MetasoundFrontendVertexAnalyzerTriggerToTime.h"
|
|
#include "Interfaces/MetasoundDeprecatedInterfaces.h"
|
|
#include "Interfaces/MetasoundInterface.h"
|
|
#include "Interfaces/MetasoundInterfaceBindingsPrivate.h"
|
|
#include "Modules/ModuleManager.h"
|
|
#include "Sound/AudioSettings.h"
|
|
|
|
DEFINE_LOG_CATEGORY(LogMetasoundEngine);
|
|
|
|
|
|
REGISTER_METASOUND_DATATYPE(Metasound::FAudioBusAsset, "AudioBusAsset", Metasound::ELiteralType::UObjectProxy, UAudioBus);
|
|
REGISTER_METASOUND_DATATYPE(Metasound::FWaveAsset, "WaveAsset", Metasound::ELiteralType::UObjectProxy, USoundWave);
|
|
REGISTER_METASOUND_DATATYPE(WaveTable::FWaveTable, "WaveTable", Metasound::ELiteralType::FloatArray)
|
|
REGISTER_METASOUND_DATATYPE(Metasound::FWaveTableBankAsset, "WaveTableBankAsset", Metasound::ELiteralType::UObjectProxy, UWaveTableBank);
|
|
|
|
|
|
class FMetasoundEngineModule : public IMetasoundEngineModule
|
|
{
|
|
virtual void StartupModule() override
|
|
{
|
|
using namespace Metasound;
|
|
using namespace Metasound::Engine;
|
|
|
|
METASOUND_LLM_SCOPE;
|
|
FModuleManager::Get().LoadModuleChecked("MetasoundGraphCore");
|
|
FModuleManager::Get().LoadModuleChecked("MetasoundFrontend");
|
|
FModuleManager::Get().LoadModuleChecked("MetasoundStandardNodes");
|
|
FModuleManager::Get().LoadModuleChecked("MetasoundGenerator");
|
|
FModuleManager::Get().LoadModuleChecked("AudioCodecEngine");
|
|
FModuleManager::Get().LoadModuleChecked("WaveTable");
|
|
|
|
// Register engine-level parameter interfaces if not done already.
|
|
// (Potentially not already called if plugin is loaded while cooking.)
|
|
UAudioSettings* AudioSettings = GetMutableDefault<UAudioSettings>();
|
|
check(AudioSettings);
|
|
AudioSettings->RegisterParameterInterfaces();
|
|
|
|
IMetasoundUObjectRegistry::Get().RegisterUClass(MakeUnique<TMetasoundUObjectRegistryEntry<UMetaSoundBuilderDocument>>());
|
|
IMetasoundUObjectRegistry::Get().RegisterUClass(MakeUnique<TMetasoundUObjectRegistryEntry<UMetaSoundPatch>>());
|
|
IMetasoundUObjectRegistry::Get().RegisterUClass(MakeUnique<TMetasoundUObjectRegistryEntry<UMetaSoundSource>>());
|
|
|
|
Engine::RegisterDeprecatedInterfaces();
|
|
Engine::RegisterInterfaces();
|
|
Engine::RegisterInternalInterfaceBindings();
|
|
|
|
// Flush node registration queue
|
|
FMetasoundFrontendRegistryContainer::Get()->RegisterPendingNodes();
|
|
|
|
// Register Analyzers
|
|
METASOUND_REGISTER_VERTEX_ANALYZER_FACTORY(Frontend::FVertexAnalyzerEnvelopeFollower)
|
|
METASOUND_REGISTER_VERTEX_ANALYZER_FACTORY(Frontend::FVertexAnalyzerTriggerDensity)
|
|
METASOUND_REGISTER_VERTEX_ANALYZER_FACTORY(Frontend::FVertexAnalyzerForwardBool)
|
|
METASOUND_REGISTER_VERTEX_ANALYZER_FACTORY(Frontend::FVertexAnalyzerForwardFloat)
|
|
METASOUND_REGISTER_VERTEX_ANALYZER_FACTORY(Frontend::FVertexAnalyzerForwardInt)
|
|
METASOUND_REGISTER_VERTEX_ANALYZER_FACTORY(Frontend::FVertexAnalyzerForwardString)
|
|
METASOUND_REGISTER_VERTEX_ANALYZER_FACTORY(Frontend::FVertexAnalyzerTriggerToTime)
|
|
|
|
// Register passthrough output analyzers
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
|
GetMetasoundDataTypeName<float>(),
|
|
Frontend::FVertexAnalyzerForwardFloat::GetAnalyzerName(),
|
|
Frontend::FVertexAnalyzerForwardFloat::FOutputs::GetValue().Name);
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
|
GetMetasoundDataTypeName<int32>(),
|
|
Frontend::FVertexAnalyzerForwardInt::GetAnalyzerName(),
|
|
Frontend::FVertexAnalyzerForwardInt::FOutputs::GetValue().Name);
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
|
GetMetasoundDataTypeName<bool>(),
|
|
Frontend::FVertexAnalyzerForwardBool::GetAnalyzerName(),
|
|
Frontend::FVertexAnalyzerForwardBool::FOutputs::GetValue().Name);
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
|
GetMetasoundDataTypeName<FString>(),
|
|
Frontend::FVertexAnalyzerForwardString::GetAnalyzerName(),
|
|
Frontend::FVertexAnalyzerForwardString::FOutputs::GetValue().Name);
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
|
GetMetasoundDataTypeName<FTrigger>(),
|
|
Frontend::FVertexAnalyzerTriggerToTime::GetAnalyzerName(),
|
|
Frontend::FVertexAnalyzerTriggerToTime::FOutputs::GetValue().Name);
|
|
|
|
UE_LOG(LogMetasoundEngine, Log, TEXT("MetaSound Engine Initialized"));
|
|
}
|
|
};
|
|
|
|
IMPLEMENT_MODULE(FMetasoundEngineModule, MetasoundEngine);
|