Added WASAPI audio target to autoconf build process
authorSam Lantinga <slouken@libsdl.org>
Fri, 18 Aug 2017 17:29:44 -0700
changeset 11325b7b407184886
parent 11324 670978408a10
child 11326 ba4fe3686323
Added WASAPI audio target to autoconf build process
configure
configure.in
include/SDL_config.h.cmake
include/SDL_config.h.in
src/audio/wasapi/SDL_wasapi.c
     1.1 --- a/configure	Fri Aug 18 20:25:14 2017 -0400
     1.2 +++ b/configure	Fri Aug 18 17:29:44 2017 -0700
     1.3 @@ -23840,6 +23840,10 @@
     1.4  
     1.5                  SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
     1.6              fi
     1.7 +
     1.8 +$as_echo "#define SDL_AUDIO_DRIVER_WASAPI 1" >>confdefs.h
     1.9 +
    1.10 +            SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c"
    1.11              have_audio=yes
    1.12          fi
    1.13          # Set up files for the joystick library
     2.1 --- a/configure.in	Fri Aug 18 20:25:14 2017 -0400
     2.2 +++ b/configure.in	Fri Aug 18 17:29:44 2017 -0700
     2.3 @@ -3405,6 +3405,8 @@
     2.4                  AC_DEFINE(SDL_AUDIO_DRIVER_XAUDIO2, 1, [ ])
     2.5                  SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
     2.6              fi
     2.7 +            AC_DEFINE(SDL_AUDIO_DRIVER_WASAPI, 1, [ ])
     2.8 +            SOURCES="$SOURCES $srcdir/src/audio/wasapi/*.c"
     2.9              have_audio=yes
    2.10          fi
    2.11          # Set up files for the joystick library
     3.1 --- a/include/SDL_config.h.cmake	Fri Aug 18 20:25:14 2017 -0400
     3.2 +++ b/include/SDL_config.h.cmake	Fri Aug 18 17:29:44 2017 -0700
     3.3 @@ -211,38 +211,38 @@
     3.4  #cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@
     3.5  
     3.6  /* Enable various audio drivers */
     3.7 -#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@
     3.8  #cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@
     3.9  #cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@
    3.10 +#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@
    3.11 +#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@
    3.12 +#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@
    3.13 +#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@
    3.14 +#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@
    3.15 +#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@
    3.16 +#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@
    3.17 +#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@
    3.18 +#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@
    3.19 +#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@
    3.20 +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@
    3.21 +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@
    3.22 +#cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@
    3.23  #cmakedefine SDL_AUDIO_DRIVER_JACK @SDL_AUDIO_DRIVER_JACK@
    3.24  #cmakedefine SDL_AUDIO_DRIVER_JACK_DYNAMIC @SDL_AUDIO_DRIVER_JACK_DYNAMIC@
    3.25 -#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@
    3.26 -#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@
    3.27 -#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@
    3.28 -#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@
    3.29 -#cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@
    3.30 -#cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@
    3.31 -#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@
    3.32 -#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@
    3.33 -#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@
    3.34 -#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@
    3.35 -#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@
    3.36 -#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@
    3.37 -#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@
    3.38 -#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@
    3.39  #cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@
    3.40  #cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@
    3.41 -#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@
    3.42 -#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@
    3.43 +#cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@
    3.44  #cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@
    3.45  #cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@
    3.46  #cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@
    3.47 +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@
    3.48 +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@
    3.49  #cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@
    3.50 +#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@
    3.51 +#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@
    3.52  #cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@
    3.53 +#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@
    3.54  #cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@
    3.55 -#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@
    3.56 -#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@
    3.57 -#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@
    3.58 +#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@
    3.59  
    3.60  /* Enable various input drivers */
    3.61  #cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
     4.1 --- a/include/SDL_config.h.in	Fri Aug 18 20:25:14 2017 -0400
     4.2 +++ b/include/SDL_config.h.in	Fri Aug 18 17:29:44 2017 -0700
     4.3 @@ -213,36 +213,37 @@
     4.4  /* Enable various audio drivers */
     4.5  #undef SDL_AUDIO_DRIVER_ALSA
     4.6  #undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
     4.7 +#undef SDL_AUDIO_DRIVER_ANDROID
     4.8 +#undef SDL_AUDIO_DRIVER_ARTS
     4.9 +#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
    4.10 +#undef SDL_AUDIO_DRIVER_COREAUDIO
    4.11 +#undef SDL_AUDIO_DRIVER_DISK
    4.12 +#undef SDL_AUDIO_DRIVER_DSOUND
    4.13 +#undef SDL_AUDIO_DRIVER_DUMMY
    4.14 +#undef SDL_AUDIO_DRIVER_EMSCRIPTEN
    4.15 +#undef SDL_AUDIO_DRIVER_ESD
    4.16 +#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
    4.17 +#undef SDL_AUDIO_DRIVER_FUSIONSOUND
    4.18 +#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
    4.19 +#undef SDL_AUDIO_DRIVER_HAIKU
    4.20  #undef SDL_AUDIO_DRIVER_JACK
    4.21  #undef SDL_AUDIO_DRIVER_JACK_DYNAMIC
    4.22 -#undef SDL_AUDIO_DRIVER_ARTS
    4.23 -#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
    4.24 -#undef SDL_AUDIO_DRIVER_PULSEAUDIO
    4.25 -#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
    4.26 -#undef SDL_AUDIO_DRIVER_HAIKU
    4.27 -#undef SDL_AUDIO_DRIVER_NETBSD
    4.28 -#undef SDL_AUDIO_DRIVER_COREAUDIO
    4.29 -#undef SDL_AUDIO_DRIVER_DISK
    4.30 -#undef SDL_AUDIO_DRIVER_DUMMY
    4.31 -#undef SDL_AUDIO_DRIVER_ANDROID
    4.32 -#undef SDL_AUDIO_DRIVER_XAUDIO2
    4.33 -#undef SDL_AUDIO_DRIVER_DSOUND
    4.34 -#undef SDL_AUDIO_DRIVER_ESD
    4.35 -#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
    4.36  #undef SDL_AUDIO_DRIVER_NACL
    4.37  #undef SDL_AUDIO_DRIVER_NAS
    4.38  #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
    4.39 -#undef SDL_AUDIO_DRIVER_SNDIO
    4.40 -#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
    4.41 +#undef SDL_AUDIO_DRIVER_NETBSD
    4.42  #undef SDL_AUDIO_DRIVER_OSS
    4.43  #undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
    4.44  #undef SDL_AUDIO_DRIVER_PAUDIO
    4.45 +#undef SDL_AUDIO_DRIVER_PULSEAUDIO
    4.46 +#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
    4.47  #undef SDL_AUDIO_DRIVER_QSA
    4.48 +#undef SDL_AUDIO_DRIVER_SNDIO
    4.49 +#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
    4.50  #undef SDL_AUDIO_DRIVER_SUNAUDIO
    4.51 +#undef SDL_AUDIO_DRIVER_WASAPI
    4.52  #undef SDL_AUDIO_DRIVER_WINMM
    4.53 -#undef SDL_AUDIO_DRIVER_FUSIONSOUND
    4.54 -#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
    4.55 -#undef SDL_AUDIO_DRIVER_EMSCRIPTEN
    4.56 +#undef SDL_AUDIO_DRIVER_XAUDIO2
    4.57  
    4.58  /* Enable various input drivers */
    4.59  #undef SDL_INPUT_LINUXEV
     5.1 --- a/src/audio/wasapi/SDL_wasapi.c	Fri Aug 18 20:25:14 2017 -0400
     5.2 +++ b/src/audio/wasapi/SDL_wasapi.c	Fri Aug 18 17:29:44 2017 -0700
     5.3 @@ -182,7 +182,6 @@
     5.4  static HRESULT STDMETHODCALLTYPE
     5.5  SDLMMNotificationClient_OnDeviceStateChanged(IMMNotificationClient *ithis, LPCWSTR pwstrDeviceId, DWORD dwNewState)
     5.6  {
     5.7 -    SDLMMNotificationClient *this = (SDLMMNotificationClient *) ithis;
     5.8      IMMDevice *device = NULL;
     5.9  
    5.10      if (SUCCEEDED(IMMDeviceEnumerator_GetDevice(enumerator, pwstrDeviceId, &device))) {
    5.11 @@ -222,7 +221,7 @@
    5.12      SDLMMNotificationClient_OnPropertyValueChanged
    5.13  };
    5.14  
    5.15 -static SDLMMNotificationClient notification_client = { &notification_client_vtbl, 1 };
    5.16 +static SDLMMNotificationClient notification_client = { &notification_client_vtbl, { 1 } };
    5.17  
    5.18  static SDL_bool
    5.19  WStrEqual(const WCHAR *a, const WCHAR *b)