2020-07-14 17:58:13 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
#include "MetasoundEngineModule.h"
|
|
|
|
|
|
2020-07-15 00:16:40 -04:00
|
|
|
#include "Metasound.h"
|
2023-03-20 17:13:25 -04:00
|
|
|
#include "MetasoundAudioBus.h"
|
2020-11-04 14:26:37 -04:00
|
|
|
#include "MetasoundDataReference.h"
|
2020-08-06 16:10:06 -04:00
|
|
|
#include "MetasoundDataTypeRegistrationMacro.h"
|
2023-04-04 19:14:26 -04:00
|
|
|
#include "MetasoundFrontendDocumentBuilder.h"
|
2023-03-21 10:01:25 -04:00
|
|
|
#include "MetasoundOutputSubsystem.h"
|
2020-12-14 15:48:27 -04:00
|
|
|
#include "MetasoundSource.h"
|
2022-07-11 12:49:10 -04:00
|
|
|
#include "MetasoundTrace.h"
|
2020-12-14 15:48:27 -04:00
|
|
|
#include "MetasoundUObjectRegistry.h"
|
|
|
|
|
#include "MetasoundWave.h"
|
2022-06-27 12:00:38 -04:00
|
|
|
#include "MetasoundWaveTable.h"
|
2023-05-03 13:43:51 -04:00
|
|
|
#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"
|
2020-12-14 15:48:27 -04:00
|
|
|
#include "Modules/ModuleManager.h"
|
2021-12-15 16:05:33 -05:00
|
|
|
#include "Sound/AudioSettings.h"
|
2020-07-15 00:16:40 -04:00
|
|
|
|
2020-07-14 17:58:13 -04:00
|
|
|
DEFINE_LOG_CATEGORY(LogMetasoundEngine);
|
|
|
|
|
|
2022-07-14 17:51:07 -04:00
|
|
|
|
|
|
|
|
REGISTER_METASOUND_DATATYPE(Metasound::FAudioBusAsset, "AudioBusAsset", Metasound::ELiteralType::UObjectProxy, UAudioBus);
|
2021-01-23 12:59:01 -04:00
|
|
|
REGISTER_METASOUND_DATATYPE(Metasound::FWaveAsset, "WaveAsset", Metasound::ELiteralType::UObjectProxy, USoundWave);
|
2022-06-27 12:00:38 -04:00
|
|
|
REGISTER_METASOUND_DATATYPE(WaveTable::FWaveTable, "WaveTable", Metasound::ELiteralType::FloatArray)
|
|
|
|
|
REGISTER_METASOUND_DATATYPE(Metasound::FWaveTableBankAsset, "WaveTableBankAsset", Metasound::ELiteralType::UObjectProxy, UWaveTableBank);
|
2022-07-14 17:51:07 -04:00
|
|
|
|
2020-08-06 16:10:06 -04:00
|
|
|
|
2020-07-14 17:58:13 -04:00
|
|
|
class FMetasoundEngineModule : public IMetasoundEngineModule
|
|
|
|
|
{
|
|
|
|
|
virtual void StartupModule() override
|
|
|
|
|
{
|
2023-03-13 17:23:05 -04:00
|
|
|
using namespace Metasound;
|
|
|
|
|
using namespace Metasound::Engine;
|
|
|
|
|
|
2022-07-11 12:49:10 -04:00
|
|
|
METASOUND_LLM_SCOPE;
|
2021-08-11 15:22:01 -04:00
|
|
|
FModuleManager::Get().LoadModuleChecked("MetasoundGraphCore");
|
2021-06-23 20:08:21 -04:00
|
|
|
FModuleManager::Get().LoadModuleChecked("MetasoundFrontend");
|
2021-08-11 15:22:01 -04:00
|
|
|
FModuleManager::Get().LoadModuleChecked("MetasoundStandardNodes");
|
|
|
|
|
FModuleManager::Get().LoadModuleChecked("MetasoundGenerator");
|
2021-06-23 20:08:21 -04:00
|
|
|
FModuleManager::Get().LoadModuleChecked("AudioCodecEngine");
|
2022-06-27 12:00:38 -04:00
|
|
|
FModuleManager::Get().LoadModuleChecked("WaveTable");
|
2021-06-23 20:08:21 -04:00
|
|
|
|
2021-12-15 16:05:33 -05:00
|
|
|
// 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();
|
|
|
|
|
|
2023-04-04 19:14:26 -04:00
|
|
|
IMetasoundUObjectRegistry::Get().RegisterUClass(MakeUnique<TMetasoundUObjectRegistryEntry<UMetaSoundBuilderDocument>>());
|
2023-03-13 17:23:05 -04:00
|
|
|
IMetasoundUObjectRegistry::Get().RegisterUClass(MakeUnique<TMetasoundUObjectRegistryEntry<UMetaSoundPatch>>());
|
|
|
|
|
IMetasoundUObjectRegistry::Get().RegisterUClass(MakeUnique<TMetasoundUObjectRegistryEntry<UMetaSoundSource>>());
|
|
|
|
|
|
|
|
|
|
Engine::RegisterDeprecatedInterfaces();
|
|
|
|
|
Engine::RegisterInterfaces();
|
|
|
|
|
Engine::RegisterInternalInterfaceBindings();
|
2021-06-23 20:08:21 -04:00
|
|
|
|
2021-11-22 15:55:50 -05:00
|
|
|
// Flush node registration queue
|
2021-03-04 19:23:41 -04:00
|
|
|
FMetasoundFrontendRegistryContainer::Get()->RegisterPendingNodes();
|
|
|
|
|
|
2022-05-10 16:51:39 -04:00
|
|
|
// Register Analyzers
|
2023-05-03 13:43:51 -04:00
|
|
|
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)
|
2023-03-20 17:13:25 -04:00
|
|
|
|
2023-03-21 10:01:25 -04:00
|
|
|
// Register passthrough output analyzers
|
2023-04-05 17:42:36 -04:00
|
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
2023-03-21 10:01:25 -04:00
|
|
|
GetMetasoundDataTypeName<float>(),
|
2023-05-03 13:43:51 -04:00
|
|
|
Frontend::FVertexAnalyzerForwardFloat::GetAnalyzerName(),
|
|
|
|
|
Frontend::FVertexAnalyzerForwardFloat::FOutputs::GetValue().Name);
|
2023-04-05 17:42:36 -04:00
|
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
2023-03-21 10:01:25 -04:00
|
|
|
GetMetasoundDataTypeName<int32>(),
|
2023-05-03 13:43:51 -04:00
|
|
|
Frontend::FVertexAnalyzerForwardInt::GetAnalyzerName(),
|
|
|
|
|
Frontend::FVertexAnalyzerForwardInt::FOutputs::GetValue().Name);
|
2023-04-05 17:42:36 -04:00
|
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
2023-03-21 10:01:25 -04:00
|
|
|
GetMetasoundDataTypeName<bool>(),
|
2023-05-03 13:43:51 -04:00
|
|
|
Frontend::FVertexAnalyzerForwardBool::GetAnalyzerName(),
|
|
|
|
|
Frontend::FVertexAnalyzerForwardBool::FOutputs::GetValue().Name);
|
2023-04-05 17:42:36 -04:00
|
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
2023-03-21 10:01:25 -04:00
|
|
|
GetMetasoundDataTypeName<FString>(),
|
2023-05-03 13:43:51 -04:00
|
|
|
Frontend::FVertexAnalyzerForwardString::GetAnalyzerName(),
|
|
|
|
|
Frontend::FVertexAnalyzerForwardString::FOutputs::GetValue().Name);
|
|
|
|
|
UMetasoundGeneratorHandle::RegisterPassthroughAnalyzerForType(
|
|
|
|
|
GetMetasoundDataTypeName<FTrigger>(),
|
|
|
|
|
Frontend::FVertexAnalyzerTriggerToTime::GetAnalyzerName(),
|
|
|
|
|
Frontend::FVertexAnalyzerTriggerToTime::FOutputs::GetValue().Name);
|
2023-03-21 10:01:25 -04:00
|
|
|
|
2021-11-22 15:55:50 -05:00
|
|
|
UE_LOG(LogMetasoundEngine, Log, TEXT("MetaSound Engine Initialized"));
|
2020-07-14 17:58:13 -04:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FMetasoundEngineModule, MetasoundEngine);
|