summaryrefslogtreecommitdiff
path: root/src/client/snd_main.c
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2009-10-03 11:43:31 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:17 +0000
commitd50e12bb38f69124416033039f8084b2bc11f972 (patch)
tree5a081d29a5e38fe3e958822475a55a32be259b85 /src/client/snd_main.c
parentaaa6c764b0faf5bcdc0108eed7a18a130caab662 (diff)
* add new CG syscall trap_S_SoundDuration() that returns play time
in msec for a registered sfxHandle
Diffstat (limited to 'src/client/snd_main.c')
-rw-r--r--src/client/snd_main.c14
1 files changed, 14 insertions, 0 deletions
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;
@@ -271,6 +272,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
=================
*/