diff options
author | Chris Robinson <[email protected]> | 2013-11-04 23:34:18 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-11-04 23:34:18 -0800 |
commit | 10dbb1bc9b5d5040cb363c5a0dccb8ad273052b9 (patch) | |
tree | 4a83d72f77bd1a1cc4a71bc354af2ca0f7a30771 | |
parent | ca83629e4e9ea322716d8e3115b1ee61204212ad (diff) |
Remove the Lock and Unlock methods from BackendFuncs
All backends that still use the old interface use the default locking methods,
which is also used by the ALCbackend base.
-rw-r--r-- | Alc/ALc.c | 16 | ||||
-rw-r--r-- | Alc/backends/base.c | 32 | ||||
-rw-r--r-- | Alc/backends/coreaudio.c | 2 | ||||
-rw-r--r-- | Alc/backends/dsound.c | 2 | ||||
-rw-r--r-- | Alc/backends/mmdevapi.c | 2 | ||||
-rw-r--r-- | Alc/backends/opensl.c | 2 | ||||
-rw-r--r-- | Alc/backends/portaudio.c | 2 | ||||
-rw-r--r-- | Alc/backends/qsa.c | 2 | ||||
-rw-r--r-- | Alc/backends/sndio.c | 2 | ||||
-rw-r--r-- | Alc/backends/solaris.c | 2 | ||||
-rw-r--r-- | Alc/backends/wave.c | 2 | ||||
-rw-r--r-- | Alc/backends/winmm.c | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 5 |
13 files changed, 7 insertions, 66 deletions
@@ -53,7 +53,7 @@ struct BackendInfo { BackendFuncs Funcs; }; -#define EmptyFuncs { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } +#define EmptyFuncs { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } static struct BackendInfo BackendList[] = { #ifdef HAVE_PULSEAUDIO { "pulse", ALCpulseBackendFactory_getFactory, NULL, NULL, NULL, EmptyFuncs }, @@ -1386,21 +1386,14 @@ static ALCboolean IsValidALCChannels(ALCenum channels) /************************************************ * Miscellaneous ALC helpers ************************************************/ +extern inline void LockContext(ALCcontext *context); +extern inline void UnlockContext(ALCcontext *context); -void ALCdevice_LockDefault(ALCdevice *device) -{ - ALCbackend_lock(device->Backend); -} -void ALCdevice_UnlockDefault(ALCdevice *device) -{ - ALCbackend_unlock(device->Backend); -} ALint64 ALCdevice_GetLatencyDefault(ALCdevice *UNUSED(device)) { return 0; } - ALint64 ALCdevice_GetLatency(ALCdevice *device) { return V0(device->Backend,getLatency)(); @@ -1416,9 +1409,6 @@ void ALCdevice_Unlock(ALCdevice *device) V0(device->Backend,unlock)(); } -extern inline void LockContext(ALCcontext *context); -extern inline void UnlockContext(ALCcontext *context); - /* SetDefaultWFXChannelOrder * diff --git a/Alc/backends/base.c b/Alc/backends/base.c index a6163c08..d9ef3e99 100644 --- a/Alc/backends/base.c +++ b/Alc/backends/base.c @@ -72,8 +72,8 @@ static void PlaybackWrapper_stop(PlaybackWrapper *self); static DECLARE_FORWARD2(PlaybackWrapper, ALCbackend, ALCenum, captureSamples, void*, ALCuint) static DECLARE_FORWARD(PlaybackWrapper, ALCbackend, ALCuint, availableSamples) static ALint64 PlaybackWrapper_getLatency(PlaybackWrapper *self); -static void PlaybackWrapper_lock(PlaybackWrapper *self); -static void PlaybackWrapper_unlock(PlaybackWrapper *self); +static DECLARE_FORWARD(PlaybackWrapper, ALCbackend, void, lock) +static DECLARE_FORWARD(PlaybackWrapper, ALCbackend, void, unlock) static void PlaybackWrapper_Delete(PlaybackWrapper *self); DEFINE_ALCBACKEND_VTABLE(PlaybackWrapper); @@ -119,18 +119,6 @@ static ALint64 PlaybackWrapper_getLatency(PlaybackWrapper *self) return device->Funcs->GetLatency(device); } -static void PlaybackWrapper_lock(PlaybackWrapper *self) -{ - ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; - device->Funcs->Lock(device); -} - -static void PlaybackWrapper_unlock(PlaybackWrapper *self) -{ - ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; - device->Funcs->Unlock(device); -} - static void PlaybackWrapper_Delete(PlaybackWrapper *self) { free(self); @@ -151,8 +139,8 @@ static void CaptureWrapper_stop(CaptureWrapper *self); ALCenum CaptureWrapper_captureSamples(CaptureWrapper *self, void *buffer, ALCuint samples); ALCuint CaptureWrapper_availableSamples(CaptureWrapper *self); static ALint64 CaptureWrapper_getLatency(CaptureWrapper *self); -static void CaptureWrapper_lock(CaptureWrapper *self); -static void CaptureWrapper_unlock(CaptureWrapper *self); +static DECLARE_FORWARD(CaptureWrapper, ALCbackend, void, lock) +static DECLARE_FORWARD(CaptureWrapper, ALCbackend, void, unlock) static void CaptureWrapper_Delete(CaptureWrapper *self); DEFINE_ALCBACKEND_VTABLE(CaptureWrapper); @@ -206,18 +194,6 @@ static ALint64 CaptureWrapper_getLatency(CaptureWrapper *self) return device->Funcs->GetLatency(device); } -static void CaptureWrapper_lock(CaptureWrapper *self) -{ - ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; - device->Funcs->Lock(device); -} - -static void CaptureWrapper_unlock(CaptureWrapper *self) -{ - ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; - device->Funcs->Unlock(device); -} - static void CaptureWrapper_Delete(CaptureWrapper *self) { free(self); diff --git a/Alc/backends/coreaudio.c b/Alc/backends/coreaudio.c index 150f37ac..5c9b69c8 100644 --- a/Alc/backends/coreaudio.c +++ b/Alc/backends/coreaudio.c @@ -677,8 +677,6 @@ static const BackendFuncs ca_funcs = { ca_stop_capture, ca_capture_samples, ca_available_samples, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, ALCdevice_GetLatencyDefault }; diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c index 9fa4bd61..0c4f816b 100644 --- a/Alc/backends/dsound.c +++ b/Alc/backends/dsound.c @@ -955,8 +955,6 @@ static const BackendFuncs DSoundFuncs = { DSoundStopCapture, DSoundCaptureSamples, DSoundAvailableSamples, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, ALCdevice_GetLatencyDefault }; diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c index 31be2ed1..8bbbbddb 100644 --- a/Alc/backends/mmdevapi.c +++ b/Alc/backends/mmdevapi.c @@ -968,8 +968,6 @@ static const BackendFuncs MMDevApiFuncs = { NULL, NULL, NULL, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, MMDevApiGetLatency }; diff --git a/Alc/backends/opensl.c b/Alc/backends/opensl.c index 1a104029..4e260879 100644 --- a/Alc/backends/opensl.c +++ b/Alc/backends/opensl.c @@ -420,8 +420,6 @@ static const BackendFuncs opensl_funcs = { NULL, NULL, NULL, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, ALCdevice_GetLatencyDefault }; diff --git a/Alc/backends/portaudio.c b/Alc/backends/portaudio.c index fde1f59d..162788fc 100644 --- a/Alc/backends/portaudio.c +++ b/Alc/backends/portaudio.c @@ -427,8 +427,6 @@ static const BackendFuncs pa_funcs = { pa_stop_capture, pa_capture_samples, pa_available_samples, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, ALCdevice_GetLatencyDefault }; diff --git a/Alc/backends/qsa.c b/Alc/backends/qsa.c index d91ffb2c..ae3ace61 100644 --- a/Alc/backends/qsa.c +++ b/Alc/backends/qsa.c @@ -1109,8 +1109,6 @@ BackendFuncs qsa_funcs= qsa_stop_capture, qsa_capture_samples, qsa_available_samples, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, qsa_get_latency, }; diff --git a/Alc/backends/sndio.c b/Alc/backends/sndio.c index d61ab3df..80aebfd1 100644 --- a/Alc/backends/sndio.c +++ b/Alc/backends/sndio.c @@ -267,8 +267,6 @@ static const BackendFuncs sndio_funcs = { NULL, NULL, NULL, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, ALCdevice_GetLatencyDefault }; diff --git a/Alc/backends/solaris.c b/Alc/backends/solaris.c index c4d40273..700131c8 100644 --- a/Alc/backends/solaris.c +++ b/Alc/backends/solaris.c @@ -253,8 +253,6 @@ static const BackendFuncs solaris_funcs = { NULL, NULL, NULL, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, ALCdevice_GetLatencyDefault }; diff --git a/Alc/backends/wave.c b/Alc/backends/wave.c index ec88862b..2fafc4b9 100644 --- a/Alc/backends/wave.c +++ b/Alc/backends/wave.c @@ -343,8 +343,6 @@ static const BackendFuncs wave_funcs = { NULL, NULL, NULL, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, ALCdevice_GetLatencyDefault }; diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c index 5a64645b..f268aca7 100644 --- a/Alc/backends/winmm.c +++ b/Alc/backends/winmm.c @@ -713,8 +713,6 @@ static const BackendFuncs WinMMFuncs = { WinMMStopCapture, WinMMCaptureSamples, WinMMAvailableSamples, - ALCdevice_LockDefault, - ALCdevice_UnlockDefault, ALCdevice_GetLatencyDefault }; diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 2af21017..095a4a2c 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -201,9 +201,6 @@ typedef struct { ALCenum (*CaptureSamples)(ALCdevice*, void*, ALCuint); ALCuint (*AvailableSamples)(ALCdevice*); - void (*Lock)(ALCdevice*); - void (*Unlock)(ALCdevice*); - ALint64 (*GetLatency)(ALCdevice*); } BackendFuncs; @@ -475,8 +472,6 @@ void ALCcontext_DecRef(ALCcontext *context); void AppendAllDevicesList(const ALCchar *name); void AppendCaptureDeviceList(const ALCchar *name); -void ALCdevice_LockDefault(ALCdevice *device); -void ALCdevice_UnlockDefault(ALCdevice *device); ALint64 ALCdevice_GetLatencyDefault(ALCdevice *device); void ALCdevice_Lock(ALCdevice *device); |