comparison decoders/wav.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 170b1400e060
children eb7c929193dd
comparison
equal deleted inserted replaced
305:c345a40a8a99 306:c97be6e1bd27
48 static void WAV_quit(void); 48 static void WAV_quit(void);
49 static int WAV_open(Sound_Sample *sample, const char *ext); 49 static int WAV_open(Sound_Sample *sample, const char *ext);
50 static void WAV_close(Sound_Sample *sample); 50 static void WAV_close(Sound_Sample *sample);
51 static Uint32 WAV_read(Sound_Sample *sample); 51 static Uint32 WAV_read(Sound_Sample *sample);
52 static int WAV_rewind(Sound_Sample *sample); 52 static int WAV_rewind(Sound_Sample *sample);
53 static int WAV_seek(Sound_Sample *sample, Uint32 ms);
53 54
54 static const char *extensions_wav[] = { "WAV", NULL }; 55 static const char *extensions_wav[] = { "WAV", NULL };
55 const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV = 56 const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV =
56 { 57 {
57 { 58 {
64 WAV_init, /* init() method */ 65 WAV_init, /* init() method */
65 WAV_quit, /* quit() method */ 66 WAV_quit, /* quit() method */
66 WAV_open, /* open() method */ 67 WAV_open, /* open() method */
67 WAV_close, /* close() method */ 68 WAV_close, /* close() method */
68 WAV_read, /* read() method */ 69 WAV_read, /* read() method */
69 WAV_rewind /* rewind() method */ 70 WAV_rewind, /* rewind() method */
71 WAV_seek /* seek() method */
70 }; 72 };
71 73
72 74
73 /* Better than SDL_ReadLE16, since you can detect i/o errors... */ 75 /* Better than SDL_ReadLE16, since you can detect i/o errors... */
74 static inline int read_le16(SDL_RWops *rw, Uint16 *ui16) 76 static inline int read_le16(SDL_RWops *rw, Uint16 *ui16)
717 BAIL_IF_MACRO(rc != fmt->data_starting_offset, ERR_IO_ERROR, 0); 719 BAIL_IF_MACRO(rc != fmt->data_starting_offset, ERR_IO_ERROR, 0);
718 w->bytesLeft = fmt->total_bytes; 720 w->bytesLeft = fmt->total_bytes;
719 return(fmt->rewind_sample(sample)); 721 return(fmt->rewind_sample(sample));
720 } /* WAV_rewind */ 722 } /* WAV_rewind */
721 723
724
725 static int WAV_seek(Sound_Sample *sample, Uint32 ms)
726 {
727 BAIL_MACRO("!!! FIXME: Not implemented", 0);
728 } /* WAV_seek */
729
722 #endif /* SOUND_SUPPORTS_WAV */ 730 #endif /* SOUND_SUPPORTS_WAV */
723 731
724 /* end of wav.c ... */ 732 /* end of wav.c ... */
725 733