diff options
author | Chris Robinson <[email protected]> | 2013-10-29 15:07:13 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-10-29 15:07:13 -0700 |
commit | 9f0e49917d808b93e0c47ce4fa2cbf7050cfe65a (patch) | |
tree | f31632c945aba429146c4d0b1cb175c9619d9e5f /Alc | |
parent | 779eb4b82b8c50174ae8bb464bc4938cff07d231 (diff) |
Add default handlers for reset, captureSamples, and availableSamples
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/backends/alsa.c | 23 | ||||
-rw-r--r-- | Alc/backends/base.c | 15 | ||||
-rw-r--r-- | Alc/backends/base.h | 3 | ||||
-rw-r--r-- | Alc/backends/null.c | 20 | ||||
-rw-r--r-- | Alc/backends/pulseaudio.c | 22 |
5 files changed, 36 insertions, 47 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index 586c1bf6..232a9a5c 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -456,14 +456,15 @@ DECLARE_ALCBACKEND_VTABLE(ALCplaybackAlsa); static ALuint ALCplaybackAlsa_mixerProc(ALvoid *ptr); static ALuint ALCplaybackAlsa_mixerNoMMapProc(ALvoid *ptr); +static void ALCplaybackAlsa_Construct(ALCplaybackAlsa *self, ALCdevice *device); static DECLARE_FORWARD(ALCplaybackAlsa, ALCbackend, void, Destruct) static ALCenum ALCplaybackAlsa_open(ALCplaybackAlsa *self, const ALCchar *name); static void ALCplaybackAlsa_close(ALCplaybackAlsa *self); static ALCboolean ALCplaybackAlsa_reset(ALCplaybackAlsa *self); static ALCboolean ALCplaybackAlsa_start(ALCplaybackAlsa *self); static void ALCplaybackAlsa_stop(ALCplaybackAlsa *self); -static ALCenum ALCplaybackAlsa_captureSamples(ALCplaybackAlsa *self, ALCvoid *buffer, ALCuint samples); -static ALCuint ALCplaybackAlsa_availableSamples(ALCplaybackAlsa *self); +static DECLARE_FORWARD2(ALCplaybackAlsa, ALCbackend, ALCenum, captureSamples, void*, ALCuint) +static DECLARE_FORWARD(ALCplaybackAlsa, ALCbackend, ALCuint, availableSamples) static DECLARE_FORWARD(ALCplaybackAlsa, ALCbackend, void, lock) static DECLARE_FORWARD(ALCplaybackAlsa, ALCbackend, void, unlock) @@ -932,16 +933,6 @@ static void ALCplaybackAlsa_stop(ALCplaybackAlsa *self) self->buffer = NULL; } -static ALCenum ALCplaybackAlsa_captureSamples(ALCplaybackAlsa* UNUSED(self), ALCvoid* UNUSED(buffer), ALCuint UNUSED(samples)) -{ - return ALC_INVALID_DEVICE; -} - -static ALCuint ALCplaybackAlsa_availableSamples(ALCplaybackAlsa* UNUSED(self)) -{ - return 0; -} - static ALint64 ALCplaybackAlsa_getLatency(ALCplaybackAlsa *self) { ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; @@ -980,10 +971,11 @@ typedef struct ALCcaptureAlsa { } ALCcaptureAlsa; DECLARE_ALCBACKEND_VTABLE(ALCcaptureAlsa); +static void ALCcaptureAlsa_Construct(ALCcaptureAlsa *self, ALCdevice *device); static DECLARE_FORWARD(ALCcaptureAlsa, ALCbackend, void, Destruct) static ALCenum ALCcaptureAlsa_open(ALCcaptureAlsa *self, const ALCchar *name); static void ALCcaptureAlsa_close(ALCcaptureAlsa *self); -static ALCboolean ALCcaptureAlsa_reset(ALCcaptureAlsa *self); +static DECLARE_FORWARD(ALCcaptureAlsa, ALCbackend, ALCboolean, reset) static ALCboolean ALCcaptureAlsa_start(ALCcaptureAlsa *self); static void ALCcaptureAlsa_stop(ALCcaptureAlsa *self); static ALCenum ALCcaptureAlsa_captureSamples(ALCcaptureAlsa *self, ALCvoid *buffer, ALCuint samples); @@ -1150,11 +1142,6 @@ static void ALCcaptureAlsa_close(ALCcaptureAlsa *self) self->buffer = NULL; } -static ALCboolean ALCcaptureAlsa_reset(ALCcaptureAlsa* UNUSED(self)) -{ - return ALC_FALSE; -} - static ALCboolean ALCcaptureAlsa_start(ALCcaptureAlsa *self) { int err = snd_pcm_start(self->pcmHandle); diff --git a/Alc/backends/base.c b/Alc/backends/base.c index cb999f87..2f3ff924 100644 --- a/Alc/backends/base.c +++ b/Alc/backends/base.c @@ -20,6 +20,21 @@ void ALCbackend_Destruct(ALCbackend *self) DeleteCriticalSection(&self->mMutex); } +ALCboolean ALCbackend_reset(ALCbackend* UNUSED(self)) +{ + return ALC_FALSE; +} + +ALCenum ALCbackend_captureSamples(ALCbackend* UNUSED(self), void* UNUSED(buffer), ALCuint UNUSED(samples)) +{ + return ALC_INVALID_DEVICE; +} + +ALCuint ALCbackend_availableSamples(ALCbackend* UNUSED(self)) +{ + return 0; +} + ALint64 ALCbackend_getLatency(ALCbackend* UNUSED(self)) { return 0; diff --git a/Alc/backends/base.h b/Alc/backends/base.h index 8dd896d8..285d1ac9 100644 --- a/Alc/backends/base.h +++ b/Alc/backends/base.h @@ -17,6 +17,9 @@ typedef struct ALCbackend { void ALCbackend_Construct(ALCbackend *self, ALCdevice *device); void ALCbackend_Destruct(ALCbackend *self); +ALCboolean ALCbackend_reset(ALCbackend *self); +ALCenum ALCbackend_captureSamples(ALCbackend *self, void *buffer, ALCuint samples); +ALCuint ALCbackend_availableSamples(ALCbackend *self); ALint64 ALCbackend_getLatency(ALCbackend *self); void ALCbackend_lock(ALCbackend *self); void ALCbackend_unlock(ALCbackend *self); diff --git a/Alc/backends/null.c b/Alc/backends/null.c index 8eeb2689..6068d990 100644 --- a/Alc/backends/null.c +++ b/Alc/backends/null.c @@ -41,7 +41,17 @@ typedef struct ALCnullBackend { } ALCnullBackend; DECLARE_ALCBACKEND_VTABLE(ALCnullBackend); +static ALuint ALCnullBackend_mixerProc(ALvoid *ptr); + +static void ALCnullBackend_Construct(ALCnullBackend *self, ALCdevice *device); static DECLARE_FORWARD(ALCnullBackend, ALCbackend, void, Destruct) +static ALCenum ALCnullBackend_open(ALCnullBackend *self, const ALCchar *name); +static void ALCnullBackend_close(ALCnullBackend *self); +static ALCboolean ALCnullBackend_reset(ALCnullBackend *self); +static ALCboolean ALCnullBackend_start(ALCnullBackend *self); +static void ALCnullBackend_stop(ALCnullBackend *self); +static DECLARE_FORWARD2(ALCnullBackend, ALCbackend, ALCenum, captureSamples, void*, ALCuint) +static DECLARE_FORWARD(ALCnullBackend, ALCbackend, ALCuint, availableSamples) static DECLARE_FORWARD(ALCnullBackend, ALCbackend, ALint64, getLatency) static DECLARE_FORWARD(ALCnullBackend, ALCbackend, void, lock) static DECLARE_FORWARD(ALCnullBackend, ALCbackend, void, unlock) @@ -142,16 +152,6 @@ static void ALCnullBackend_stop(ALCnullBackend *self) self->killNow = 0; } -ALCenum ALCnullBackend_captureSamples(ALCnullBackend* UNUSED(self), void* UNUSED(buffer), ALCuint UNUSED(samples)) -{ - return ALC_INVALID_VALUE; -} - -ALCuint ALCnullBackend_availableSamples(ALCnullBackend* UNUSED(self)) -{ - return 0; -} - static void ALCnullBackend_Delete(ALCnullBackend *self) { diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 1d354462..fcb29e16 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -508,8 +508,8 @@ static void ALCpulsePlayback_close(ALCpulsePlayback *self); static ALCboolean ALCpulsePlayback_reset(ALCpulsePlayback *self); static ALCboolean ALCpulsePlayback_start(ALCpulsePlayback *self); static void ALCpulsePlayback_stop(ALCpulsePlayback *self); -static ALCenum ALCpulsePlayback_captureSamples(ALCpulsePlayback *self, ALCvoid *buffer, ALCuint samples); -static ALCuint ALCpulsePlayback_availableSamples(ALCpulsePlayback *self); +static DECLARE_FORWARD2(ALCpulsePlayback, ALCbackend, ALCenum, captureSamples, ALCvoid*, ALCuint) +static DECLARE_FORWARD(ALCpulsePlayback, ALCbackend, ALCuint, availableSamples) static void ALCpulsePlayback_lock(ALCpulsePlayback *self); static void ALCpulsePlayback_unlock(ALCpulsePlayback *self); @@ -1083,17 +1083,6 @@ static void ALCpulsePlayback_stop(ALCpulsePlayback *self) } -static ALCenum ALCpulsePlayback_captureSamples(ALCpulsePlayback* UNUSED(self), ALCvoid* UNUSED(buffer), ALCuint UNUSED(samples)) -{ - return ALC_INVALID_DEVICE; -} - -static ALCuint ALCpulsePlayback_availableSamples(ALCpulsePlayback* UNUSED(self)) -{ - return 0; -} - - static void ALCpulsePlayback_lock(ALCpulsePlayback *self) { pa_threaded_mainloop_lock(self->loop); @@ -1166,7 +1155,7 @@ static void ALCpulseCapture_Construct(ALCpulseCapture *self, ALCdevice *device); static DECLARE_FORWARD(ALCpulseCapture, ALCbackend, void, Destruct) static ALCenum ALCpulseCapture_open(ALCpulseCapture *self, const ALCchar *name); static void ALCpulseCapture_close(ALCpulseCapture *self); -static ALCboolean ALCpulseCapture_reset(ALCpulseCapture *self); +static DECLARE_FORWARD(ALCpulseCapture, ALCbackend, ALCboolean, reset) static ALCboolean ALCpulseCapture_start(ALCpulseCapture *self); static void ALCpulseCapture_stop(ALCpulseCapture *self); static ALCenum ALCpulseCapture_captureSamples(ALCpulseCapture *self, ALCvoid *buffer, ALCuint samples); @@ -1481,11 +1470,6 @@ static void ALCpulseCapture_close(ALCpulseCapture *self) self->device_name = NULL; } -static ALCboolean ALCpulseCapture_reset(ALCpulseCapture* UNUSED(self)) -{ - return ALC_FALSE; -} - static ALCboolean ALCpulseCapture_start(ALCpulseCapture *self) { pa_operation *o; |