aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-10-28 05:10:28 -0700
committerChris Robinson <[email protected]>2013-10-28 05:10:28 -0700
commitf065700ef925048d28d7db3bd4d9225e7aa21cc7 (patch)
tree8a45643264ff871f2f3309e49213bf91112943a5 /Alc/ALc.c
parente54983694bc43a0f1a7ebb4ed0aeb78a1f2d36ab (diff)
Move the lock/unlock methods to the backend
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 63dfa038..d2c28a05 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -153,6 +153,18 @@ static ALint64 BackendWrapper_getLatency(BackendWrapper *self)
return device->Funcs->GetLatency(device);
}
+static void BackendWrapper_lock(BackendWrapper *self)
+{
+ ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice;
+ return device->Funcs->Lock(device);
+}
+
+static void BackendWrapper_unlock(BackendWrapper *self)
+{
+ ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice;
+ return device->Funcs->Unlock(device);
+}
+
static void BackendWrapper_Delete(BackendWrapper *self)
{
free(self);
@@ -1414,11 +1426,44 @@ ALint64 ALCdevice_GetLatencyDefault(ALCdevice *UNUSED(device))
return 0;
}
+
ALint64 alcGetLatency(ALCdevice *device)
{
return VCALL0(device->Backend,getLatency,());
}
+void ALCdevice_Lock(ALCdevice *device)
+{
+ return VCALL0(device->Backend,lock,());
+}
+
+void ALCdevice_Unlock(ALCdevice *device)
+{
+ return VCALL0(device->Backend,unlock,());
+}
+
+void LockContext(ALCcontext *context)
+{
+ VCALL0(context->Device->Backend,lock,());
+}
+
+void UnlockContext(ALCcontext *context)
+{
+ VCALL0(context->Device->Backend,unlock,());
+}
+
+
+void ALCbackend_lock(ALCbackend *self)
+{
+ ALCdevice_LockDefault(self->mDevice);
+}
+
+void ALCbackend_unlock(ALCbackend *self)
+{
+ ALCdevice_UnlockDefault(self->mDevice);
+}
+
+
/* SetDefaultWFXChannelOrder
*
* Sets the default channel order used by WaveFormatEx.