Remove unnecessary parameters, and rename methods
This commit is contained in:
parent
ffff104554
commit
94e3fca702
@ -1213,7 +1213,7 @@ ALCAPI ALCcontext* ALCAPIENTRY alcCreateContext(ALCdevice *device, const ALCint
|
|||||||
bs2b_set_level(device->Bs2b, device->Bs2bLevel);
|
bs2b_set_level(device->Bs2b, device->Bs2bLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ALCdevice_StartContext(device, ALContext) == ALC_FALSE)
|
if(ALCdevice_ResetPlayback(device) == ALC_FALSE)
|
||||||
{
|
{
|
||||||
alcDestroyContext(ALContext);
|
alcDestroyContext(ALContext);
|
||||||
ALContext = NULL;
|
ALContext = NULL;
|
||||||
@ -1248,7 +1248,7 @@ ALCAPI ALCvoid ALCAPIENTRY alcDestroyContext(ALCcontext *context)
|
|||||||
|
|
||||||
if (IsContext(context))
|
if (IsContext(context))
|
||||||
{
|
{
|
||||||
ALCdevice_StopContext(context->Device, context);
|
ALCdevice_StopPlayback(context->Device);
|
||||||
|
|
||||||
// Lock context
|
// Lock context
|
||||||
SuspendContext(context);
|
SuspendContext(context);
|
||||||
|
10
Alc/alsa.c
10
Alc/alsa.c
@ -408,7 +408,7 @@ static void alsa_close_playback(ALCdevice *device)
|
|||||||
device->ExtraData = NULL;
|
device->ExtraData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ALCboolean alsa_start_context(ALCdevice *device, ALCcontext *context)
|
static ALCboolean alsa_reset_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
alsa_data *data = (alsa_data*)device->ExtraData;
|
alsa_data *data = (alsa_data*)device->ExtraData;
|
||||||
snd_pcm_uframes_t bufferSizeInFrames;
|
snd_pcm_uframes_t bufferSizeInFrames;
|
||||||
@ -420,7 +420,6 @@ static ALCboolean alsa_start_context(ALCdevice *device, ALCcontext *context)
|
|||||||
int allowmmap;
|
int allowmmap;
|
||||||
char *err;
|
char *err;
|
||||||
int i;
|
int i;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
|
|
||||||
switch(aluBytesFromFormat(device->Format))
|
switch(aluBytesFromFormat(device->Format))
|
||||||
@ -544,10 +543,9 @@ static ALCboolean alsa_start_context(ALCdevice *device, ALCcontext *context)
|
|||||||
return ALC_TRUE;
|
return ALC_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void alsa_stop_context(ALCdevice *device, ALCcontext *context)
|
static void alsa_stop_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
alsa_data *data = (alsa_data*)device->ExtraData;
|
alsa_data *data = (alsa_data*)device->ExtraData;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
if(!data->thread)
|
if(!data->thread)
|
||||||
return;
|
return;
|
||||||
@ -763,8 +761,8 @@ static ALCuint alsa_available_samples(ALCdevice *pDevice)
|
|||||||
BackendFuncs alsa_funcs = {
|
BackendFuncs alsa_funcs = {
|
||||||
alsa_open_playback,
|
alsa_open_playback,
|
||||||
alsa_close_playback,
|
alsa_close_playback,
|
||||||
alsa_start_context,
|
alsa_reset_playback,
|
||||||
alsa_stop_context,
|
alsa_stop_playback,
|
||||||
alsa_open_capture,
|
alsa_open_capture,
|
||||||
alsa_close_capture,
|
alsa_close_capture,
|
||||||
alsa_start_capture,
|
alsa_start_capture,
|
||||||
|
10
Alc/dsound.c
10
Alc/dsound.c
@ -214,7 +214,7 @@ static void DSoundClosePlayback(ALCdevice *device)
|
|||||||
device->ExtraData = NULL;
|
device->ExtraData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ALCboolean DSoundStartContext(ALCdevice *device, ALCcontext *context)
|
static ALCboolean DSoundResetPlayback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
DSoundData *pData = (DSoundData*)device->ExtraData;
|
DSoundData *pData = (DSoundData*)device->ExtraData;
|
||||||
DSBUFFERDESC DSBDescription;
|
DSBUFFERDESC DSBDescription;
|
||||||
@ -223,7 +223,6 @@ static ALCboolean DSoundStartContext(ALCdevice *device, ALCcontext *context)
|
|||||||
ALenum format = 0;
|
ALenum format = 0;
|
||||||
DWORD speakers;
|
DWORD speakers;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
memset(&OutputType, 0, sizeof(OutputType));
|
memset(&OutputType, 0, sizeof(OutputType));
|
||||||
|
|
||||||
@ -381,10 +380,9 @@ static ALCboolean DSoundStartContext(ALCdevice *device, ALCcontext *context)
|
|||||||
return ALC_TRUE;
|
return ALC_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DSoundStopContext(ALCdevice *device, ALCcontext *context)
|
static void DSoundStopPlayback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
DSoundData *pData = device->ExtraData;
|
DSoundData *pData = device->ExtraData;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
if(!pData->thread)
|
if(!pData->thread)
|
||||||
return;
|
return;
|
||||||
@ -440,8 +438,8 @@ static ALCuint DSoundAvailableSamples(ALCdevice *pDevice)
|
|||||||
BackendFuncs DSoundFuncs = {
|
BackendFuncs DSoundFuncs = {
|
||||||
DSoundOpenPlayback,
|
DSoundOpenPlayback,
|
||||||
DSoundClosePlayback,
|
DSoundClosePlayback,
|
||||||
DSoundStartContext,
|
DSoundResetPlayback,
|
||||||
DSoundStopContext,
|
DSoundStopPlayback,
|
||||||
DSoundOpenCapture,
|
DSoundOpenCapture,
|
||||||
DSoundCloseCapture,
|
DSoundCloseCapture,
|
||||||
DSoundStartCapture,
|
DSoundStartCapture,
|
||||||
|
10
Alc/oss.c
10
Alc/oss.c
@ -183,7 +183,7 @@ static void oss_close_playback(ALCdevice *device)
|
|||||||
device->ExtraData = NULL;
|
device->ExtraData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ALCboolean oss_start_context(ALCdevice *device, ALCcontext *context)
|
static ALCboolean oss_reset_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
oss_data *data = (oss_data*)device->ExtraData;
|
oss_data *data = (oss_data*)device->ExtraData;
|
||||||
int numFragmentsLogSize;
|
int numFragmentsLogSize;
|
||||||
@ -196,7 +196,6 @@ static ALCboolean oss_start_context(ALCdevice *device, ALCcontext *context)
|
|||||||
int ossSpeed;
|
int ossSpeed;
|
||||||
char *err;
|
char *err;
|
||||||
int i;
|
int i;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
switch(aluBytesFromFormat(device->Format))
|
switch(aluBytesFromFormat(device->Format))
|
||||||
{
|
{
|
||||||
@ -278,10 +277,9 @@ static ALCboolean oss_start_context(ALCdevice *device, ALCcontext *context)
|
|||||||
return ALC_TRUE;
|
return ALC_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void oss_stop_context(ALCdevice *device, ALCcontext *context)
|
static void oss_stop_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
oss_data *data = (oss_data*)device->ExtraData;
|
oss_data *data = (oss_data*)device->ExtraData;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
if(!data->thread)
|
if(!data->thread)
|
||||||
return;
|
return;
|
||||||
@ -455,8 +453,8 @@ static ALCuint oss_available_samples(ALCdevice *pDevice)
|
|||||||
BackendFuncs oss_funcs = {
|
BackendFuncs oss_funcs = {
|
||||||
oss_open_playback,
|
oss_open_playback,
|
||||||
oss_close_playback,
|
oss_close_playback,
|
||||||
oss_start_context,
|
oss_reset_playback,
|
||||||
oss_stop_context,
|
oss_stop_playback,
|
||||||
oss_open_capture,
|
oss_open_capture,
|
||||||
oss_close_capture,
|
oss_close_capture,
|
||||||
oss_start_capture,
|
oss_start_capture,
|
||||||
|
@ -160,7 +160,7 @@ static void pa_close_playback(ALCdevice *device)
|
|||||||
device->ExtraData = NULL;
|
device->ExtraData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ALCboolean pa_start_context(ALCdevice *device, ALCcontext *context)
|
static ALCboolean pa_reset_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
pa_data *data = (pa_data*)device->ExtraData;
|
pa_data *data = (pa_data*)device->ExtraData;
|
||||||
const PaStreamInfo *streamInfo;
|
const PaStreamInfo *streamInfo;
|
||||||
@ -169,13 +169,11 @@ static ALCboolean pa_start_context(ALCdevice *device, ALCcontext *context)
|
|||||||
device->Frequency = streamInfo->sampleRate;
|
device->Frequency = streamInfo->sampleRate;
|
||||||
|
|
||||||
return ALC_TRUE;
|
return ALC_TRUE;
|
||||||
(void)context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pa_stop_context(ALCdevice *device, ALCcontext *context)
|
static void pa_stop_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
(void)device;
|
(void)device;
|
||||||
(void)context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -191,8 +189,8 @@ static ALCboolean pa_open_capture(ALCdevice *device, const ALCchar *deviceName)
|
|||||||
static const BackendFuncs pa_funcs = {
|
static const BackendFuncs pa_funcs = {
|
||||||
pa_open_playback,
|
pa_open_playback,
|
||||||
pa_close_playback,
|
pa_close_playback,
|
||||||
pa_start_context,
|
pa_reset_playback,
|
||||||
pa_stop_context,
|
pa_stop_playback,
|
||||||
pa_open_capture,
|
pa_open_capture,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -336,10 +336,9 @@ static void pulse_close_playback(ALCdevice *device) //{{{
|
|||||||
pulse_close(device);
|
pulse_close(device);
|
||||||
} //}}}
|
} //}}}
|
||||||
|
|
||||||
static ALCboolean pulse_start_context(ALCdevice *device, ALCcontext *context) //{{{
|
static ALCboolean pulse_reset_playback(ALCdevice *device) //{{{
|
||||||
{
|
{
|
||||||
pulse_data *data = device->ExtraData;
|
pulse_data *data = device->ExtraData;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
ppa_threaded_mainloop_lock(data->loop);
|
ppa_threaded_mainloop_lock(data->loop);
|
||||||
|
|
||||||
@ -430,10 +429,9 @@ static ALCboolean pulse_start_context(ALCdevice *device, ALCcontext *context) //
|
|||||||
return ALC_TRUE;
|
return ALC_TRUE;
|
||||||
} //}}}
|
} //}}}
|
||||||
|
|
||||||
static void pulse_stop_context(ALCdevice *device, ALCcontext *context) //{{{
|
static void pulse_stop_playback(ALCdevice *device) //{{{
|
||||||
{
|
{
|
||||||
pulse_data *data = device->ExtraData;
|
pulse_data *data = device->ExtraData;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
if(!data->stream)
|
if(!data->stream)
|
||||||
return;
|
return;
|
||||||
@ -614,8 +612,8 @@ static ALCuint pulse_available_samples(ALCdevice *device) //{{{
|
|||||||
BackendFuncs pulse_funcs = { //{{{
|
BackendFuncs pulse_funcs = { //{{{
|
||||||
pulse_open_playback,
|
pulse_open_playback,
|
||||||
pulse_close_playback,
|
pulse_close_playback,
|
||||||
pulse_start_context,
|
pulse_reset_playback,
|
||||||
pulse_stop_context,
|
pulse_stop_playback,
|
||||||
pulse_open_capture,
|
pulse_open_capture,
|
||||||
pulse_close_capture,
|
pulse_close_capture,
|
||||||
pulse_start_capture,
|
pulse_start_capture,
|
||||||
|
@ -128,13 +128,12 @@ static void solaris_close_playback(ALCdevice *device)
|
|||||||
device->ExtraData = NULL;
|
device->ExtraData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ALCboolean solaris_start_context(ALCdevice *device, ALCcontext *context)
|
static ALCboolean solaris_reset_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
solaris_data *data = (solaris_data*)device->ExtraData;
|
solaris_data *data = (solaris_data*)device->ExtraData;
|
||||||
audio_info_t info;
|
audio_info_t info;
|
||||||
ALuint frameSize;
|
ALuint frameSize;
|
||||||
int numChannels;
|
int numChannels;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
AUDIO_INITINFO(&info);
|
AUDIO_INITINFO(&info);
|
||||||
|
|
||||||
@ -206,10 +205,9 @@ static ALCboolean solaris_start_context(ALCdevice *device, ALCcontext *context)
|
|||||||
return ALC_TRUE;
|
return ALC_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void solaris_stop_context(ALCdevice *device, ALCcontext *context)
|
static void solaris_stop_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
solaris_data *data = (solaris_data*)device->ExtraData;
|
solaris_data *data = (solaris_data*)device->ExtraData;
|
||||||
(void)context;
|
|
||||||
|
|
||||||
if(!data->thread)
|
if(!data->thread)
|
||||||
return;
|
return;
|
||||||
@ -265,8 +263,8 @@ static ALCuint solaris_available_samples(ALCdevice *pDevice)
|
|||||||
BackendFuncs solaris_funcs = {
|
BackendFuncs solaris_funcs = {
|
||||||
solaris_open_playback,
|
solaris_open_playback,
|
||||||
solaris_close_playback,
|
solaris_close_playback,
|
||||||
solaris_start_context,
|
solaris_reset_playback,
|
||||||
solaris_stop_context,
|
solaris_stop_playback,
|
||||||
solaris_open_capture,
|
solaris_open_capture,
|
||||||
solaris_close_capture,
|
solaris_close_capture,
|
||||||
solaris_start_capture,
|
solaris_start_capture,
|
||||||
|
10
Alc/wave.c
10
Alc/wave.c
@ -140,11 +140,10 @@ static void wave_close_playback(ALCdevice *device)
|
|||||||
device->ExtraData = NULL;
|
device->ExtraData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ALCboolean wave_start_context(ALCdevice *device, ALCcontext *Context)
|
static ALCboolean wave_reset_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
wave_data *data = (wave_data*)device->ExtraData;
|
wave_data *data = (wave_data*)device->ExtraData;
|
||||||
ALuint channels, bits, i;
|
ALuint channels, bits, i;
|
||||||
(void)Context;
|
|
||||||
|
|
||||||
fseek(data->f, 0, SEEK_SET);
|
fseek(data->f, 0, SEEK_SET);
|
||||||
clearerr(data->f);
|
clearerr(data->f);
|
||||||
@ -241,12 +240,11 @@ static ALCboolean wave_start_context(ALCdevice *device, ALCcontext *Context)
|
|||||||
return ALC_TRUE;
|
return ALC_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wave_stop_context(ALCdevice *device, ALCcontext *Context)
|
static void wave_stop_playback(ALCdevice *device)
|
||||||
{
|
{
|
||||||
wave_data *data = (wave_data*)device->ExtraData;
|
wave_data *data = (wave_data*)device->ExtraData;
|
||||||
ALuint dataLen;
|
ALuint dataLen;
|
||||||
long size;
|
long size;
|
||||||
(void)Context;
|
|
||||||
|
|
||||||
if(!data->thread)
|
if(!data->thread)
|
||||||
return;
|
return;
|
||||||
@ -320,8 +318,8 @@ static ALCuint wave_available_samples(ALCdevice *pDevice)
|
|||||||
BackendFuncs wave_funcs = {
|
BackendFuncs wave_funcs = {
|
||||||
wave_open_playback,
|
wave_open_playback,
|
||||||
wave_close_playback,
|
wave_close_playback,
|
||||||
wave_start_context,
|
wave_reset_playback,
|
||||||
wave_stop_context,
|
wave_stop_playback,
|
||||||
wave_open_capture,
|
wave_open_capture,
|
||||||
wave_close_capture,
|
wave_close_capture,
|
||||||
wave_start_capture,
|
wave_start_capture,
|
||||||
|
@ -160,8 +160,8 @@ static __inline void al_print(const char *fname, unsigned int line, const char *
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
ALCboolean (*OpenPlayback)(ALCdevice*, const ALCchar*);
|
ALCboolean (*OpenPlayback)(ALCdevice*, const ALCchar*);
|
||||||
void (*ClosePlayback)(ALCdevice*);
|
void (*ClosePlayback)(ALCdevice*);
|
||||||
ALCboolean (*StartContext)(ALCdevice*, ALCcontext*);
|
ALCboolean (*ResetPlayback)(ALCdevice*);
|
||||||
void (*StopContext)(ALCdevice*, ALCcontext*);
|
void (*StopPlayback)(ALCdevice*);
|
||||||
|
|
||||||
ALCboolean (*OpenCapture)(ALCdevice*, const ALCchar*);
|
ALCboolean (*OpenCapture)(ALCdevice*, const ALCchar*);
|
||||||
void (*CloseCapture)(ALCdevice*);
|
void (*CloseCapture)(ALCdevice*);
|
||||||
@ -255,8 +255,8 @@ struct ALCdevice_struct
|
|||||||
|
|
||||||
#define ALCdevice_OpenPlayback(a,b) ((a)->Funcs->OpenPlayback((a), (b)))
|
#define ALCdevice_OpenPlayback(a,b) ((a)->Funcs->OpenPlayback((a), (b)))
|
||||||
#define ALCdevice_ClosePlayback(a) ((a)->Funcs->ClosePlayback((a)))
|
#define ALCdevice_ClosePlayback(a) ((a)->Funcs->ClosePlayback((a)))
|
||||||
#define ALCdevice_StartContext(a,b) ((a)->Funcs->StartContext((a), (b)))
|
#define ALCdevice_ResetPlayback(a) ((a)->Funcs->ResetPlayback((a)))
|
||||||
#define ALCdevice_StopContext(a,b) ((a)->Funcs->StopContext((a), (b)))
|
#define ALCdevice_StopPlayback(a) ((a)->Funcs->StopPlayback((a)))
|
||||||
#define ALCdevice_OpenCapture(a,b) ((a)->Funcs->OpenCapture((a), (b)))
|
#define ALCdevice_OpenCapture(a,b) ((a)->Funcs->OpenCapture((a), (b)))
|
||||||
#define ALCdevice_CloseCapture(a) ((a)->Funcs->CloseCapture((a)))
|
#define ALCdevice_CloseCapture(a) ((a)->Funcs->CloseCapture((a)))
|
||||||
#define ALCdevice_StartCapture(a) ((a)->Funcs->StartCapture((a)))
|
#define ALCdevice_StartCapture(a) ((a)->Funcs->StartCapture((a)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user