diff options
author | Chris Robinson <[email protected]> | 2013-11-04 23:19:30 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-11-04 23:19:30 -0800 |
commit | ca83629e4e9ea322716d8e3115b1ee61204212ad (patch) | |
tree | f9ddf08ea6230c79951472e00b0163ce42175379 | |
parent | 5874e387a8aafd6218e1517b47697ae8aced7d49 (diff) |
Forward some wrapper functions to the base method
-rw-r--r-- | Alc/backends/base.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/Alc/backends/base.c b/Alc/backends/base.c index d32cf417..a6163c08 100644 --- a/Alc/backends/base.c +++ b/Alc/backends/base.c @@ -61,7 +61,21 @@ void ALCbackendFactory_deinit(ALCbackendFactory* UNUSED(self)) typedef struct PlaybackWrapper { DERIVE_FROM_TYPE(ALCbackend); } PlaybackWrapper; -DECLARE_ALCBACKEND_VTABLE(PlaybackWrapper); + +static void PlaybackWrapper_Construct(PlaybackWrapper *self, ALCdevice *device); +static DECLARE_FORWARD(PlaybackWrapper, ALCbackend, void, Destruct) +static ALCenum PlaybackWrapper_open(PlaybackWrapper *self, const ALCchar *name); +static void PlaybackWrapper_close(PlaybackWrapper *self); +static ALCboolean PlaybackWrapper_reset(PlaybackWrapper *self); +static ALCboolean PlaybackWrapper_start(PlaybackWrapper *self); +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 void PlaybackWrapper_Delete(PlaybackWrapper *self); +DEFINE_ALCBACKEND_VTABLE(PlaybackWrapper); static void PlaybackWrapper_Construct(PlaybackWrapper *self, ALCdevice *device) { @@ -69,11 +83,6 @@ static void PlaybackWrapper_Construct(PlaybackWrapper *self, ALCdevice *device) SET_VTABLE2(PlaybackWrapper, ALCbackend, self); } -static void PlaybackWrapper_Destruct(PlaybackWrapper *self) -{ - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); -} - static ALCenum PlaybackWrapper_open(PlaybackWrapper *self, const ALCchar *name) { ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; @@ -104,16 +113,6 @@ static void PlaybackWrapper_stop(PlaybackWrapper *self) device->Funcs->StopPlayback(device); } -ALCenum PlaybackWrapper_captureSamples(PlaybackWrapper* UNUSED(self), void* UNUSED(buffer), ALCuint UNUSED(samples)) -{ - return ALC_INVALID_VALUE; -} - -ALCuint PlaybackWrapper_availableSamples(PlaybackWrapper* UNUSED(self)) -{ - return 0; -} - static ALint64 PlaybackWrapper_getLatency(PlaybackWrapper *self) { ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; @@ -137,13 +136,26 @@ static void PlaybackWrapper_Delete(PlaybackWrapper *self) free(self); } -DEFINE_ALCBACKEND_VTABLE(PlaybackWrapper); - typedef struct CaptureWrapper { DERIVE_FROM_TYPE(ALCbackend); } CaptureWrapper; -DECLARE_ALCBACKEND_VTABLE(CaptureWrapper); + +static void CaptureWrapper_Construct(CaptureWrapper *self, ALCdevice *device); +static DECLARE_FORWARD(CaptureWrapper, ALCbackend, void, Destruct) +static ALCenum CaptureWrapper_open(CaptureWrapper *self, const ALCchar *name); +static void CaptureWrapper_close(CaptureWrapper *self); +static DECLARE_FORWARD(CaptureWrapper, ALCbackend, ALCboolean, reset) +static ALCboolean CaptureWrapper_start(CaptureWrapper *self); +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 void CaptureWrapper_Delete(CaptureWrapper *self); +DEFINE_ALCBACKEND_VTABLE(CaptureWrapper); + static void CaptureWrapper_Construct(CaptureWrapper *self, ALCdevice *device) { @@ -151,11 +163,6 @@ static void CaptureWrapper_Construct(CaptureWrapper *self, ALCdevice *device) SET_VTABLE2(CaptureWrapper, ALCbackend, self); } -static void CaptureWrapper_Destruct(CaptureWrapper *self) -{ - ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); -} - static ALCenum CaptureWrapper_open(CaptureWrapper *self, const ALCchar *name) { ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; @@ -168,11 +175,6 @@ static void CaptureWrapper_close(CaptureWrapper *self) device->Funcs->CloseCapture(device); } -static ALCboolean CaptureWrapper_reset(CaptureWrapper* UNUSED(self)) -{ - return ALC_FALSE; -} - static ALCboolean CaptureWrapper_start(CaptureWrapper *self) { ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; @@ -221,8 +223,6 @@ static void CaptureWrapper_Delete(CaptureWrapper *self) free(self); } -DEFINE_ALCBACKEND_VTABLE(CaptureWrapper); - ALCbackend *create_backend_wrapper(ALCdevice *device, ALCbackend_Type type) { |