2019-12-26 14:45:42 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2018-01-02 15:30:26 -05:00
|
|
|
|
2017-07-26 09:23:14 -04:00
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Misc/Paths.h"
|
|
|
|
|
#include "AudioMixer.h"
|
|
|
|
|
#include "AudioMixerDevice.h"
|
|
|
|
|
#include "AudioMixerPlatformSDL.h"
|
2019-10-11 15:33:31 -04:00
|
|
|
#include COMPILED_PLATFORM_HEADER(AudioMixerSDLDefines.h)
|
2017-07-26 09:23:14 -04:00
|
|
|
|
|
|
|
|
class FAudioMixerModuleSDL : public IAudioDeviceModule
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual bool IsAudioMixerModule() const override { return true; }
|
|
|
|
|
|
|
|
|
|
virtual void StartupModule() override
|
|
|
|
|
{
|
|
|
|
|
#if PLATFORM_WINDOWS
|
|
|
|
|
FString DllPath = FPaths::EngineDir() / "Binaries/ThirdParty/SDL2/Win64/SDL2.dll";
|
|
|
|
|
FString SDL2_Dll = DllPath + "SDL2.dll";
|
|
|
|
|
FPlatformProcess::GetDllHandle(*DllPath);
|
|
|
|
|
#endif
|
2020-02-06 14:31:11 -05:00
|
|
|
IAudioDeviceModule::StartupModule();
|
|
|
|
|
|
|
|
|
|
FModuleManager::Get().LoadModuleChecked(TEXT("AudioMixerCore"));
|
2017-07-26 09:23:14 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual FAudioDevice* CreateAudioDevice() override
|
|
|
|
|
{
|
2019-08-05 12:51:25 -04:00
|
|
|
return new Audio::FMixerDevice(new Audio::FAudioMixerPlatformSDL());
|
2017-07-26 09:23:14 -04:00
|
|
|
}
|
2019-11-14 07:00:39 -05:00
|
|
|
|
|
|
|
|
virtual Audio::IAudioMixerPlatformInterface* CreateAudioMixerPlatformInterface() override
|
|
|
|
|
{
|
|
|
|
|
return new Audio::FAudioMixerPlatformSDL();
|
|
|
|
|
}
|
2017-07-26 09:23:14 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FAudioMixerModuleSDL, AudioMixerSDL);
|