comparison decoders/wav.c @ 47:ea58bc3b15d7

Added init() and quit() methods.
author Ryan C. Gordon <icculus@icculus.org>
date Sat, 22 Sep 2001 14:41:38 +0000
parents c15396fc0e55
children b13fafb976be
comparison
equal deleted inserted replaced
46:6e13fcc178da 47:ea58bc3b15d7
39 39
40 #if (!defined SOUND_SUPPORTS_WAV) 40 #if (!defined SOUND_SUPPORTS_WAV)
41 #error SOUND_SUPPORTS_WAV must be defined. 41 #error SOUND_SUPPORTS_WAV must be defined.
42 #endif 42 #endif
43 43
44 static int WAV_init(void);
45 static void WAV_quit(void);
44 static int WAV_open(Sound_Sample *sample, const char *ext); 46 static int WAV_open(Sound_Sample *sample, const char *ext);
45 static void WAV_close(Sound_Sample *sample); 47 static void WAV_close(Sound_Sample *sample);
46 static Uint32 WAV_read(Sound_Sample *sample); 48 static Uint32 WAV_read(Sound_Sample *sample);
47 49
48 const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV = 50 const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV =
52 "Microsoft WAVE audio format", 54 "Microsoft WAVE audio format",
53 "Ryan C. Gordon <icculus@clutteredmind.org>", 55 "Ryan C. Gordon <icculus@clutteredmind.org>",
54 "http://www.icculus.org/SDL_sound/" 56 "http://www.icculus.org/SDL_sound/"
55 }, 57 },
56 58
57 WAV_open, /* open() method */ 59 WAV_init, /* init() method */
58 WAV_close, /* close() method */ 60 WAV_quit, /* quit() method */
59 WAV_read /* read() method */ 61 WAV_open, /* open() method */
62 WAV_close, /* close() method */
63 WAV_read /* read() method */
60 }; 64 };
61 65
62 66
63 /* this is what we store in our internal->decoder_private field... */ 67 /* this is what we store in our internal->decoder_private field... */
64 typedef struct 68 typedef struct
88 Uint16 wBlockAlign; 92 Uint16 wBlockAlign;
89 Uint16 wBitsPerSample; 93 Uint16 wBitsPerSample;
90 } fmt_t; 94 } fmt_t;
91 95
92 96
97 static int WAV_init(void)
98 {
99 return(1); /* always succeeds. */
100 } /* WAV_init */
101
102
103 static void WAV_quit(void)
104 {
105 /* it's a no-op. */
106 } /* WAV_quit */
107
108
93 /* 109 /*
94 * Read in a fmt_t from disk. This makes this process safe regardless of 110 * Read in a fmt_t from disk. This makes this process safe regardless of
95 * the processor's byte order or how the fmt_t structure is packed. 111 * the processor's byte order or how the fmt_t structure is packed.
96 */ 112 */
97 static int read_fmt_chunk(SDL_RWops *rw, fmt_t *fmt) 113 static int read_fmt_chunk(SDL_RWops *rw, fmt_t *fmt)