mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
More work. Audio driver works enough to play music now.
This commit is contained in:
23
GpD3D/GpAudioDriverFactory.cpp
Normal file
23
GpD3D/GpAudioDriverFactory.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "GpAudioDriverFactory.h"
|
||||
#include "GpAudioDriverProperties.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
IGpAudioDriver *GpAudioDriverFactory::CreateAudioDriver(const GpAudioDriverProperties &properties)
|
||||
{
|
||||
assert(properties.m_type < EGpAudioDriverType_Count);
|
||||
|
||||
if (ms_registry[properties.m_type])
|
||||
return ms_registry[properties.m_type](properties);
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void GpAudioDriverFactory::RegisterAudioDriverFactory(EGpAudioDriverType type, FactoryFunc_t func)
|
||||
{
|
||||
assert(type < EGpAudioDriverType_Count);
|
||||
|
||||
ms_registry[type] = func;
|
||||
}
|
||||
|
||||
GpAudioDriverFactory::FactoryFunc_t GpAudioDriverFactory::ms_registry[EGpAudioDriverType_Count];
|
Reference in New Issue
Block a user