diff SDL_sound_internal.h @ 223:249186e31431

Sound_Rewind() support code.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 17 Jan 2002 20:55:46 +0000
parents 47cc2de2ae36
children ca43129df299
line wrap: on
line diff
--- a/SDL_sound_internal.h	Thu Jan 17 20:54:46 2002 +0000
+++ b/SDL_sound_internal.h	Thu Jan 17 20:55:46 2002 +0000
@@ -155,6 +155,24 @@
          *  method.
          */
     Uint32 (*read)(Sound_Sample *sample);
+
+        /*
+         * Reset the decoding to the beginning of the stream. Nonzero on
+         *  success, zero on failure.
+         *  
+         * The purpose of this method is to allow for higher efficiency than
+         *  an application could get by just recreating the sample externally;
+         *  not only do they not have to reopen the RWops, reallocate buffers,
+         *  and potentially pass the data through several rejecting decoders,
+         *  but certain decoders will not have to recreate their existing
+         *  state (search for metadata, etc) since they already know they
+         *  have a valid audio stream with a given set of characteristics.
+         *
+         * The decoder is responsible for calling seek() on the associated
+         *  SDL_RWops. A failing call to seek() should be the ONLY reason that
+         *  this method should ever fail!
+         */
+    int (*rewind)(Sound_Sample *sample);
 } Sound_DecoderFunctions;