Go to the documentation of this file.
21 #include "../../SDL_internal.h"
23 #if SDL_AUDIO_DRIVER_DISK
34 #include "../SDL_audio_c.h"
40 #define DISKENVR_OUTFILE "SDL_DISKAUDIOFILE"
41 #define DISKDEFAULT_OUTFILE "sdlaudio.raw"
42 #define DISKENVR_INFILE "SDL_DISKAUDIOFILEIN"
43 #define DISKDEFAULT_INFILE "sdlaudio-in.raw"
44 #define DISKENVR_IODELAY "SDL_DISKAUDIODELAY"
48 DISKAUDIO_WaitDevice(
_THIS)
54 DISKAUDIO_PlayDevice(
_THIS)
56 const size_t written =
SDL_RWwrite(this->hidden->io,
65 fprintf(stderr,
"Wrote %d bytes of audio data\n", written);
70 DISKAUDIO_GetDeviceBuf(
_THIS)
72 return (this->hidden->mixbuf);
76 DISKAUDIO_CaptureFromDevice(
_THIS,
void *
buffer,
int buflen)
79 const int origbuflen = buflen;
100 DISKAUDIO_FlushCapture(
_THIS)
107 DISKAUDIO_CloseDevice(
_THIS)
109 if (this->hidden->io !=
NULL) {
118 get_filename(
const int iscapture,
const char *devname)
120 if (devname ==
NULL) {
122 if (devname ==
NULL) {
123 devname =
iscapture ? DISKDEFAULT_INFILE : DISKDEFAULT_OUTFILE;
134 const char *envr =
SDL_getenv(DISKENVR_IODELAY);
138 if (this->hidden ==
NULL) {
144 this->hidden->io_delay =
SDL_atoi(envr);
151 if (this->hidden->io ==
NULL) {
158 if (this->hidden->mixbuf ==
NULL) {
161 SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
165 "You are using the SDL disk i/o audio driver!\n");
167 " %s file [%s].\n",
iscapture ?
"Reading from" :
"Writing to",
175 DISKAUDIO_DetectDevices(
void)
202 "disk",
"direct-to-disk audio", DISKAUDIO_Init, 1
#define DEFAULT_OUTPUT_DEVNAME
#define SDL_RWwrite(ctx, ptr, size, n)
void(* FlushCapture)(_THIS)
EGLImageKHR EGLint EGLint * handle
#define DEFAULT_INPUT_DEVNAME
int(* OpenDevice)(_THIS, void *handle, const char *devname, int iscapture)
AudioBootStrap DISKAUDIO_bootstrap
GLuint GLfloat GLfloat GLfloat x1
void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device)
GLfloat GLfloat GLfloat GLfloat h
#define SDL_RWread(ctx, ptr, size, n)
void(* WaitDevice)(_THIS)
void(* DetectDevices)(void)
void(* PlayDevice)(_THIS)
int AllowsArbitraryDeviceNames
#define SDL_OutOfMemory()
int(* CaptureFromDevice)(_THIS, void *buffer, int buflen)
Uint8 *(* GetDeviceBuf)(_THIS)
void(* CloseDevice)(_THIS)
void SDL_AddAudioDevice(const int iscapture, const char *name, void *handle)