SDL  2.0
SDL_sysaudio.h File Reference
#include "../SDL_internal.h"
#include "SDL_mutex.h"
#include "SDL_thread.h"
#include "../SDL_dataqueue.h"
#include "./SDL_audio_c.h"
+ Include dependency graph for SDL_sysaudio.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SDL_AudioDriverImpl
struct  SDL_AudioDeviceItem
struct  SDL_AudioDriver
struct  SDL_AudioDevice
struct  AudioBootStrap

Macros

#define DEFAULT_OUTPUT_DEVNAME   "System audio output device"
#define DEFAULT_INPUT_DEVNAME   "System audio capture device"
#define _THIS   SDL_AudioDevice *_this
#define SDL_AUDIOBUFFERQUEUE_PACKETLEN   (8 * 1024)

Functions

void SDL_AddAudioDevice (const int iscapture, const char *name, void *handle)
void SDL_RemoveAudioDevice (const int iscapture, void *handle)
void SDL_OpenedAudioDeviceDisconnected (SDL_AudioDevice *device)

Variables

AudioBootStrap PULSEAUDIO_bootstrap
AudioBootStrap ALSA_bootstrap
AudioBootStrap JACK_bootstrap
AudioBootStrap SNDIO_bootstrap
AudioBootStrap NETBSDAUDIO_bootstrap
AudioBootStrap DSP_bootstrap
AudioBootStrap QSAAUDIO_bootstrap
AudioBootStrap SUNAUDIO_bootstrap
AudioBootStrap ARTS_bootstrap
AudioBootStrap ESD_bootstrap
AudioBootStrap NACLAUDIO_bootstrap
AudioBootStrap NAS_bootstrap
AudioBootStrap WASAPI_bootstrap
AudioBootStrap DSOUND_bootstrap
AudioBootStrap WINMM_bootstrap
AudioBootStrap PAUDIO_bootstrap
AudioBootStrap HAIKUAUDIO_bootstrap
AudioBootStrap COREAUDIO_bootstrap
AudioBootStrap DISKAUDIO_bootstrap
AudioBootStrap DUMMYAUDIO_bootstrap
AudioBootStrap FUSIONSOUND_bootstrap
AudioBootStrap ANDROIDAUDIO_bootstrap
AudioBootStrap PSPAUDIO_bootstrap
AudioBootStrap EMSCRIPTENAUDIO_bootstrap

Macro Definition Documentation

#define _THIS   SDL_AudioDevice *_this

Definition at line 37 of file SDL_sysaudio.h.

#define DEFAULT_INPUT_DEVNAME   "System audio capture device"

Definition at line 33 of file SDL_sysaudio.h.

Referenced by open_audio_device(), and SDL_AudioDetectDevices_Default().

#define DEFAULT_OUTPUT_DEVNAME   "System audio output device"

Definition at line 32 of file SDL_sysaudio.h.

Referenced by open_audio_device(), and SDL_AudioDetectDevices_Default().

#define SDL_AUDIOBUFFERQUEUE_PACKETLEN   (8 * 1024)

Definition at line 63 of file SDL_sysaudio.h.

Referenced by open_audio_device(), and SDL_ClearQueuedAudio().

Function Documentation

void SDL_AddAudioDevice ( const int  iscapture,
const char *  name,
void handle 
)

Definition at line 473 of file SDL_audio.c.

References add_capture_device(), add_output_device(), SDL_AUDIODEVICEADDED, SDL_ENABLE, SDL_GetEventState, SDL_PushEvent, and SDL_zero.

Referenced by SDL_AudioDetectDevices_Default().

{
const int device_index = iscapture ? add_capture_device(name, handle) : add_output_device(name, handle);
if (device_index != -1) {
/* Post the event, if desired */
SDL_zero(event);
event.adevice.type = SDL_AUDIODEVICEADDED;
event.adevice.which = device_index;
event.adevice.iscapture = iscapture;
SDL_PushEvent(&event);
}
}
}
void SDL_OpenedAudioDeviceDisconnected ( SDL_AudioDevice device)

Definition at line 490 of file SDL_audio.c.

References SDL_AudioDevice::enabled, get_audio_device(), SDL_AudioDevice::id, SDL_AudioDriver::impl, SDL_AudioDevice::iscapture, SDL_AudioDriverImpl::LockDevice, SDL_assert, SDL_AtomicGet, SDL_AtomicSet, SDL_AUDIODEVICEREMOVED, SDL_ENABLE, SDL_GetEventState, SDL_PushEvent, SDL_zero, SDL_AudioDevice::shutdown, and SDL_AudioDriverImpl::UnlockDevice.

Referenced by SDL_CaptureAudio(), and SDL_RemoveAudioDevice().

{
SDL_assert(get_audio_device(device->id) == device);
if (!SDL_AtomicGet(&device->enabled)) {
return; /* don't report disconnects more than once. */
}
if (SDL_AtomicGet(&device->shutdown)) {
return; /* don't report disconnect if we're trying to close device. */
}
/* Ends the audio callback and mark the device as STOPPED, but the
app still needs to close the device to free resources. */
SDL_AtomicSet(&device->enabled, 0);
/* Post the event, if desired */
SDL_zero(event);
event.adevice.type = SDL_AUDIODEVICEREMOVED;
event.adevice.which = device->id;
event.adevice.iscapture = device->iscapture ? 1 : 0;
SDL_PushEvent(&event);
}
}

Variable Documentation

AudioBootStrap ALSA_bootstrap
AudioBootStrap ANDROIDAUDIO_bootstrap
AudioBootStrap ARTS_bootstrap
AudioBootStrap COREAUDIO_bootstrap
AudioBootStrap DISKAUDIO_bootstrap
AudioBootStrap DSOUND_bootstrap
AudioBootStrap DSP_bootstrap
AudioBootStrap DUMMYAUDIO_bootstrap

Definition at line 61 of file SDL_dummyaudio.c.

AudioBootStrap EMSCRIPTENAUDIO_bootstrap
AudioBootStrap ESD_bootstrap
AudioBootStrap FUSIONSOUND_bootstrap
AudioBootStrap HAIKUAUDIO_bootstrap
AudioBootStrap JACK_bootstrap
AudioBootStrap NACLAUDIO_bootstrap
AudioBootStrap NAS_bootstrap
AudioBootStrap NETBSDAUDIO_bootstrap
AudioBootStrap PAUDIO_bootstrap
AudioBootStrap PSPAUDIO_bootstrap
AudioBootStrap PULSEAUDIO_bootstrap
AudioBootStrap QSAAUDIO_bootstrap
AudioBootStrap SNDIO_bootstrap
AudioBootStrap SUNAUDIO_bootstrap
AudioBootStrap WASAPI_bootstrap
AudioBootStrap WINMM_bootstrap