comparison decoders/voc.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 4a60ee42ca9a
children b13fafb976be
comparison
equal deleted inserted replaced
46:6e13fcc178da 47:ea58bc3b15d7
49 #if (!defined SOUND_SUPPORTS_VOC) 49 #if (!defined SOUND_SUPPORTS_VOC)
50 #error SOUND_SUPPORTS_VOC must be defined. 50 #error SOUND_SUPPORTS_VOC must be defined.
51 #endif 51 #endif
52 52
53 53
54 static int VOC_init(void);
55 static void VOC_quit(void);
54 static int VOC_open(Sound_Sample *sample, const char *ext); 56 static int VOC_open(Sound_Sample *sample, const char *ext);
55 static void VOC_close(Sound_Sample *sample); 57 static void VOC_close(Sound_Sample *sample);
56 static Uint32 VOC_read(Sound_Sample *sample); 58 static Uint32 VOC_read(Sound_Sample *sample);
57 59
58 const Sound_DecoderFunctions __Sound_DecoderFunctions_VOC = 60 const Sound_DecoderFunctions __Sound_DecoderFunctions_VOC =
62 "Creative Labs Voice format", 64 "Creative Labs Voice format",
63 "Ryan C. Gordon <icculus@clutteredmind.org>", 65 "Ryan C. Gordon <icculus@clutteredmind.org>",
64 "http://www.icculus.org/SDL_sound/" 66 "http://www.icculus.org/SDL_sound/"
65 }, 67 },
66 68
67 VOC_open, /* open() method */ 69 VOC_init, /* init() method */
68 VOC_close, /* close() method */ 70 VOC_quit, /* quit() method */
69 VOC_read /* read() method */ 71 VOC_open, /* open() method */
72 VOC_close, /* close() method */
73 VOC_read /* read() method */
70 }; 74 };
71 75
72 76
73 /* Private data for VOC file */ 77 /* Private data for VOC file */
74 typedef struct vocstuff { 78 typedef struct vocstuff {
115 #define VOC_LOOPEND 7 119 #define VOC_LOOPEND 7
116 #define VOC_EXTENDED 8 120 #define VOC_EXTENDED 8
117 #define VOC_DATA_16 9 121 #define VOC_DATA_16 9
118 122
119 123
124 static int VOC_init(void)
125 {
126 return(1); /* always succeeds. */
127 } /* VOC_init */
128
129
130 static void VOC_quit(void)
131 {
132 /* it's a no-op. */
133 } /* VOC_quit */
134
135
120 static __inline__ int voc_check_header(SDL_RWops *src) 136 static __inline__ int voc_check_header(SDL_RWops *src)
121 { 137 {
122 /* VOC magic header */ 138 /* VOC magic header */
123 Uint8 signature[20]; /* "Creative Voice File\032" */ 139 Uint8 signature[20]; /* "Creative Voice File\032" */
124 Uint16 datablockofs; 140 Uint16 datablockofs;