Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Changed some 1.3 audio symbol names.

  • Loading branch information
icculus committed Oct 3, 2006
1 parent 79f2a32 commit 5732f2e2662f0a73c6f7c067f60a30377631335a
@@ -251,8 +251,8 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
* string for any length of time, you should make your own copy of it, as it
* will be invalid next time any of several other SDL functions is called.
*/
extern DECLSPEC const char *SDLCALL SDL_GetAudioDevice(int index,
int iscapture);
extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
int iscapture);


/*
@@ -230,7 +230,7 @@ SDL_RunAudio(void *devicep)
continue;
}
} else {
stream = current_audio.impl.GetAudioBuf(device);
stream = current_audio.impl.GetDeviceBuf(device);
if (stream == NULL) {
stream = device->fake_stream;
}
@@ -250,7 +250,7 @@ SDL_RunAudio(void *devicep)
/* Convert the audio if necessary */
if (device->convert.needed) {
SDL_ConvertAudio(&device->convert);
stream = current_audio.impl.GetAudioBuf(device);
stream = current_audio.impl.GetDeviceBuf(device);
if (stream == NULL) {
stream = device->fake_stream;
}
@@ -259,14 +259,14 @@ SDL_RunAudio(void *devicep)

/* Ready current buffer for play and change current buffer */
if (stream != device->fake_stream) {
current_audio.impl.PlayAudio(device);
current_audio.impl.PlayDevice(device);
}

/* Wait for an audio buffer to become available */
if (stream == device->fake_stream) {
SDL_Delay((device->spec.samples * 1000) / device->spec.freq);
} else {
current_audio.impl.WaitAudio(device);
current_audio.impl.WaitDevice(device);
}
}

@@ -275,11 +275,11 @@ SDL_RunAudio(void *devicep)
current_audio.impl.WaitDone(device);
}
#if SDL_AUDIO_DRIVER_AHI
D(bug("WaitAudio...Done\n"));
D(bug("WaitDevice...Done\n"));

audio->CloseAudio(audio);
audio->CloseDevice(audio);

D(bug("CloseAudio..Done, subtask exiting...\n"));
D(bug("CloseDevice..Done, subtask exiting...\n"));
audio_configured = 0;
#endif
#ifdef __OS2__
@@ -291,7 +291,7 @@ SDL_RunAudio(void *devicep)
}

