XAudio2 APU stub.

This commit is contained in:
gibbed
2014-01-12 23:23:55 -08:00
parent 4e9d3a00e4
commit edb1633fc9
12 changed files with 373 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ using namespace xe::apu;
DEFINE_string(apu, "any",
"Audio system. Use: [any, nop]");
"Audio system. Use: [any, nop, xaudio2]");
#include <xenia/apu/nop/nop_apu.h>
@@ -26,13 +26,32 @@ AudioSystem* xe::apu::CreateNop(Emulator* emulator) {
}
#if XE_PLATFORM_WIN32
#include <xenia/apu/xaudio2/xaudio2_apu.h>
AudioSystem* xe::apu::CreateXAudio2(Emulator* emulator) {
return xe::apu::xaudio2::Create(emulator);
}
#endif // WIN32
AudioSystem* xe::apu::Create(Emulator* emulator) {
if (FLAGS_apu.compare("nop") == 0) {
return CreateNop(emulator);
#if XE_PLATFORM_WIN32
}
else if (FLAGS_apu.compare("xaudio2") == 0) {
return CreateXAudio2(emulator);
#endif // WIN32
} else {
// Create best available.
AudioSystem* best = NULL;
#if XE_PLATFORM_WIN32
best = CreateXAudio2(emulator);
if (best) {
return best;
}
#endif // WIN32
// Fallback to nop.
return CreateNop(emulator);
}