diff decoders/skeleton.c @ 306:c97be6e1bd27

Added framework for Sound_Seek() support.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 21 Apr 2002 18:39:47 +0000
parents c9772a9f5271
children cbb15ecf423a
line wrap: on
line diff
--- a/decoders/skeleton.c	Sun Apr 21 17:48:11 2002 +0000
+++ b/decoders/skeleton.c	Sun Apr 21 18:39:47 2002 +0000
@@ -59,6 +59,7 @@
 static void FMT_close(Sound_Sample *sample);
 static Uint32 FMT_read(Sound_Sample *sample);
 static int FMT_rewind(Sound_Sample *sample);
+static int FMT_seek(Sound_Sample *sample, Uint32 ms);
 
 static const char *extensions_fmt[] = { "FMT", NULL };
 const Sound_DecoderFunctions __Sound_DecoderFunctions_FMT =
@@ -75,7 +76,8 @@
     FMT_open,       /*   open() method */
     FMT_close,      /*  close() method */
     FMT_read,       /*   read() method */
-    FMT_rewind      /* rewind() method */
+    FMT_rewind,     /* rewind() method */
+    FMT_seek        /*   seek() method */
 };
 
 
@@ -161,6 +163,20 @@
     return(1);  /* success. */
 } /* FMT_rewind */
 
+
+static int FMT_seek(Sound_Sample *sample, Uint32 ms)
+{
+    Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
+
+        /* seek to the appropriate place... */
+    BAIL_IF_MACRO(SDL_RWseek(internal->rw, 0, SEEK_SET) != 0, ERR_IO_ERROR, 0);
+
+    (set state as necessary.)
+
+    return(1);  /* success. */
+} /* FMT_seek */
+
+
 #endif /* SOUND_SUPPORTS_FMT */