static void
SDL_LockAudio_Default(SDL_AudioDevice * audio)
SDL_LockDevice_Default(SDL_AudioDevice * audio)
{
if (audio->thread && (SDL_ThreadID() == audio->threadid)) {
return;
@@ -300,7 +300,7 @@ SDL_LockAudio_Default(SDL_AudioDevice * audio)
}

static void
SDL_UnlockAudio_Default(SDL_AudioDevice * audio)
SDL_UnlockDevice_Default(SDL_AudioDevice * audio)
{
if (audio->thread && (SDL_ThreadID() == audio->threadid)) {
return;
@@ -438,9 +438,9 @@ SDL_AudioInit(const char *driver_name)
}
}

if (!current_audio.impl.LockAudio && !current_audio.impl.UnlockAudio) {
current_audio.impl.LockAudio = SDL_LockAudio_Default;
current_audio.impl.UnlockAudio = SDL_UnlockAudio_Default;
if (!current_audio.impl.LockDevice && !current_audio.impl.UnlockDevice) {
current_audio.impl.LockDevice = SDL_LockDevice_Default;
current_audio.impl.UnlockDevice = SDL_UnlockDevice_Default;
}

return (0);
@@ -467,19 +467,19 @@ SDL_GetNumAudioDevices(int iscapture)


const char *
SDL_GetAudioDevice(int index, int iscapture)
SDL_GetAudioDeviceName(int index, int iscapture)
{
if (!SDL_WasInit(SDL_INIT_AUDIO)) {
SDL_SetError("Audio subsystem is not initialized");
return NULL;
}

if ((index < 0) && (!current_audio.impl.GetAudioDevice)) {
if ((index < 0) && (!current_audio.impl.GetDeviceName)) {
SDL_SetError("No such device");
return NULL;
}

return current_audio.impl.GetAudioDevice(index, iscapture);
return current_audio.impl.GetDeviceName(index, iscapture);
}


@@ -501,7 +501,7 @@ close_audio_device(SDL_AudioDevice *device)
}
#if !SDL_AUDIO_DRIVER_AHI /* !!! FIXME: get rid of this #if. */
if (device->opened) {
current_audio.impl.CloseAudio(device);
current_audio.impl.CloseDevice(device);
device->opened = 0;
}
#endif
@@ -632,7 +632,7 @@ open_audio_device(const char *devname, int iscapture,
/* !!! FIXME: Get this #if out of the core. */
/* AmigaOS opens audio inside the main loop */
#if !SDL_AUDIO_DRIVER_AHI
if (!current_audio.impl.OpenAudio(device, devname, iscapture)) {
if (!current_audio.impl.OpenDevice(device, devname, iscapture)) {
close_audio_device(device);
return 0;
}
@@ -824,11 +824,11 @@ SDL_PauseAudio(int pause_on)
void
SDL_LockAudioDevice(SDL_AudioDeviceID devid)
{
if (current_audio.impl.LockAudio != NULL) {
if (current_audio.impl.LockDevice != NULL) {
SDL_AudioDevice *device = get_audio_device(devid);
/* Obtain a lock on the mixing buffers */
if (device) {
current_audio.impl.LockAudio(device);
current_audio.impl.LockDevice(device);
}
}
}
@@ -842,11 +842,11 @@ SDL_LockAudio(void)
void
SDL_UnlockAudioDevice(SDL_AudioDeviceID devid)
{
if (current_audio.impl.UnlockAudio != NULL) {
if (current_audio.impl.UnlockDevice != NULL) {
SDL_AudioDevice *device = get_audio_device(devid);
/* Obtain a lock on the mixing buffers */
if (device) {
current_audio.impl.UnlockAudio(device);
current_audio.impl.UnlockDevice(device);
}
}
}
@@ -35,16 +35,16 @@ typedef struct SDL_AudioDevice SDL_AudioDevice;
typedef struct SDL_AudioDriverImpl
{
int (*DetectDevices)(int iscapture);
const char *(*GetAudioDevice)(int index, int iscapture);
int (*OpenAudio) (_THIS, const char *devname, int iscapture);
const char *(*GetDeviceName)(int index, int iscapture);
int (*OpenDevice) (_THIS, const char *devname, int iscapture);
void (*ThreadInit) (_THIS); /* Called by audio thread at start */
void (*WaitAudio) (_THIS);
void (*PlayAudio) (_THIS);
Uint8 *(*GetAudioBuf) (_THIS);
void (*WaitDevice) (_THIS);
void (*PlayDevice) (_THIS);
Uint8 *(*GetDeviceBuf) (_THIS);
void (*WaitDone) (_THIS);
void (*CloseAudio) (_THIS);
void (*LockAudio) (_THIS);
void (*UnlockAudio) (_THIS);
void (*CloseDevice) (_THIS);
void (*LockDevice) (_THIS);
void (*UnlockDevice) (_THIS);
void (*Deinitialize) (void);
} SDL_AudioDriverImpl;

@@ -47,11 +47,11 @@
#define DISKDEFAULT_WRITEDELAY 150

/* Audio driver functions */
static int DISKAUD_OpenAudio(_THIS, const char *devname, int iscapture);
static void DISKAUD_WaitAudio(_THIS);
static void DISKAUD_PlayAudio(_THIS);
static Uint8 *DISKAUD_GetAudioBuf(_THIS);
static void DISKAUD_CloseAudio(_THIS);
static int DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture);
static void DISKAUD_WaitDevice(_THIS);
static void DISKAUD_PlayDevice(_THIS);
static Uint8 *DISKAUD_GetDeviceBuf(_THIS);
static void DISKAUD_CloseDevice(_THIS);

static const char *
DISKAUD_GetOutputFilename(void)
@@ -80,11 +80,11 @@ DISKAUD_Init(SDL_AudioDriverImpl *impl)
SDL_memset(impl, '\0', sizeof (SDL_AudioDriverImpl));

/* Set the function pointers */
impl->OpenAudio = DISKAUD_OpenAudio;
impl->WaitAudio = DISKAUD_WaitAudio;
impl->PlayAudio = DISKAUD_PlayAudio;
impl->GetAudioBuf = DISKAUD_GetAudioBuf;
impl->CloseAudio = DISKAUD_CloseAudio;
impl->OpenDevice = DISKAUD_OpenDevice;
impl->WaitDevice = DISKAUD_WaitDevice;
impl->PlayDevice = DISKAUD_PlayDevice;
impl->GetDeviceBuf = DISKAUD_GetDeviceBuf;
impl->CloseDevice = DISKAUD_CloseDevice;

return 1;
}
@@ -96,13 +96,13 @@ AudioBootStrap DISKAUD_bootstrap = {

/* This function waits until it is possible to write a full sound buffer */
static void
DISKAUD_WaitAudio(_THIS)
DISKAUD_WaitDevice(_THIS)
{
SDL_Delay(this->hidden->write_delay);
}

static void
DISKAUD_PlayAudio(_THIS)
DISKAUD_PlayDevice(_THIS)
{
int written;

@@ -120,13 +120,13 @@ DISKAUD_PlayAudio(_THIS)
}

static Uint8 *
DISKAUD_GetAudioBuf(_THIS)
DISKAUD_GetDeviceBuf(_THIS)
{
return (this->hidden->mixbuf);
}

static void
DISKAUD_CloseAudio(_THIS)
DISKAUD_CloseDevice(_THIS)
{
if (this->hidden->mixbuf != NULL) {
SDL_FreeAudioMem(this->hidden->mixbuf);
@@ -141,7 +141,7 @@ DISKAUD_CloseAudio(_THIS)
}

static int
DISKAUD_OpenAudio(_THIS, const char *devname, int iscapture)
DISKAUD_OpenDevice(_THIS, const char *devname, int iscapture)
{
const char *envr = SDL_getenv(DISKENVR_WRITEDELAY);
const char *fname = DISKAUD_GetOutputFilename();
@@ -163,14 +163,14 @@ DISKAUD_OpenAudio(_THIS, const char *devname, int iscapture)
/* Open the audio device */
this->hidden->output = SDL_RWFromFile(fname, "wb");
if (this->hidden->output == NULL) {
DISKAUD_CloseAudio(this);
DISKAUD_CloseDevice(this);
return 0;
}

/* Allocate mixing buffer */
this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
if (this->hidden->mixbuf == NULL) {
DISKAUD_CloseAudio(this);
DISKAUD_CloseDevice(this);
return 0;
}
SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
@@ -37,11 +37,11 @@
#define DUMMYAUD_DRIVER_NAME "dummy"

/* Audio driver functions */
static int DUMMYAUD_OpenAudio(_THIS, const char *devname, int iscapture);
static void DUMMYAUD_WaitAudio(_THIS);
static void DUMMYAUD_PlayAudio(_THIS);
static Uint8 *DUMMYAUD_GetAudioBuf(_THIS);
static void DUMMYAUD_CloseAudio(_THIS);
static int DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture);
static void DUMMYAUD_WaitDevice(_THIS);
static void DUMMYAUD_PlayDevice(_THIS);
static Uint8 *DUMMYAUD_GetDeviceBuf(_THIS);
static void DUMMYAUD_CloseDevice(_THIS);

/* Audio driver bootstrap functions */
static int
@@ -60,11 +60,11 @@ static int
DUMMYAUD_Init(SDL_AudioDriverImpl *impl)
{
/* Set the function pointers */
impl->OpenAudio = DUMMYAUD_OpenAudio;
impl->WaitAudio = DUMMYAUD_WaitAudio;
impl->PlayAudio = DUMMYAUD_PlayAudio;
impl->GetAudioBuf = DUMMYAUD_GetAudioBuf;
impl->CloseAudio = DUMMYAUD_CloseAudio;
impl->OpenDevice = DUMMYAUD_OpenDevice;
impl->WaitDevice = DUMMYAUD_WaitDevice;
impl->PlayDevice = DUMMYAUD_PlayDevice;
impl->GetDeviceBuf = DUMMYAUD_GetDeviceBuf;
impl->CloseDevice = DUMMYAUD_CloseDevice;

return 1;
}
@@ -76,7 +76,7 @@ AudioBootStrap DUMMYAUD_bootstrap = {

/* This function waits until it is possible to write a full sound buffer */
static void
DUMMYAUD_WaitAudio(_THIS)
DUMMYAUD_WaitDevice(_THIS)
{
/* Don't block on first calls to simulate initial fragment filling. */
if (this->hidden->initial_calls)
@@ -86,19 +86,19 @@ DUMMYAUD_WaitAudio(_THIS)
}

static void
DUMMYAUD_PlayAudio(_THIS)
DUMMYAUD_PlayDevice(_THIS)
{
/* no-op...this is a null driver. */
}

static Uint8 *
DUMMYAUD_GetAudioBuf(_THIS)
DUMMYAUD_GetDeviceBuf(_THIS)
{
return (this->hidden->mixbuf);
}

static void
DUMMYAUD_CloseAudio(_THIS)
DUMMYAUD_CloseDevice(_THIS)
{
if (this->hidden->mixbuf != NULL) {
SDL_FreeAudioMem(this->hidden->mixbuf);
@@ -109,7 +109,7 @@ DUMMYAUD_CloseAudio(_THIS)
}

static int
DUMMYAUD_OpenAudio(_THIS, const char *devname, int iscapture)
DUMMYAUD_OpenDevice(_THIS, const char *devname, int iscapture)
{
float bytes_per_sec = 0.0f;

@@ -126,7 +126,7 @@ DUMMYAUD_OpenAudio(_THIS, const char *devname, int iscapture)
this->hidden->mixlen = this->spec.size;
this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
if (this->hidden->mixbuf == NULL) {
DUMMYAUD_CloseAudio(this);
DUMMYAUD_CloseDevice(this);
return 0;
}
SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);

0 comments on commit 5732f2e

Please sign in to comment.