comparison SDL_sound.h @ 1:508aac690b19

Whoops...changed some overlooked "voice" to "sound".
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 17 Sep 2001 07:07:51 +0000
parents 1078b3528e6f
children fd6cd0e04e6f
comparison
equal deleted inserted replaced
0:1078b3528e6f 1:508aac690b19
39 * - .MID (MIDI music converted to Waveform data, via Timidity.) 39 * - .MID (MIDI music converted to Waveform data, via Timidity.)
40 * - .MOD (MOD files, via MikMod.) 40 * - .MOD (MOD files, via MikMod.)
41 * - .OGG (Ogg files, via Ogg Vorbis libraries.) 41 * - .OGG (Ogg files, via Ogg Vorbis libraries.)
42 * - .RAWDATA (Raw sound data in any format, internal.) 42 * - .RAWDATA (Raw sound data in any format, internal.)
43 * - .CDA (CD audio read into a sound buffer, internal.) 43 * - .CDA (CD audio read into a sound buffer, internal.)
44 * - .AU
45 * - .AIFF
44 * 46 *
45 * (...and more to come...) 47 * (...and more to come...)
46 * 48 *
47 * Please see the file LICENSE in the source's root directory. 49 * Please see the file LICENSE in the source's root directory.
48 * 50 *
49 * This file written by Ryan C. Gordon. (icculus@clutteredmind.org) 51 * This file written by Ryan C. Gordon. (icculus@clutteredmind.org)
50 */ 52 */
51 53
52 #ifndef _INCLUDE_SDL_VOICE_H_ 54 #ifndef _INCLUDE_SDL_SOUND_H_
53 #define _INCLUDE_SDL_VOICE_H_ 55 #define _INCLUDE_SDL_SOUND_H_
54 56
55 #include "SDL.h" 57 #include "SDL.h"
56 58
57 #ifdef __cplusplus 59 #ifdef __cplusplus
58 extern "C" { 60 extern "C" {
60 62
61 /* 63 /*
62 * These are flags that are used in a Sound_Sample (below) to show various 64 * These are flags that are used in a Sound_Sample (below) to show various
63 * states. 65 * states.
64 * 66 *
65 * To use: "if (sample->flags & VOICE_SAMPLEFLAGS_ERROR) { dosomething(); }" 67 * To use: "if (sample->flags & SOUND_SAMPLEFLAGS_ERROR) { dosomething(); }"
66 */ 68 */
67 typedef enum __VOICE_SAMPLEFLAGS__ 69 typedef enum __SOUND_SAMPLEFLAGS__
68 { 70 {
69 VOICE_SAMPLEFLAG_NONE = 0, /* Null flag. */ 71 SOUND_SAMPLEFLAG_NONE = 0, /* Null flag. */
70 72
71 /* these are set at sample creation time... */ 73 /* these are set at sample creation time... */
72 VOICE_SAMPLEFLAG_NEEDSEEK = 1, /* SDL_RWops must be able to seek. */ 74 SOUND_SAMPLEFLAG_NEEDSEEK = 1, /* SDL_RWops must be able to seek. */
73 VOICE_SAMPLEFLAG_STREAMING = 1 << 1, /* source is streaming (no EOF). */ 75 SOUND_SAMPLEFLAG_STREAMING = 1 << 1, /* source is streaming (no EOF). */
74 76
75 /* these are set during decoding... */ 77 /* these are set during decoding... */
76 VOICE_SAMPLEFLAG_EOF = 1 << 29, /* end of input stream. */ 78 SOUND_SAMPLEFLAG_EOF = 1 << 29, /* end of input stream. */
77 VOICE_SAMPLEFLAG_ERROR = 1 << 30, /* unrecoverable error. */ 79 SOUND_SAMPLEFLAG_ERROR = 1 << 30, /* unrecoverable error. */
78 VOICE_SAMPLEFLAG_AGAIN = 1 << 31 /* couldn't read without blocking. */ 80 SOUND_SAMPLEFLAG_AGAIN = 1 << 31 /* couldn't read without blocking. */
79 } Sound_SampleFlags; 81 } Sound_SampleFlags;
80 82
81 83
82 /* 84 /*
83 * The Sound_Sample structure is the heart of SDL_sound. This holds 85 * The Sound_Sample structure is the heart of SDL_sound. This holds
84 * information about a source of sound data as it is being decoded. 86 * information about a source of sound data as it is being decoded.
85 * EVERY FIELD IN THIS IS READ-ONLY. Please use the API functions to 87 * EVERY FIELD IN THIS IS READ-ONLY. Please use the API functions to
86 * change them. 88 * change them.
87 */ 89 */
88 typedef struct __VOICE_SAMPLE__ 90 typedef struct __SOUND_SAMPLE__
89 { 91 {
90 void *opaque; /* Internal use only. */ 92 void *opaque; /* Internal use only. */
91 Sound_DecoderInfo *decoder; /* Decoder used for this sample. */ 93 Sound_DecoderInfo *decoder; /* Decoder used for this sample. */
92 SDL_AudioSpec desired; /* Desired audio format for conversion. */ 94 SDL_AudioSpec desired; /* Desired audio format for conversion. */
93 SDL_AudioSpec actual; /* Actual audio format of sample. */ 95 SDL_AudioSpec actual; /* Actual audio format of sample. */
111 113
112 114
113 /* 115 /*
114 * Just what it says: a x.y.z style version number... 116 * Just what it says: a x.y.z style version number...
115 */ 117 */
116 typedef struct __VOICE_VERSION__ 118 typedef struct __SOUND_VERSION__
117 { 119 {
118 int major; 120 int major;
119 int minor; 121 int minor;
120 int patch; 122 int patch;
121 } Sound_Version; 123 } Sound_Version;
122 124
123 125
124 126
125 /* functions and macros... */ 127 /* functions and macros... */
126 128
127 #define VOICE_VER_MAJOR 0 129 #define SOUND_VER_MAJOR 0
128 #define VOICE_VER_MINOR 0 130 #define SOUND_VER_MINOR 0
129 #define VOICE_VER_PATCH 1 131 #define SOUND_VER_PATCH 1
130 132
131 #define VOICE_VERSION(x) { \ 133 #define SOUND_VERSION(x) { \
132 (x)->major = VOICE_VER_MAJOR; \ 134 (x)->major = SOUND_VER_MAJOR; \
133 (x)->minor = VOICE_VER_MINOR; \ 135 (x)->minor = SOUND_VER_MINOR; \
134 (x)->patch = VOICE_VER_PATCH; \ 136 (x)->patch = SOUND_VER_PATCH; \
135 } 137 }
136 138
137 /** 139 /**
138 * Get the version of SDL_sound that is linked against your program. If you 140 * Get the version of SDL_sound that is linked against your program. If you
139 * are using a shared library (DLL) version of SDL_sound, then it is possible 141 * are using a shared library (DLL) version of SDL_sound, then it is possible
140 * that it will be different than the version you compiled against. 142 * that it will be different than the version you compiled against.
141 * 143 *
142 * This is a real function; the macro VOICE_VERSION tells you what version 144 * This is a real function; the macro SOUND_VERSION tells you what version
143 * of SDL_sound you compiled against: 145 * of SDL_sound you compiled against:
144 * 146 *
145 * Sound_Version compiled; 147 * Sound_Version compiled;
146 * Sound_Version linked; 148 * Sound_Version linked;
147 * 149 *
148 * VOICE_VERSION(&compiled); 150 * SOUND_VERSION(&compiled);
149 * Sound_GetLinkedVersion(&linked); 151 * Sound_GetLinkedVersion(&linked);
150 * printf("We compiled against SDL_sound version %d.%d.%d ...\n", 152 * printf("We compiled against SDL_sound version %d.%d.%d ...\n",
151 * compiled.major, compiled.minor, compiled.patch); 153 * compiled.major, compiled.minor, compiled.patch);
152 * printf("But we linked against SDL_sound version %d.%d.%d.\n", 154 * printf("But we linked against SDL_sound version %d.%d.%d.\n",
153 * linked.major, linked.minor, linked.patch); 155 * linked.major, linked.minor, linked.patch);
329 331
330 #ifdef __cplusplus 332 #ifdef __cplusplus
331 } 333 }
332 #endif 334 #endif
333 335
334 #endif /* !defined _INCLUDE_SDL_VOICE_H_ */ 336 #endif /* !defined _INCLUDE_SDL_SOUND_H_ */
335 337
336 /* end of SDL_sound.h ... */ 338 /* end of SDL_sound.h ... */
337 339