RetroArch
Classes | Macros | Typedefs | Functions | Variables
xaudio.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <boolean.h>
#include <compat/msvc.h>
#include <retro_miscellaneous.h>
#include "xaudio.h"
#include "../audio_driver.h"
#include "../../verbosity.h"
Include dependency graph for xaudio.c:

Classes

struct  xa_t
 
struct  xaudio2
 

Macros

#define MAX_BUFFERS   16
 
#define MAX_BUFFERS_MASK   (MAX_BUFFERS - 1)
 
#define COINIT_MULTITHREADED   0x00
 
#define XAUDIO2_WRITE_AVAILABLE(handle)   ((handle)->bufsize * (MAX_BUFFERS - (handle)->buffers - 1))
 

Typedefs

typedef struct xaudio2 xaudio2_t
 

Functions

static void WINAPI voice_on_buffer_end (IXAudio2VoiceCallback *handle_, void *data)
 
static void WINAPI dummy_voidp (IXAudio2VoiceCallback *handle, void *data)
 
static void WINAPI dummy_nil (IXAudio2VoiceCallback *handle)
 
static void WINAPI dummy_uint32 (IXAudio2VoiceCallback *handle, UINT32 dummy)
 
static void WINAPI dummy_voidp_hresult (IXAudio2VoiceCallback *handle, void *data, HRESULT dummy)
 
static void xaudio2_set_wavefmt (WAVEFORMATEX *wfx, unsigned channels, unsigned samplerate)
 
static void xaudio2_free (xaudio2_t *handle)
 
static xaudio2_txaudio2_new (unsigned samplerate, unsigned channels, size_t size, unsigned device)
 
static size_t xaudio2_write (xaudio2_t *handle, const uint8_t *buffer, size_t bytes_)
 
static voidxa_init (const char *device, unsigned rate, unsigned latency, unsigned block_frames, unsigned *new_rate)
 
static ssize_t xa_write (void *data, const void *buf, size_t size)
 
static bool xa_stop (void *data)
 
static bool xa_alive (void *data)
 
static void xa_set_nonblock_state (void *data, bool state)
 
static bool xa_start (void *data, bool is_shutdown)
 
static bool xa_use_float (void *data)
 
static void xa_free (void *data)
 
static size_t xa_write_avail (void *data)
 
static size_t xa_buffer_size (void *data)
 

Variables

const struct IXAudio2VoiceCallbackVtbl voice_vtable
 
audio_driver_t audio_xa
 

Macro Definition Documentation

◆ COINIT_MULTITHREADED

#define COINIT_MULTITHREADED   0x00

◆ MAX_BUFFERS

#define MAX_BUFFERS   16

◆ MAX_BUFFERS_MASK

#define MAX_BUFFERS_MASK   (MAX_BUFFERS - 1)

◆ XAUDIO2_WRITE_AVAILABLE

#define XAUDIO2_WRITE_AVAILABLE (   handle)    ((handle)->bufsize * (MAX_BUFFERS - (handle)->buffers - 1))

Typedef Documentation

◆ xaudio2_t

typedef struct xaudio2 xaudio2_t

Function Documentation

◆ dummy_nil()

static void WINAPI dummy_nil ( IXAudio2VoiceCallback *  handle)
static
Here is the call graph for this function:

◆ dummy_uint32()

static void WINAPI dummy_uint32 ( IXAudio2VoiceCallback *  handle,
UINT32  dummy 
)
static
Here is the call graph for this function:

◆ dummy_voidp()

static void WINAPI dummy_voidp ( IXAudio2VoiceCallback *  handle,
void data 
)
static
Here is the call graph for this function:

◆ dummy_voidp_hresult()

static void WINAPI dummy_voidp_hresult ( IXAudio2VoiceCallback *  handle,
void data,
HRESULT  dummy 
)
static
Here is the call graph for this function:

◆ voice_on_buffer_end()

static void WINAPI voice_on_buffer_end ( IXAudio2VoiceCallback *  handle_,
void data 
)
static
Here is the call graph for this function:

◆ xa_alive()

static bool xa_alive ( void data)
static

◆ xa_buffer_size()

static size_t xa_buffer_size ( void data)
static

◆ xa_free()

static void xa_free ( void data)
static
Here is the call graph for this function:

◆ xa_init()

static void* xa_init ( const char *  device,
unsigned  rate,
unsigned  latency,
unsigned  block_frames,
unsigned *  new_rate 
)
static
Here is the call graph for this function:

◆ xa_set_nonblock_state()

static void xa_set_nonblock_state ( void data,
bool  state 
)
static

◆ xa_start()

static bool xa_start ( void data,
bool  is_shutdown 
)
static

◆ xa_stop()

static bool xa_stop ( void data)
static

◆ xa_use_float()

static bool xa_use_float ( void data)
static
Here is the call graph for this function:

◆ xa_write()

static ssize_t xa_write ( void data,
const void buf,
size_t  size 
)
static
Here is the call graph for this function:

◆ xa_write_avail()

static size_t xa_write_avail ( void data)
static

◆ xaudio2_free()

static void xaudio2_free ( xaudio2_t handle)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xaudio2_new()

static xaudio2_t* xaudio2_new ( unsigned  samplerate,
unsigned  channels,
size_t  size,
unsigned  device 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xaudio2_set_wavefmt()

static void xaudio2_set_wavefmt ( WAVEFORMATEX wfx,
unsigned  channels,
unsigned  samplerate 
)
static
Here is the caller graph for this function:

◆ xaudio2_write()

static size_t xaudio2_write ( xaudio2_t handle,
const uint8_t buffer,
size_t  bytes_ 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ audio_xa

audio_driver_t audio_xa
Initial value:
= {
"xaudio",
}
static size_t xa_write_avail(void *data)
Definition: xaudio.c:417
static void xa_set_nonblock_state(void *data, bool state)
Definition: xaudio.c:381
static size_t xa_buffer_size(void *data)
Definition: xaudio.c:423
static bool xa_stop(void *data)
Definition: xaudio.c:366
static void * xa_init(const char *device, unsigned rate, unsigned latency, unsigned block_frames, unsigned *new_rate)
Definition: xaudio.c:311
static bool xa_start(void *data, bool is_shutdown)
Definition: xaudio.c:388
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static bool xa_alive(void *data)
Definition: xaudio.c:373
static ssize_t xa_write(void *data, const void *buf, size_t size)
Definition: xaudio.c:345
static bool xa_use_float(void *data)
Definition: xaudio.c:395
static void xa_free(void *data)
Definition: xaudio.c:401

◆ voice_vtable

const struct IXAudio2VoiceCallbackVtbl voice_vtable
Initial value:
= {
}
static void WINAPI dummy_voidp(IXAudio2VoiceCallback *handle, void *data)
Definition: xaudio.c:113
static void WINAPI dummy_uint32(IXAudio2VoiceCallback *handle, UINT32 dummy)
Definition: xaudio.c:115
static void WINAPI voice_on_buffer_end(IXAudio2VoiceCallback *handle_, void *data)
Definition: xaudio.c:105
static void WINAPI dummy_nil(IXAudio2VoiceCallback *handle)
Definition: xaudio.c:114
static void WINAPI dummy_voidp_hresult(IXAudio2VoiceCallback *handle, void *data, HRESULT dummy)
Definition: xaudio.c:116