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"
48DISKAUDIO_WaitDevice(
_THIS)
54DISKAUDIO_PlayDevice(
_THIS)
56 const size_t written =
SDL_RWwrite(this->hidden->io,
65 fprintf(stderr,
"Wrote %d bytes of audio data\n", written);
70DISKAUDIO_GetDeviceBuf(
_THIS)
72 return (this->hidden->mixbuf);
76DISKAUDIO_CaptureFromDevice(
_THIS,
void *
buffer,
int buflen)
79 const int origbuflen = buflen;
100DISKAUDIO_FlushCapture(
_THIS)
107DISKAUDIO_CloseDevice(
_THIS)
109 if (this->hidden->io !=
NULL) {
118get_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",
175DISKAUDIO_DetectDevices(
void)
202 "disk",
"direct-to-disk audio", DISKAUDIO_Init, 1
void SDL_AddAudioDevice(const int iscapture, const char *name, void *handle)
void SDL_OpenedAudioDeviceDisconnected(SDL_AudioDevice *device)
#define SDL_OutOfMemory()
GLfloat GLfloat GLfloat GLfloat h
#define DEFAULT_OUTPUT_DEVNAME
#define DEFAULT_INPUT_DEVNAME
AudioBootStrap DISKAUDIO_bootstrap
EGLImageKHR EGLint EGLint * handle
void(* PlayDevice)(_THIS)
void(* WaitDevice)(_THIS)
void(* CloseDevice)(_THIS)
void(* FlushCapture)(_THIS)
void(* DetectDevices)(void)
int AllowsArbitraryDeviceNames
int(* CaptureFromDevice)(_THIS, void *buffer, int buflen)
int(* OpenDevice)(_THIS, void *handle, const char *devname, int iscapture)
Uint8 *(* GetDeviceBuf)(_THIS)