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"
|
2020-11-04 14:26:37 -04:00
|
|
|
#include "MetasoundDataReference.h"
|
2020-08-06 16:10:06 -04:00
|
|
|
#include "MetasoundDataTypeRegistrationMacro.h"
|
2021-06-23 20:08:21 -04:00
|
|
|
#include "MetasoundEngineArchetypes.h"
|
2020-12-14 15:48:27 -04:00
|
|
|
#include "MetasoundSource.h"
|
|
|
|
|
#include "MetasoundUObjectRegistry.h"
|
|
|
|
|
#include "MetasoundWave.h"
|
|
|
|
|
#include "Modules/ModuleManager.h"
|
2020-07-15 00:16:40 -04:00
|
|
|
|
2020-07-14 17:58:13 -04:00
|
|
|
DEFINE_LOG_CATEGORY(LogMetasoundEngine);
|
|
|
|
|
|
2021-01-23 12:59:01 -04:00
|
|
|
REGISTER_METASOUND_DATATYPE(Metasound::FWaveAsset, "WaveAsset", Metasound::ELiteralType::UObjectProxy, USoundWave);
|
2020-08-06 16:10:06 -04:00
|
|
|
|
2020-07-14 17:58:13 -04:00
|
|
|
class FMetasoundEngineModule : public IMetasoundEngineModule
|
|
|
|
|
{
|
|
|
|
|
virtual void StartupModule() override
|
|
|
|
|
{
|
2021-06-23 20:08:21 -04:00
|
|
|
FModuleManager::Get().LoadModuleChecked("MetasoundFrontend");
|
|
|
|
|
FModuleManager::Get().LoadModuleChecked("AudioCodecEngine");
|
|
|
|
|
|
|
|
|
|
Metasound::Engine::RegisterArchetypes();
|
|
|
|
|
|
2021-04-02 02:09:50 -04:00
|
|
|
// If there is no archetype name, use UMetaSound
|
2021-06-23 20:08:21 -04:00
|
|
|
FMetasoundFrontendVersion DefaultVersion;
|
|
|
|
|
Metasound::IMetasoundUObjectRegistry::RegisterUClassArchetype<UMetaSound>(DefaultVersion);
|
2020-12-14 15:48:27 -04:00
|
|
|
|
|
|
|
|
// Register preferred archetypes
|
2021-06-08 10:52:31 -04:00
|
|
|
Metasound::IMetasoundUObjectRegistry::RegisterUClassPreferredArchetypes<UMetaSound>();
|
2021-04-02 02:09:50 -04:00
|
|
|
Metasound::IMetasoundUObjectRegistry::RegisterUClassPreferredArchetypes<UMetaSoundSource>();
|
2020-07-23 20:32:26 -04:00
|
|
|
|
2021-06-08 10:52:31 -04:00
|
|
|
// flush node registration queue
|
2021-03-04 19:23:41 -04:00
|
|
|
FMetasoundFrontendRegistryContainer::Get()->RegisterPendingNodes();
|
|
|
|
|
|
2020-07-14 17:58:13 -04:00
|
|
|
UE_LOG(LogMetasoundEngine, Log, TEXT("Metasound Engine Initialized"));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FMetasoundEngineModule, MetasoundEngine);
|