mirror of
https://github.com/mauiaaron/apple2.git
synced 2025-01-25 11:30:06 +00:00
Refactor : rename some structures for clarity
This commit is contained in:
parent
aedada03e9
commit
538b0aacd7
@ -68,9 +68,9 @@ typedef struct ALVoices {
|
||||
|
||||
static ALVoices *voices = NULL;
|
||||
|
||||
static audio_backend_s openal_audio_backend = { 0 };
|
||||
static AudioBackend_s openal_audio_backend = { 0 };
|
||||
|
||||
static long OpenALCreateSoundBuffer(const AudioParams_s *params, INOUT AudioBuffer_s **soundbuf_struct, const SoundSystem_s *sound_struct);
|
||||
static long OpenALCreateSoundBuffer(const AudioParams_s *params, INOUT AudioBuffer_s **soundbuf_struct, const AudioContext_s *sound_struct);
|
||||
static long OpenALDestroySoundBuffer(INOUT AudioBuffer_s **soundbuf_struct);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -151,7 +151,7 @@ static void PlaylistDequeue(ALVoice *voice, ALPlayBuf *node)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static long openal_systemInit(const char *sound_device, SoundSystem_s **sound_struct)
|
||||
static long openal_systemInit(const char *sound_device, AudioContext_s **sound_struct)
|
||||
{
|
||||
assert(*sound_struct == NULL);
|
||||
assert(voices == NULL);
|
||||
@ -175,7 +175,7 @@ static long openal_systemInit(const char *sound_device, SoundSystem_s **sound_st
|
||||
LOG("WARNING - AL_SOFT_buffer_samples extension not supported... Proceeding anyway...");
|
||||
}
|
||||
|
||||
if ((*sound_struct = malloc(sizeof(SoundSystem_s))) == NULL)
|
||||
if ((*sound_struct = malloc(sizeof(AudioContext_s))) == NULL)
|
||||
{
|
||||
ERRLOG("OOPS, Not enough memory");
|
||||
break;
|
||||
@ -197,7 +197,7 @@ static long openal_systemInit(const char *sound_device, SoundSystem_s **sound_st
|
||||
return -1;
|
||||
}
|
||||
|
||||
static long openal_systemShutdown(SoundSystem_s **sound_struct)
|
||||
static long openal_systemShutdown(AudioContext_s **sound_struct)
|
||||
{
|
||||
assert(*sound_struct != NULL);
|
||||
|
||||
@ -730,7 +730,7 @@ static long ALGetStatus(void *_this, unsigned long *status)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long OpenALCreateSoundBuffer(const AudioParams_s *params, INOUT AudioBuffer_s **soundbuf_struct, const SoundSystem_s *sound_struct)
|
||||
static long OpenALCreateSoundBuffer(const AudioParams_s *params, INOUT AudioBuffer_s **soundbuf_struct, const AudioContext_s *sound_struct)
|
||||
{
|
||||
LOG("OpenALCreateSoundBuffer ...");
|
||||
assert(*soundbuf_struct == NULL);
|
||||
|
@ -35,7 +35,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
static char **sound_devices = NULL;
|
||||
static long num_sound_devices = 0;
|
||||
static SoundSystem_s *g_lpDS = NULL;
|
||||
static AudioContext_s *g_lpDS = NULL;
|
||||
|
||||
//-------------------------------------
|
||||
|
||||
@ -49,7 +49,7 @@ static VOICE* g_pVoices[uMAX_VOICES] = {NULL};
|
||||
|
||||
bool audio_isAvailable = false;
|
||||
|
||||
audio_backend_s *audio_backend = NULL;
|
||||
AudioBackend_s *audio_backend = NULL;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@ -255,9 +255,9 @@ bool audio_init(void)
|
||||
{
|
||||
if (g_lpDS)
|
||||
{
|
||||
audio_backend->shutdown((SoundSystem_s**)&g_lpDS);
|
||||
audio_backend->shutdown((AudioContext_s**)&g_lpDS);
|
||||
}
|
||||
hr = (int)audio_backend->init(sound_devices[x], (SoundSystem_s**)&g_lpDS);
|
||||
hr = (int)audio_backend->init(sound_devices[x], (AudioContext_s**)&g_lpDS);
|
||||
if(hr == 0)
|
||||
{
|
||||
bCreatedOK = true;
|
||||
@ -302,7 +302,7 @@ void audio_shutdown(void)
|
||||
|
||||
assert(g_uNumVoices == 0);
|
||||
|
||||
audio_backend->shutdown((SoundSystem_s**)&g_lpDS);
|
||||
audio_backend->shutdown((AudioContext_s**)&g_lpDS);
|
||||
audio_isAvailable = false;
|
||||
}
|
||||
|
||||
|
@ -61,11 +61,11 @@ typedef struct AudioParams_s {
|
||||
unsigned long dwBufferBytes;
|
||||
} AudioParams_s;
|
||||
|
||||
typedef struct SoundSystem_s {
|
||||
typedef struct AudioContext_s {
|
||||
void *implementation_specific;
|
||||
long (*CreateSoundBuffer)(const AudioParams_s *params, INOUT AudioBuffer_s **buffer, const struct SoundSystem_s *sound_system);
|
||||
long (*CreateSoundBuffer)(const AudioParams_s *params, INOUT AudioBuffer_s **buffer, const struct AudioContext_s *sound_system);
|
||||
long (*DestroySoundBuffer)(INOUT AudioBuffer_s **buffer);
|
||||
} SoundSystem_s;
|
||||
} AudioContext_s;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -106,21 +106,21 @@ void audio_shutdown(void);
|
||||
|
||||
extern bool audio_isAvailable;
|
||||
|
||||
typedef struct audio_backend_s {
|
||||
typedef struct AudioBackend_s {
|
||||
|
||||
// basic backend functionality controlled by soundcore
|
||||
PRIVATE long (*init)(const char *sound_device, INOUT SoundSystem_s **sound_struct);
|
||||
PRIVATE long (*shutdown)(INOUT SoundSystem_s **sound_struct);
|
||||
PRIVATE long (*init)(const char *sound_device, INOUT AudioContext_s **audio_context);
|
||||
PRIVATE long (*shutdown)(INOUT AudioContext_s **audio_context);
|
||||
PRIVATE long (*enumerateDevices)(INOUT char ***sound_devices, const int maxcount);
|
||||
|
||||
PUBLIC long (*pause)(void);
|
||||
PUBLIC long (*resume)(void);
|
||||
|
||||
} audio_backend_s;
|
||||
} AudioBackend_s;
|
||||
|
||||
/*
|
||||
* The registered audio backend (renderer).
|
||||
*/
|
||||
extern audio_backend_s *audio_backend;
|
||||
extern AudioBackend_s *audio_backend;
|
||||
|
||||
#endif /* whole file */
|
||||
|
Loading…
x
Reference in New Issue
Block a user