From d50e12bb38f69124416033039f8084b2bc11f972 Mon Sep 17 00:00:00 2001 From: "Tony J. White" Date: Sat, 3 Oct 2009 11:43:31 +0000 Subject: * add new CG syscall trap_S_SoundDuration() that returns play time in msec for a registered sfxHandle --- src/client/snd_main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/client/snd_main.c') diff --git a/src/client/snd_main.c b/src/client/snd_main.c index ebb0e9da..b8dfdf36 100644 --- a/src/client/snd_main.c +++ b/src/client/snd_main.c @@ -59,6 +59,7 @@ static qboolean S_ValidSoundInterface( soundInterface_t *si ) if( !si->DisableSounds ) return qfalse; if( !si->BeginRegistration ) return qfalse; if( !si->RegisterSound ) return qfalse; + if( !si->SoundDuration ) return qfalse; if( !si->ClearSoundBuffer ) return qfalse; if( !si->SoundInfo ) return qfalse; if( !si->SoundList ) return qfalse; @@ -269,6 +270,19 @@ sfxHandle_t S_RegisterSound( const char *sample, qboolean compressed ) } } +/* +================= +S_SoundDuration +================= +*/ +int S_SoundDuration( sfxHandle_t handle ) +{ + if( si.SoundDuration ) + return si.SoundDuration( handle ); + else + return 0; +} + /* ================= S_ClearSoundBuffer -- cgit