aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-08-17 13:38:52 -0700
committerChris Robinson <[email protected]>2012-08-17 13:38:52 -0700
commitac4fc4026c3b1b0b9487216399bef04d419b04b8 (patch)
tree730148652e49723e644f7df8107c0c3be3c19821 /OpenAL32/Include
parent9737f683150180a5531d276959030ffa0bd35492 (diff)
Add a device method to retrieve the active latency
This is effectively the time until the next update will be heard by the user, or the closest approximation thereof, in nanoseconds.
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h3
-rw-r--r--OpenAL32/Include/alu.h7
2 files changed, 10 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 8b1bcc0f..f4f3b88e 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -419,6 +419,8 @@ typedef struct {
void (*StopCapture)(ALCdevice*);
ALCenum (*CaptureSamples)(ALCdevice*, void*, ALCuint);
ALCuint (*AvailableSamples)(ALCdevice*);
+
+ ALint64 (*GetLatency)(ALCdevice*);
} BackendFuncs;
struct BackendInfo {
@@ -604,6 +606,7 @@ struct ALCdevice_struct
#define ALCdevice_StopCapture(a) ((a)->Funcs->StopCapture((a)))
#define ALCdevice_CaptureSamples(a,b,c) ((a)->Funcs->CaptureSamples((a), (b), (c)))
#define ALCdevice_AvailableSamples(a) ((a)->Funcs->AvailableSamples((a)))
+#define ALCdevice_GetLatency(a) ((a)->Funcs->GetLatency((a)))
// Frequency was requested by the app or config file
#define DEVICE_FREQUENCY_REQUEST (1<<1)
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index cd8f1554..f623589f 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -201,6 +201,13 @@ static __inline ALint64 maxi64(ALint64 a, ALint64 b)
static __inline ALint64 clampi64(ALint64 val, ALint64 min, ALint64 max)
{ return mini64(max, maxi64(min, val)); }
+static __inline ALuint64 minu64(ALuint64 a, ALuint64 b)
+{ return ((a > b) ? b : a); }
+static __inline ALuint64 maxu64(ALuint64 a, ALuint64 b)
+{ return ((a > b) ? a : b); }
+static __inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max)
+{ return minu64(max, maxu64(min, val)); }
+
static __inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu)
{