src/audio/xaudio2/SDL_xaudio2.c
changeset 5635 bef0f093c9da
parent 5634 093e60544778
child 5636 44bfdab5eaf1
equal deleted inserted replaced
5634:093e60544778 5635:bef0f093c9da
    22 #include "../../core/windows/SDL_windows.h"
    22 #include "../../core/windows/SDL_windows.h"
    23 #include "SDL_audio.h"
    23 #include "SDL_audio.h"
    24 #include "../SDL_audio_c.h"
    24 #include "../SDL_audio_c.h"
    25 #include "SDL_assert.h"
    25 #include "SDL_assert.h"
    26 
    26 
       
    27 #include "../SDL_sysaudio.h"
       
    28 
       
    29 #if SDL_AUDIO_DRIVER_XAUDIO2
       
    30 #include <dxsdkver.h> /* XAudio2 exists as of the March 2008 DirectX SDK */
       
    31 #if (defined(_DXSDK_BUILD_MAJOR) && (_DXSDK_BUILD_MAJOR >= 1284))
       
    32 #   define SDL_HAVE_XAUDIO2_H 1
       
    33 #endif
       
    34 #endif
       
    35 
       
    36 #ifdef SDL_HAVE_XAUDIO2_H
       
    37 
    27 #define INITGUID 1
    38 #define INITGUID 1
    28 #include "SDL_xaudio2.h"
    39 #include <XAudio2.h>
    29 
    40 
    30 #ifdef SDL_HAVE_XAUDIO2_H
    41 /* Hidden "this" pointer for the audio functions */
       
    42 #define _THIS	SDL_AudioDevice *this
       
    43 
       
    44 struct SDL_PrivateAudioData
       
    45 {
       
    46     IXAudio2 *ixa2;
       
    47     IXAudio2SourceVoice *source;
       
    48     IXAudio2MasteringVoice *mastering;
       
    49     HANDLE semaphore;
       
    50     Uint8 *mixbuf;
       
    51     int mixlen;
       
    52     Uint8 *nextbuf;
       
    53 };
       
    54 
    31 
    55 
    32 static __inline__ char *
    56 static __inline__ char *
    33 utf16_to_utf8(const WCHAR *S)
    57 utf16_to_utf8(const WCHAR *S)
    34 {
    58 {
    35     /* !!! FIXME: this should be UTF-16, not UCS-2! */
    59     /* !!! FIXME: this should be UTF-16, not UCS-2! */