Added new WASAPI driver for Windows

This commit is contained in:
Marcelo Fernandez 2017-08-27 14:01:34 -03:00
parent bd282ff43f
commit 8e814774b1
8 changed files with 460 additions and 1 deletions

View file

@ -171,6 +171,7 @@ def configure(env):
env.Append(CCFLAGS=['/DWINDOWS_ENABLED'])
env.Append(CCFLAGS=['/DOPENGL_ENABLED'])
env.Append(CCFLAGS=['/DRTAUDIO_ENABLED'])
env.Append(CCFLAGS=['/DWASAPI_ENABLED'])
env.Append(CCFLAGS=['/DTYPED_METHOD_BIND'])
env.Append(CCFLAGS=['/DWIN32'])
env.Append(CCFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver])
@ -252,8 +253,9 @@ def configure(env):
env.Append(CCFLAGS=['-DWINDOWS_ENABLED', '-mwindows'])
env.Append(CCFLAGS=['-DOPENGL_ENABLED'])
env.Append(CCFLAGS=['-DRTAUDIO_ENABLED'])
env.Append(CCFLAGS=['-DWASAPI_ENABLED'])
env.Append(CCFLAGS=['-DWINVER=%s' % winver, '-D_WIN32_WINNT=%s' % winver])
env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid'])
env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser'])
env.Append(CPPFLAGS=['-DMINGW_ENABLED'])

View file

@ -2359,6 +2359,9 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) {
#endif
user_proc = NULL;
#ifdef WASAPI_ENABLED
AudioDriverManager::add_driver(&driver_wasapi);
#endif
#ifdef RTAUDIO_ENABLED
AudioDriverManager::add_driver(&driver_rtaudio);
#endif

View file

@ -32,6 +32,7 @@
#include "context_gl_win.h"
#include "drivers/rtaudio/audio_driver_rtaudio.h"
#include "drivers/wasapi/audio_driver_wasapi.h"
#include "os/input.h"
#include "os/os.h"
#include "power_windows.h"
@ -123,6 +124,9 @@ class OS_Windows : public OS {
PowerWindows *power_manager;
#ifdef WASAPI_ENABLED
AudioDriverWASAPI driver_wasapi;
#endif
#ifdef RTAUDIO_ENABLED
AudioDriverRtAudio driver_rtaudio;
#endif