From 40dd1fb85364e3a9e278ffa7a034638e7718770b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 24 Jul 2010 19:14:32 -0700 Subject: Add a backend callback to get the device time The method should monotonically count the number of nanoseconds the device has active contexts --- Alc/wave.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Alc/wave.c') diff --git a/Alc/wave.c b/Alc/wave.c index 62c3ffc2..61a93570 100644 --- a/Alc/wave.c +++ b/Alc/wave.c @@ -334,6 +334,11 @@ static ALCboolean wave_open_capture(ALCdevice *pDevice, const ALCchar *deviceNam return ALC_FALSE; } +static ALuint64 wave_get_time(ALCdevice *Device) +{ + return Device->SamplesPlayed * 1000000000 / Device->Frequency; +} + BackendFuncs wave_funcs = { wave_open_playback, @@ -345,7 +350,8 @@ BackendFuncs wave_funcs = { NULL, NULL, NULL, - NULL + NULL, + wave_get_time }; void alc_wave_init(BackendFuncs *func_list) -- cgit v1.2.3