1 /*
2  * Copyright (c) 2007-2009 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy of
5  * this software and /or associated documentation files (the "Materials "), to
6  * deal in the Materials without restriction, including without limitation the
7  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8  * sell copies of the Materials, and to permit persons to whom the Materials are
9  * furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Materials.
14  *
15  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE
21  * MATERIALS.
22  *
23  * OpenSLES.h - OpenSL ES version 1.0.1
24  *
25  */
26 
27 /****************************************************************************/
28 /* NOTE: This file is a standard OpenSL ES header file and should not be    */
29 /* modified in any way.                                                     */
30 /****************************************************************************/
31 
32 #ifndef OPENSL_ES_H_
33 #define OPENSL_ES_H_
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #include "OpenSLES_Platform.h"
40 
41 
42 /*****************************************************************************/
43 /* Common types, structures, and defines                                */
44 /*****************************************************************************/
45 
46 #ifndef _KHRONOS_KEYS_
47 #define _KHRONOS_KEYS_
48 
49 #define KHRONOS_TITLE "KhronosTitle"
50 #define KHRONOS_ALBUM "KhronosAlbum"
51 #define KHRONOS_TRACK_NUMBER "KhronosTrackNumber"
52 #define KHRONOS_ARTIST "KhronosArtist"
53 #define KHRONOS_GENRE "KhronosGenre"
54 #define KHRONOS_YEAR "KhronosYear"
55 #define KHRONOS_COMMENT "KhronosComment"
56 #define KHRONOS_ARTIST_URL "KhronosArtistURL"
57 #define KHRONOS_CONTENT_URL "KhronosContentURL"
58 #define KHRONOS_RATING "KhronosRating"
59 #define KHRONOS_ALBUM_ART "KhronosAlbumArt"
60 #define KHRONOS_COPYRIGHT "KhronosCopyright"
61 
62 #endif
63 
64 
65 /* remap common types to SL types for clarity */
66 typedef sl_int8_t              SLint8;          /* 8 bit signed integer  */
67 typedef sl_uint8_t             SLuint8;         /* 8 bit unsigned integer */
68 typedef sl_int16_t             SLint16;         /* 16 bit signed integer */
69 typedef sl_uint16_t            SLuint16;        /* 16 bit unsigned integer */
70 typedef sl_int32_t             SLint32;           /* 32 bit signed integer */
71 typedef sl_uint32_t            SLuint32;          /* 32 bit unsigned integer */
72 
73 typedef SLuint32                    SLboolean;
74 #define SL_BOOLEAN_FALSE            ((SLboolean) 0x00000000)
75 #define SL_BOOLEAN_TRUE             ((SLboolean) 0x00000001)
76 
77 typedef SLuint8						SLchar;			/* UTF-8 is to be used */
78 typedef SLint16						SLmillibel;
79 typedef SLuint32					SLmillisecond;
80 typedef SLuint32					SLmilliHertz;
81 typedef SLint32						SLmillimeter;
82 typedef SLint32						SLmillidegree;
83 typedef SLint16						SLpermille;
84 typedef SLuint32					SLmicrosecond;
85 typedef SLuint32					SLresult;
86 
87 #define SL_MILLIBEL_MAX 	((SLmillibel) 0x7FFF)
88 #define SL_MILLIBEL_MIN 	((SLmillibel) (-SL_MILLIBEL_MAX-1))
89 
90 #define SL_MILLIHERTZ_MAX	((SLmilliHertz) 0xFFFFFFFF)
91 #define SL_MILLIMETER_MAX	((SLmillimeter) 0x7FFFFFFF)
92 
93 /** Interface ID defined as a UUID */
94 typedef const struct SLInterfaceID_ {
95     SLuint32 time_low;
96     SLuint16 time_mid;
97     SLuint16 time_hi_and_version;
98     SLuint16 clock_seq;
99     SLuint8  node[6];
100 } * SLInterfaceID;
101 
102 /* Forward declaration for the object interface */
103 struct SLObjectItf_;
104 
105 typedef const struct SLObjectItf_ * const * SLObjectItf;
106 
107 /* Objects ID's */
108 
109 #define SL_OBJECTID_ENGINE			((SLuint32) 0x00001001)
110 #define SL_OBJECTID_LEDDEVICE		((SLuint32) 0x00001002)
111 #define SL_OBJECTID_VIBRADEVICE		((SLuint32) 0x00001003)
112 #define SL_OBJECTID_AUDIOPLAYER		((SLuint32) 0x00001004)
113 #define SL_OBJECTID_AUDIORECORDER	((SLuint32) 0x00001005)
114 #define SL_OBJECTID_MIDIPLAYER		((SLuint32) 0x00001006)
115 #define SL_OBJECTID_LISTENER		((SLuint32) 0x00001007)
116 #define SL_OBJECTID_3DGROUP			((SLuint32) 0x00001008)
117 #define SL_OBJECTID_OUTPUTMIX		((SLuint32) 0x00001009)
118 #define SL_OBJECTID_METADATAEXTRACTOR	((SLuint32) 0x0000100A)
119 
120 
121 /* SL Profiles */
122 
123 #define SL_PROFILES_PHONE	((SLuint16) 0x0001)
124 #define SL_PROFILES_MUSIC	((SLuint16) 0x0002)
125 #define SL_PROFILES_GAME	((SLuint16) 0x0004)
126 
127 /* Types of voices supported by the system */
128 
129 #define SL_VOICETYPE_2D_AUDIO		((SLuint16) 0x0001)
130 #define SL_VOICETYPE_MIDI			((SLuint16) 0x0002)
131 #define SL_VOICETYPE_3D_AUDIO 		((SLuint16) 0x0004)
132 #define SL_VOICETYPE_3D_MIDIOUTPUT 	((SLuint16) 0x0008)
133 
134 /* Convenient macros representing various different priority levels, for use with the SetPriority method */
135 
136 #define SL_PRIORITY_LOWEST		((SLint32) (-0x7FFFFFFF-1))
137 #define SL_PRIORITY_VERYLOW		((SLint32) -0x60000000)
138 #define SL_PRIORITY_LOW			((SLint32) -0x40000000)
139 #define SL_PRIORITY_BELOWNORMAL	((SLint32) -0x20000000)
140 #define SL_PRIORITY_NORMAL		((SLint32) 0x00000000)
141 #define SL_PRIORITY_ABOVENORMAL	((SLint32) 0x20000000)
142 #define SL_PRIORITY_HIGH		((SLint32) 0x40000000)
143 #define SL_PRIORITY_VERYHIGH	((SLint32) 0x60000000)
144 #define SL_PRIORITY_HIGHEST	((SLint32) 0x7FFFFFFF)
145 
146 
147 /** These macros list the various sample formats that are possible on audio input and output devices. */
148 
149 #define SL_PCMSAMPLEFORMAT_FIXED_8	((SLuint16) 0x0008)
150 #define SL_PCMSAMPLEFORMAT_FIXED_16	((SLuint16) 0x0010)
151 #define SL_PCMSAMPLEFORMAT_FIXED_20 	((SLuint16) 0x0014)
152 #define SL_PCMSAMPLEFORMAT_FIXED_24	((SLuint16) 0x0018)
153 #define SL_PCMSAMPLEFORMAT_FIXED_28 	((SLuint16) 0x001C)
154 #define SL_PCMSAMPLEFORMAT_FIXED_32	((SLuint16) 0x0020)
155 
156 
157 /** These macros specify the commonly used sampling rates (in milliHertz) supported by most audio I/O devices. */
158 
159 #define SL_SAMPLINGRATE_8		((SLuint32) 8000000)
160 #define SL_SAMPLINGRATE_11_025	((SLuint32) 11025000)
161 #define SL_SAMPLINGRATE_12		((SLuint32) 12000000)
162 #define SL_SAMPLINGRATE_16		((SLuint32) 16000000)
163 #define SL_SAMPLINGRATE_22_05	((SLuint32) 22050000)
164 #define SL_SAMPLINGRATE_24		((SLuint32) 24000000)
165 #define SL_SAMPLINGRATE_32		((SLuint32) 32000000)
166 #define SL_SAMPLINGRATE_44_1	((SLuint32) 44100000)
167 #define SL_SAMPLINGRATE_48		((SLuint32) 48000000)
168 #define SL_SAMPLINGRATE_64		((SLuint32) 64000000)
169 #define SL_SAMPLINGRATE_88_2	((SLuint32) 88200000)
170 #define SL_SAMPLINGRATE_96		((SLuint32) 96000000)
171 #define SL_SAMPLINGRATE_192	((SLuint32) 192000000)
172 
173 #define SL_SPEAKER_FRONT_LEFT			((SLuint32) 0x00000001)
174 #define SL_SPEAKER_FRONT_RIGHT			((SLuint32) 0x00000002)
175 #define SL_SPEAKER_FRONT_CENTER			((SLuint32) 0x00000004)
176 #define SL_SPEAKER_LOW_FREQUENCY			((SLuint32) 0x00000008)
177 #define SL_SPEAKER_BACK_LEFT			((SLuint32) 0x00000010)
178 #define SL_SPEAKER_BACK_RIGHT			((SLuint32) 0x00000020)
179 #define SL_SPEAKER_FRONT_LEFT_OF_CENTER	((SLuint32) 0x00000040)
180 #define SL_SPEAKER_FRONT_RIGHT_OF_CENTER	((SLuint32) 0x00000080)
181 #define SL_SPEAKER_BACK_CENTER			((SLuint32) 0x00000100)
182 #define SL_SPEAKER_SIDE_LEFT			((SLuint32) 0x00000200)
183 #define SL_SPEAKER_SIDE_RIGHT			((SLuint32) 0x00000400)
184 #define SL_SPEAKER_TOP_CENTER			((SLuint32) 0x00000800)
185 #define SL_SPEAKER_TOP_FRONT_LEFT		((SLuint32) 0x00001000)
186 #define SL_SPEAKER_TOP_FRONT_CENTER		((SLuint32) 0x00002000)
187 #define SL_SPEAKER_TOP_FRONT_RIGHT		((SLuint32) 0x00004000)
188 #define SL_SPEAKER_TOP_BACK_LEFT			((SLuint32) 0x00008000)
189 #define SL_SPEAKER_TOP_BACK_CENTER		((SLuint32) 0x00010000)
190 #define SL_SPEAKER_TOP_BACK_RIGHT		((SLuint32) 0x00020000)
191 
192 
193 /*****************************************************************************/
194 /* Errors                                                                    */
195 /*                                                                           */
196 /*****************************************************************************/
197 
198 #define SL_RESULT_SUCCESS				((SLuint32) 0x00000000)
199 #define SL_RESULT_PRECONDITIONS_VIOLATED	((SLuint32) 0x00000001)
200 #define SL_RESULT_PARAMETER_INVALID		((SLuint32) 0x00000002)
201 #define SL_RESULT_MEMORY_FAILURE			((SLuint32) 0x00000003)
202 #define SL_RESULT_RESOURCE_ERROR			((SLuint32) 0x00000004)
203 #define SL_RESULT_RESOURCE_LOST			((SLuint32) 0x00000005)
204 #define SL_RESULT_IO_ERROR				((SLuint32) 0x00000006)
205 #define SL_RESULT_BUFFER_INSUFFICIENT		((SLuint32) 0x00000007)
206 #define SL_RESULT_CONTENT_CORRUPTED		((SLuint32) 0x00000008)
207 #define SL_RESULT_CONTENT_UNSUPPORTED		((SLuint32) 0x00000009)
208 #define SL_RESULT_CONTENT_NOT_FOUND		((SLuint32) 0x0000000A)
209 #define SL_RESULT_PERMISSION_DENIED		((SLuint32) 0x0000000B)
210 #define SL_RESULT_FEATURE_UNSUPPORTED		((SLuint32) 0x0000000C)
211 #define SL_RESULT_INTERNAL_ERROR			((SLuint32) 0x0000000D)
212 #define SL_RESULT_UNKNOWN_ERROR			((SLuint32) 0x0000000E)
213 #define SL_RESULT_OPERATION_ABORTED		((SLuint32) 0x0000000F)
214 #define SL_RESULT_CONTROL_LOST			((SLuint32) 0x00000010)
215 
216 
217 /* Object state definitions */
218 
219 #define SL_OBJECT_STATE_UNREALIZED	((SLuint32) 0x00000001)
220 #define SL_OBJECT_STATE_REALIZED		((SLuint32) 0x00000002)
221 #define SL_OBJECT_STATE_SUSPENDED	((SLuint32) 0x00000003)
222 
223 /* Object event definitions */
224 
225 #define SL_OBJECT_EVENT_RUNTIME_ERROR			((SLuint32) 0x00000001)
226 #define SL_OBJECT_EVENT_ASYNC_TERMINATION		((SLuint32) 0x00000002)
227 #define SL_OBJECT_EVENT_RESOURCES_LOST			((SLuint32) 0x00000003)
228 #define SL_OBJECT_EVENT_RESOURCES_AVAILABLE		((SLuint32) 0x00000004)
229 #define SL_OBJECT_EVENT_ITF_CONTROL_TAKEN		((SLuint32) 0x00000005)
230 #define SL_OBJECT_EVENT_ITF_CONTROL_RETURNED		((SLuint32) 0x00000006)
231 #define SL_OBJECT_EVENT_ITF_PARAMETERS_CHANGED	((SLuint32) 0x00000007)
232 
233 
234 /*****************************************************************************/
235 /* Interface definitions                                                     */
236 /*****************************************************************************/
237 
238 /** NULL Interface */
239 
240 extern SL_API const SLInterfaceID SL_IID_NULL;
241 
242 /*---------------------------------------------------------------------------*/
243 /* Data Source and Data Sink Structures                                      */
244 /*---------------------------------------------------------------------------*/
245 
246 /** Data locator macros  */
247 #define SL_DATALOCATOR_URI			((SLuint32) 0x00000001)
248 #define SL_DATALOCATOR_ADDRESS		((SLuint32) 0x00000002)
249 #define SL_DATALOCATOR_IODEVICE		((SLuint32) 0x00000003)
250 #define SL_DATALOCATOR_OUTPUTMIX		((SLuint32) 0x00000004)
251 #define SL_DATALOCATOR_RESERVED5		((SLuint32) 0x00000005)
252 #define SL_DATALOCATOR_BUFFERQUEUE	((SLuint32) 0x00000006)
253 #define SL_DATALOCATOR_MIDIBUFFERQUEUE	((SLuint32) 0x00000007)
254 #define SL_DATALOCATOR_RESERVED8		((SLuint32) 0x00000008)
255 
256 
257 
258 /** URI-based data locator definition where locatorType must be SL_DATALOCATOR_URI*/
259 typedef struct SLDataLocator_URI_ {
260 	SLuint32 		locatorType;
261 	SLchar *		URI;
262 } SLDataLocator_URI;
263 
264 /** Address-based data locator definition where locatorType must be SL_DATALOCATOR_ADDRESS*/
265 typedef struct SLDataLocator_Address_ {
266 	SLuint32 	locatorType;
267 	void 		*pAddress;
268 	SLuint32	length;
269 } SLDataLocator_Address;
270 
271 /** IODevice-types */
272 #define SL_IODEVICE_AUDIOINPUT	((SLuint32) 0x00000001)
273 #define SL_IODEVICE_LEDARRAY	((SLuint32) 0x00000002)
274 #define SL_IODEVICE_VIBRA		((SLuint32) 0x00000003)
275 #define SL_IODEVICE_RESERVED4	((SLuint32) 0x00000004)
276 #define SL_IODEVICE_RESERVED5	((SLuint32) 0x00000005)
277 
278 /** IODevice-based data locator definition where locatorType must be SL_DATALOCATOR_IODEVICE*/
279 typedef struct SLDataLocator_IODevice_ {
280 	SLuint32	locatorType;
281 	SLuint32	deviceType;
282 	SLuint32	deviceID;
283 	SLObjectItf	device;
284 } SLDataLocator_IODevice;
285 
286 /** OutputMix-based data locator definition where locatorType must be SL_DATALOCATOR_OUTPUTMIX*/
287 typedef struct SLDataLocator_OutputMix {
288 	SLuint32 		locatorType;
289 	SLObjectItf		outputMix;
290 } SLDataLocator_OutputMix;
291 
292 
293 /** BufferQueue-based data locator definition where locatorType must be SL_DATALOCATOR_BUFFERQUEUE*/
294 typedef struct SLDataLocator_BufferQueue {
295 	SLuint32	locatorType;
296 	SLuint32	numBuffers;
297 } SLDataLocator_BufferQueue;
298 
299 /** MidiBufferQueue-based data locator definition where locatorType must be SL_DATALOCATOR_MIDIBUFFERQUEUE*/
300 typedef struct SLDataLocator_MIDIBufferQueue {
301 	SLuint32	locatorType;
302 	SLuint32	tpqn;
303 	SLuint32	numBuffers;
304 } SLDataLocator_MIDIBufferQueue;
305 
306 /** Data format defines */
307 #define SL_DATAFORMAT_MIME		((SLuint32) 0x00000001)
308 #define SL_DATAFORMAT_PCM		((SLuint32) 0x00000002)
309 #define SL_DATAFORMAT_RESERVED3	((SLuint32) 0x00000003)
310 
311 
312 /** MIME-type-based data format definition where formatType must be SL_DATAFORMAT_MIME*/
313 typedef struct SLDataFormat_MIME_ {
314 	SLuint32 		formatType;
315 	SLchar * 		mimeType;
316 	SLuint32		containerType;
317 } SLDataFormat_MIME;
318 
319 /* Byte order of a block of 16- or 32-bit data */
320 #define SL_BYTEORDER_BIGENDIAN				((SLuint32) 0x00000001)
321 #define SL_BYTEORDER_LITTLEENDIAN			((SLuint32) 0x00000002)
322 
323 /* Container type */
324 #define SL_CONTAINERTYPE_UNSPECIFIED	((SLuint32) 0x00000001)
325 #define SL_CONTAINERTYPE_RAW		((SLuint32) 0x00000002)
326 #define SL_CONTAINERTYPE_ASF		((SLuint32) 0x00000003)
327 #define SL_CONTAINERTYPE_AVI		((SLuint32) 0x00000004)
328 #define SL_CONTAINERTYPE_BMP		((SLuint32) 0x00000005)
329 #define SL_CONTAINERTYPE_JPG		((SLuint32) 0x00000006)
330 #define SL_CONTAINERTYPE_JPG2000		((SLuint32) 0x00000007)
331 #define SL_CONTAINERTYPE_M4A		((SLuint32) 0x00000008)
332 #define SL_CONTAINERTYPE_MP3		((SLuint32) 0x00000009)
333 #define SL_CONTAINERTYPE_MP4		((SLuint32) 0x0000000A)
334 #define SL_CONTAINERTYPE_MPEG_ES		((SLuint32) 0x0000000B)
335 #define SL_CONTAINERTYPE_MPEG_PS		((SLuint32) 0x0000000C)
336 #define SL_CONTAINERTYPE_MPEG_TS		((SLuint32) 0x0000000D)
337 #define SL_CONTAINERTYPE_QT		((SLuint32) 0x0000000E)
338 #define SL_CONTAINERTYPE_WAV		((SLuint32) 0x0000000F)
339 #define SL_CONTAINERTYPE_XMF_0		((SLuint32) 0x00000010)
340 #define SL_CONTAINERTYPE_XMF_1		((SLuint32) 0x00000011)
341 #define SL_CONTAINERTYPE_XMF_2		((SLuint32) 0x00000012)
342 #define SL_CONTAINERTYPE_XMF_3		((SLuint32) 0x00000013)
343 #define SL_CONTAINERTYPE_XMF_GENERIC	((SLuint32) 0x00000014)
344 #define SL_CONTAINERTYPE_AMR  		((SLuint32) 0x00000015)
345 #define SL_CONTAINERTYPE_AAC		((SLuint32) 0x00000016)
346 #define SL_CONTAINERTYPE_3GPP		((SLuint32) 0x00000017)
347 #define SL_CONTAINERTYPE_3GA		((SLuint32) 0x00000018)
348 #define SL_CONTAINERTYPE_RM		((SLuint32) 0x00000019)
349 #define SL_CONTAINERTYPE_DMF		((SLuint32) 0x0000001A)
350 #define SL_CONTAINERTYPE_SMF		((SLuint32) 0x0000001B)
351 #define SL_CONTAINERTYPE_MOBILE_DLS	((SLuint32) 0x0000001C)
352 #define SL_CONTAINERTYPE_OGG	((SLuint32) 0x0000001D)
353 
354 
355 /** PCM-type-based data format definition where formatType must be SL_DATAFORMAT_PCM*/
356 typedef struct SLDataFormat_PCM_ {
357 	SLuint32 		formatType;
358 	SLuint32 		numChannels;
359 	SLuint32 		samplesPerSec;
360 	SLuint32 		bitsPerSample;
361 	SLuint32 		containerSize;
362 	SLuint32 		channelMask;
363 	SLuint32		endianness;
364 } SLDataFormat_PCM;
365 
366 typedef struct SLDataSource_ {
367 	void *pLocator;
368 	void *pFormat;
369 } SLDataSource;
370 
371 
372 typedef struct SLDataSink_ {
373 	void *pLocator;
374 	void *pFormat;
375 } SLDataSink;
376 
377 
378 
379 
380 
381 
382 /*---------------------------------------------------------------------------*/
383 /* Standard Object Interface                                                 */
384 /*---------------------------------------------------------------------------*/
385 
386 extern SL_API const SLInterfaceID SL_IID_OBJECT;
387 
388 /** Object callback */
389 
390 
391 typedef void (SLAPIENTRY *slObjectCallback) (
392 	SLObjectItf caller,
393 	const void * pContext,
394 	SLuint32 event,
395 	SLresult result,
396     SLuint32 param,
397     void *pInterface
398 );
399 
400 
401 struct SLObjectItf_ {
402 	SLresult (*Realize) (
403 		SLObjectItf self,
404 		SLboolean async
405 	);
406 	SLresult (*Resume) (
407 		SLObjectItf self,
408 		SLboolean async
409 	);
410 	SLresult (*GetState) (
411 		SLObjectItf self,
412 		SLuint32 * pState
413 	);
414 	SLresult (*GetInterface) (
415 		SLObjectItf self,
416 		const SLInterfaceID iid,
417 		void * pInterface
418 	);
419 	SLresult (*RegisterCallback) (
420 		SLObjectItf self,
421 		slObjectCallback callback,
422 		void * pContext
423 	);
424 	void (*AbortAsyncOperation) (
425 		SLObjectItf self
426 	);
427 	void (*Destroy) (
428 		SLObjectItf self
429 	);
430 	SLresult (*SetPriority) (
431 		SLObjectItf self,
432 		SLint32 priority,
433 		SLboolean preemptable
434 	);
435 	SLresult (*GetPriority) (
436 		SLObjectItf self,
437 		SLint32 *pPriority,
438 		SLboolean *pPreemptable
439 	);
440 	SLresult (*SetLossOfControlInterfaces) (
441 		SLObjectItf self,
442 		SLint16 numInterfaces,
443 		SLInterfaceID * pInterfaceIDs,
444 		SLboolean enabled
445 	);
446 };
447 
448 
449 /*---------------------------------------------------------------------------*/
450 /* Audio IO Device capabilities interface                                    */
451 /*---------------------------------------------------------------------------*/
452 
453 #define SL_DEFAULTDEVICEID_AUDIOINPUT 	((SLuint32) 0xFFFFFFFF)
454 #define SL_DEFAULTDEVICEID_AUDIOOUTPUT 	((SLuint32) 0xFFFFFFFE)
455 #define SL_DEFAULTDEVICEID_LED          ((SLuint32) 0xFFFFFFFD)
456 #define SL_DEFAULTDEVICEID_VIBRA        ((SLuint32) 0xFFFFFFFC)
457 #define SL_DEFAULTDEVICEID_RESERVED1    ((SLuint32) 0xFFFFFFFB)
458 
459 
460 #define SL_DEVCONNECTION_INTEGRATED         ((SLint16) 0x0001)
461 #define SL_DEVCONNECTION_ATTACHED_WIRED     ((SLint16) 0x0100)
462 #define SL_DEVCONNECTION_ATTACHED_WIRELESS  ((SLint16) 0x0200)
463 #define SL_DEVCONNECTION_NETWORK 		    ((SLint16) 0x0400)
464 
465 
466 #define SL_DEVLOCATION_HANDSET 	((SLuint16) 0x0001)
467 #define SL_DEVLOCATION_HEADSET 	((SLuint16) 0x0002)
468 #define SL_DEVLOCATION_CARKIT 	((SLuint16) 0x0003)
469 #define SL_DEVLOCATION_DOCK 	((SLuint16) 0x0004)
470 #define SL_DEVLOCATION_REMOTE 	((SLuint16) 0x0005)
471 /* Note: SL_DEVLOCATION_RESLTE is deprecated, use SL_DEVLOCATION_REMOTE instead. */
472 #define SL_DEVLOCATION_RESLTE 	((SLuint16) 0x0005)
473 
474 
475 #define SL_DEVSCOPE_UNKNOWN     ((SLuint16) 0x0001)
476 #define SL_DEVSCOPE_ENVIRONMENT ((SLuint16) 0x0002)
477 #define SL_DEVSCOPE_USER        ((SLuint16) 0x0003)
478 
479 
480 typedef struct SLAudioInputDescriptor_ {
481 	SLchar *deviceName;
482 	SLint16 deviceConnection;
483 	SLint16 deviceScope;
484 	SLint16 deviceLocation;
485 	SLboolean isForTelephony;
486 	SLmilliHertz minSampleRate;
487 	SLmilliHertz maxSampleRate;
488 	SLboolean isFreqRangeContinuous;
489 	SLmilliHertz *samplingRatesSupported;
490 	SLint16 numOfSamplingRatesSupported;
491 	SLint16 maxChannels;
492 } SLAudioInputDescriptor;
493 
494 
495 typedef struct SLAudioOutputDescriptor_ {
496 	SLchar *pDeviceName;
497 	SLint16 deviceConnection;
498 	SLint16 deviceScope;
499 	SLint16 deviceLocation;
500 	SLboolean isForTelephony;
501 	SLmilliHertz minSampleRate;
502 	SLmilliHertz maxSampleRate;
503 	SLboolean isFreqRangeContinuous;
504 	SLmilliHertz *samplingRatesSupported;
505 	SLint16 numOfSamplingRatesSupported;
506 	SLint16 maxChannels;
507 } SLAudioOutputDescriptor;
508 
509 
510 
511 extern SL_API const SLInterfaceID SL_IID_AUDIOIODEVICECAPABILITIES;
512 
513 struct SLAudioIODeviceCapabilitiesItf_;
514 typedef const struct SLAudioIODeviceCapabilitiesItf_ * const * SLAudioIODeviceCapabilitiesItf;
515 
516 
517 typedef void (SLAPIENTRY *slAvailableAudioInputsChangedCallback) (
518 	SLAudioIODeviceCapabilitiesItf caller,
519 	void *pContext,
520 	SLuint32 deviceID,
521 	SLint32 numInputs,
522 	SLboolean isNew
523 );
524 
525 
526 typedef void (SLAPIENTRY *slAvailableAudioOutputsChangedCallback) (
527 	SLAudioIODeviceCapabilitiesItf caller,
528 	void *pContext,
529 	SLuint32 deviceID,
530 	SLint32 numOutputs,
531 	SLboolean isNew
532 );
533 
534 typedef void (SLAPIENTRY *slDefaultDeviceIDMapChangedCallback) (
535 	SLAudioIODeviceCapabilitiesItf caller,
536 	void *pContext,
537 	SLboolean isOutput,
538 	SLint32 numDevices
539 );
540 
541 
542 struct SLAudioIODeviceCapabilitiesItf_ {
543 	SLresult (*GetAvailableAudioInputs)(
544 		SLAudioIODeviceCapabilitiesItf self,
545 		SLint32  *pNumInputs,
546 		SLuint32 *pInputDeviceIDs
547 	);
548 	SLresult (*QueryAudioInputCapabilities)(
549 		SLAudioIODeviceCapabilitiesItf self,
550 		SLuint32 deviceId,
551 		SLAudioInputDescriptor *pDescriptor
552 	);
553 	SLresult (*RegisterAvailableAudioInputsChangedCallback) (
554 		SLAudioIODeviceCapabilitiesItf self,
555 		slAvailableAudioInputsChangedCallback callback,
556 		void *pContext
557 	);
558 	SLresult (*GetAvailableAudioOutputs)(
559 		SLAudioIODeviceCapabilitiesItf self,
560 		SLint32 *pNumOutputs,
561 		SLuint32 *pOutputDeviceIDs
562 	);
563 	SLresult (*QueryAudioOutputCapabilities)(
564 		SLAudioIODeviceCapabilitiesItf self,
565 		SLuint32 deviceId,
566 		SLAudioOutputDescriptor *pDescriptor
567 	);
568 	SLresult (*RegisterAvailableAudioOutputsChangedCallback) (
569 		SLAudioIODeviceCapabilitiesItf self,
570 		slAvailableAudioOutputsChangedCallback callback,
571 		void *pContext
572 	);
573 	SLresult (*RegisterDefaultDeviceIDMapChangedCallback) (
574 		SLAudioIODeviceCapabilitiesItf self,
575 		slDefaultDeviceIDMapChangedCallback callback,
576 		void *pContext
577 	);
578 	SLresult (*GetAssociatedAudioInputs) (
579 		SLAudioIODeviceCapabilitiesItf self,
580 		SLuint32 deviceId,
581 		SLint32 *pNumAudioInputs,
582 		SLuint32 *pAudioInputDeviceIDs
583 	);
584 	SLresult (*GetAssociatedAudioOutputs) (
585 		SLAudioIODeviceCapabilitiesItf self,
586 		SLuint32 deviceId,
587 		SLint32 *pNumAudioOutputs,
588 		SLuint32 *pAudioOutputDeviceIDs
589 	);
590 	SLresult (*GetDefaultAudioDevices) (
591 		SLAudioIODeviceCapabilitiesItf self,
592 		SLuint32 defaultDeviceID,
593 		SLint32 *pNumAudioDevices,
594 		SLuint32 *pAudioDeviceIDs
595 	);
596 	SLresult (*QuerySampleFormatsSupported)(
597 		SLAudioIODeviceCapabilitiesItf self,
598 		SLuint32 deviceId,
599 		SLmilliHertz samplingRate,
600 		SLint32 *pSampleFormats,
601 		SLint32 *pNumOfSampleFormats
602 	);
603 };
604 
605 
606 
607 /*---------------------------------------------------------------------------*/
608 /* Capabilities of the LED array IODevice                                    */
609 /*---------------------------------------------------------------------------*/
610 
611 typedef struct SLLEDDescriptor_ {
612 	SLuint8   ledCount;
613 	SLuint8   primaryLED;
614 	SLuint32  colorMask;
615 } SLLEDDescriptor;
616 
617 
618 /*---------------------------------------------------------------------------*/
619 /* LED Array interface                                                       */
620 /*---------------------------------------------------------------------------*/
621 
622 typedef struct SLHSL_ {
623     SLmillidegree  hue;
624     SLpermille     saturation;
625     SLpermille     lightness;
626 } SLHSL;
627 
628 
629 extern SL_API const SLInterfaceID SL_IID_LED;
630 
631 struct SLLEDArrayItf_;
632 typedef const struct SLLEDArrayItf_ * const * SLLEDArrayItf;
633 
634 struct SLLEDArrayItf_ {
635 	SLresult (*ActivateLEDArray) (
636 		SLLEDArrayItf self,
637 		SLuint32 lightMask
638 	);
639 	SLresult (*IsLEDArrayActivated) (
640 		SLLEDArrayItf self,
641 		SLuint32 *lightMask
642 	);
643 	SLresult (*SetColor) (
644 		SLLEDArrayItf self,
645 		SLuint8 index,
646 		const SLHSL *color
647 	);
648 	SLresult (*GetColor) (
649 		SLLEDArrayItf self,
650 		SLuint8 index,
651 		SLHSL *color
652 	);
653 };
654 
655 /*---------------------------------------------------------------------------*/
656 /* Capabilities of the Vibra IODevice                                        */
657 /*---------------------------------------------------------------------------*/
658 
659 typedef struct SLVibraDescriptor_ {
660 	SLboolean supportsFrequency;
661 	SLboolean supportsIntensity;
662 	SLmilliHertz  minFrequency;
663 	SLmilliHertz  maxFrequency;
664 } SLVibraDescriptor;
665 
666 
667 
668 /*---------------------------------------------------------------------------*/
669 /* Vibra interface                                                           */
670 /*---------------------------------------------------------------------------*/
671 
672 
673 extern SL_API const SLInterfaceID SL_IID_VIBRA;
674 
675 
676 struct SLVibraItf_;
677 typedef const struct SLVibraItf_ * const * SLVibraItf;
678 
679 struct SLVibraItf_ {
680 	SLresult (*Vibrate) (
681 		SLVibraItf self,
682 		SLboolean vibrate
683 	);
684 	SLresult (*IsVibrating) (
685 		SLVibraItf self,
686 		SLboolean *pVibrating
687 	);
688 	SLresult (*SetFrequency) (
689 		SLVibraItf self,
690 		SLmilliHertz frequency
691 	);
692 	SLresult (*GetFrequency) (
693 		SLVibraItf self,
694 		SLmilliHertz *pFrequency
695 	);
696 	SLresult (*SetIntensity) (
697 		SLVibraItf self,
698 		SLpermille intensity
699 	);
700 	SLresult (*GetIntensity) (
701 		SLVibraItf self,
702 		SLpermille *pIntensity
703 	);
704 };
705 
706 
707 /*---------------------------------------------------------------------------*/
708 /* Meta data extraction related types and interface                          */
709 /*---------------------------------------------------------------------------*/
710 
711 #define SL_CHARACTERENCODING_UNKNOWN			((SLuint32) 0x00000000)
712 #define SL_CHARACTERENCODING_BINARY       ((SLuint32) 0x00000001)
713 #define SL_CHARACTERENCODING_ASCII        ((SLuint32) 0x00000002)
714 #define SL_CHARACTERENCODING_BIG5         ((SLuint32) 0x00000003)
715 #define SL_CHARACTERENCODING_CODEPAGE1252		((SLuint32) 0x00000004)
716 #define SL_CHARACTERENCODING_GB2312			((SLuint32) 0x00000005)
717 #define SL_CHARACTERENCODING_HZGB2312			((SLuint32) 0x00000006)
718 #define SL_CHARACTERENCODING_GB12345			((SLuint32) 0x00000007)
719 #define SL_CHARACTERENCODING_GB18030			((SLuint32) 0x00000008)
720 #define SL_CHARACTERENCODING_GBK				((SLuint32) 0x00000009)
721 #define SL_CHARACTERENCODING_IMAPUTF7			((SLuint32) 0x0000000A)
722 #define SL_CHARACTERENCODING_ISO2022JP			((SLuint32) 0x0000000B)
723 #define SL_CHARACTERENCODING_ISO2022JP1		((SLuint32) 0x0000000B)
724 #define SL_CHARACTERENCODING_ISO88591			((SLuint32) 0x0000000C)
725 #define SL_CHARACTERENCODING_ISO885910			((SLuint32) 0x0000000D)
726 #define SL_CHARACTERENCODING_ISO885913			((SLuint32) 0x0000000E)
727 #define SL_CHARACTERENCODING_ISO885914			((SLuint32) 0x0000000F)
728 #define SL_CHARACTERENCODING_ISO885915			((SLuint32) 0x00000010)
729 #define SL_CHARACTERENCODING_ISO88592			((SLuint32) 0x00000011)
730 #define SL_CHARACTERENCODING_ISO88593			((SLuint32) 0x00000012)
731 #define SL_CHARACTERENCODING_ISO88594			((SLuint32) 0x00000013)
732 #define SL_CHARACTERENCODING_ISO88595			((SLuint32) 0x00000014)
733 #define SL_CHARACTERENCODING_ISO88596			((SLuint32) 0x00000015)
734 #define SL_CHARACTERENCODING_ISO88597			((SLuint32) 0x00000016)
735 #define SL_CHARACTERENCODING_ISO88598			((SLuint32) 0x00000017)
736 #define SL_CHARACTERENCODING_ISO88599			((SLuint32) 0x00000018)
737 #define SL_CHARACTERENCODING_ISOEUCJP			((SLuint32) 0x00000019)
738 #define SL_CHARACTERENCODING_SHIFTJIS			((SLuint32) 0x0000001A)
739 #define SL_CHARACTERENCODING_SMS7BIT			((SLuint32) 0x0000001B)
740 #define SL_CHARACTERENCODING_UTF7			((SLuint32) 0x0000001C)
741 #define SL_CHARACTERENCODING_UTF8			((SLuint32) 0x0000001D)
742 #define SL_CHARACTERENCODING_JAVACONFORMANTUTF8	((SLuint32) 0x0000001E)
743 #define SL_CHARACTERENCODING_UTF16BE			((SLuint32) 0x0000001F)
744 #define SL_CHARACTERENCODING_UTF16LE			((SLuint32) 0x00000020)
745 
746 
747 #define SL_METADATA_FILTER_KEY		((SLuint8) 0x01)
748 #define SL_METADATA_FILTER_LANG		((SLuint8) 0x02)
749 #define SL_METADATA_FILTER_ENCODING	((SLuint8) 0x04)
750 
751 
752 typedef struct SLMetadataInfo_ {
753     SLuint32     size;
754     SLuint32     encoding;
755     SLchar       langCountry[16];
756     SLuint8      data[1];
757 } SLMetadataInfo;
758 
759 extern SL_API const SLInterfaceID SL_IID_METADATAEXTRACTION;
760 
761 struct SLMetadataExtractionItf_;
762 typedef const struct SLMetadataExtractionItf_ * const * SLMetadataExtractionItf;
763 
764 
765 struct SLMetadataExtractionItf_ {
766 	SLresult (*GetItemCount) (
767 		SLMetadataExtractionItf self,
768 		SLuint32 *pItemCount
769 	);
770 	SLresult (*GetKeySize) (
771 		SLMetadataExtractionItf self,
772 		SLuint32 index,
773 		SLuint32 *pKeySize
774 	);
775 	SLresult (*GetKey) (
776 		SLMetadataExtractionItf self,
777 		SLuint32 index,
778 		SLuint32 keySize,
779 		SLMetadataInfo *pKey
780 	);
781 	SLresult (*GetValueSize) (
782 		SLMetadataExtractionItf self,
783 		SLuint32 index,
784 		SLuint32 *pValueSize
785 	);
786 	SLresult (*GetValue) (
787 		SLMetadataExtractionItf self,
788 		SLuint32 index,
789 		SLuint32 valueSize,
790 		SLMetadataInfo *pValue
791 	);
792 	SLresult (*AddKeyFilter) (
793 		SLMetadataExtractionItf self,
794 		SLuint32 keySize,
795 		const void *pKey,
796 		SLuint32 keyEncoding,
797 		const SLchar *pValueLangCountry,
798 		SLuint32 valueEncoding,
799 		SLuint8 filterMask
800 	);
801 	SLresult (*ClearKeyFilter) (
802 		SLMetadataExtractionItf self
803 	);
804 };
805 
806 
807 /*---------------------------------------------------------------------------*/
808 /* Meta data traversal related types and interface                          */
809 /*---------------------------------------------------------------------------*/
810 
811 #define SL_METADATATRAVERSALMODE_ALL	((SLuint32) 0x00000001)
812 #define SL_METADATATRAVERSALMODE_NODE	((SLuint32) 0x00000002)
813 
814 
815 #define SL_NODETYPE_UNSPECIFIED	((SLuint32) 0x00000001)
816 #define SL_NODETYPE_AUDIO		((SLuint32) 0x00000002)
817 #define SL_NODETYPE_VIDEO		((SLuint32) 0x00000003)
818 #define SL_NODETYPE_IMAGE		((SLuint32) 0x00000004)
819 
820 #define SL_NODE_PARENT 0xFFFFFFFF
821 
822 extern SL_API const SLInterfaceID SL_IID_METADATATRAVERSAL;
823 
824 struct SLMetadataTraversalItf_;
825 typedef const struct SLMetadataTraversalItf_ * const * SLMetadataTraversalItf;
826 
827 struct SLMetadataTraversalItf_ {
828 	SLresult (*SetMode) (
829 		SLMetadataTraversalItf self,
830 		SLuint32 mode
831 	);
832 	SLresult (*GetChildCount) (
833 		SLMetadataTraversalItf self,
834 		SLuint32 *pCount
835 	);
836 	SLresult (*GetChildMIMETypeSize) (
837 		SLMetadataTraversalItf self,
838 		SLuint32 index,
839 		SLuint32 *pSize
840 	);
841 	SLresult (*GetChildInfo) (
842 		SLMetadataTraversalItf self,
843 		SLuint32 index,
844 		SLint32 *pNodeID,
845 		SLuint32 *pType,
846 		SLuint32 size,
847 		SLchar *pMimeType
848 	);
849 	SLresult (*SetActiveNode) (
850 		SLMetadataTraversalItf self,
851 		SLuint32 index
852 	);
853 };
854 
855 /*---------------------------------------------------------------------------*/
856 /* Dynamic Source types and interface                                        */
857 /*---------------------------------------------------------------------------*/
858 
859 extern SL_API const SLInterfaceID SL_IID_DYNAMICSOURCE;
860 
861 struct SLDynamicSourceItf_;
862 typedef const struct SLDynamicSourceItf_ * const * SLDynamicSourceItf;
863 
864 struct SLDynamicSourceItf_ {
865 	SLresult (*SetSource) (
866 		SLDynamicSourceItf self,
867 		SLDataSource *pDataSource
868 	);
869 };
870 
871 /*---------------------------------------------------------------------------*/
872 /* Output Mix interface                                                      */
873 /*---------------------------------------------------------------------------*/
874 
875 extern SL_API const SLInterfaceID SL_IID_OUTPUTMIX;
876 
877 struct SLOutputMixItf_;
878 typedef const struct SLOutputMixItf_ * const * SLOutputMixItf;
879 
880 typedef void (SLAPIENTRY *slMixDeviceChangeCallback) (
881 	SLOutputMixItf caller,
882     void *pContext
883 );
884 
885 
886 struct SLOutputMixItf_ {
887 	SLresult (*GetDestinationOutputDeviceIDs) (
888 		SLOutputMixItf self,
889 		SLint32 *pNumDevices,
890 		SLuint32 *pDeviceIDs
891 	);
892 	SLresult (*RegisterDeviceChangeCallback) (
893 		SLOutputMixItf self,
894 		slMixDeviceChangeCallback callback,
895 		void *pContext
896     );
897     SLresult (*ReRoute)(
898         SLOutputMixItf self,
899         SLint32 numOutputDevices,
900         SLuint32 *pOutputDeviceIDs
901     );
902 };
903 
904 
905 /*---------------------------------------------------------------------------*/
906 /* Playback interface                                                        */
907 /*---------------------------------------------------------------------------*/
908 
909 /** Playback states */
910 #define SL_PLAYSTATE_STOPPED	((SLuint32) 0x00000001)
911 #define SL_PLAYSTATE_PAUSED	((SLuint32) 0x00000002)
912 #define SL_PLAYSTATE_PLAYING	((SLuint32) 0x00000003)
913 
914 /** Play events **/
915 #define SL_PLAYEVENT_HEADATEND		((SLuint32) 0x00000001)
916 #define SL_PLAYEVENT_HEADATMARKER	((SLuint32) 0x00000002)
917 #define SL_PLAYEVENT_HEADATNEWPOS	((SLuint32) 0x00000004)
918 #define SL_PLAYEVENT_HEADMOVING		((SLuint32) 0x00000008)
919 #define SL_PLAYEVENT_HEADSTALLED	((SLuint32) 0x00000010)
920 
921 #define SL_TIME_UNKNOWN	((SLuint32) 0xFFFFFFFF)
922 
923 
924 extern SL_API const SLInterfaceID SL_IID_PLAY;
925 
926 /** Playback interface methods */
927 
928 struct SLPlayItf_;
929 typedef const struct SLPlayItf_ * const * SLPlayItf;
930 
931 typedef void (SLAPIENTRY *slPlayCallback) (
932 	SLPlayItf caller,
933 	void *pContext,
934 	SLuint32 event
935 );
936 
937 struct SLPlayItf_ {
938 	SLresult (*SetPlayState) (
939 		SLPlayItf self,
940 		SLuint32 state
941 	);
942 	SLresult (*GetPlayState) (
943 		SLPlayItf self,
944 		SLuint32 *pState
945 	);
946 	SLresult (*GetDuration) (
947 		SLPlayItf self,
948 		SLmillisecond *pMsec
949 	);
950 	SLresult (*GetPosition) (
951 		SLPlayItf self,
952 		SLmillisecond *pMsec
953 	);
954 	SLresult (*RegisterCallback) (
955 		SLPlayItf self,
956 		slPlayCallback callback,
957 		void *pContext
958 	);
959 	SLresult (*SetCallbackEventsMask) (
960 		SLPlayItf self,
961 		SLuint32 eventFlags
962 	);
963 	SLresult (*GetCallbackEventsMask) (
964 		SLPlayItf self,
965 		SLuint32 *pEventFlags
966 	);
967 	SLresult (*SetMarkerPosition) (
968 		SLPlayItf self,
969 		SLmillisecond mSec
970 	);
971 	SLresult (*ClearMarkerPosition) (
972 		SLPlayItf self
973 	);
974 	SLresult (*GetMarkerPosition) (
975 		SLPlayItf self,
976 		SLmillisecond *pMsec
977 	);
978 	SLresult (*SetPositionUpdatePeriod) (
979 		SLPlayItf self,
980 		SLmillisecond mSec
981 	);
982 	SLresult (*GetPositionUpdatePeriod) (
983 		SLPlayItf self,
984 		SLmillisecond *pMsec
985 	);
986 };
987 
988 /*---------------------------------------------------------------------------*/
989 /* Prefetch status interface                                                 */
990 /*---------------------------------------------------------------------------*/
991 
992 #define SL_PREFETCHEVENT_STATUSCHANGE		((SLuint32) 0x00000001)
993 #define SL_PREFETCHEVENT_FILLLEVELCHANGE	((SLuint32) 0x00000002)
994 
995 #define SL_PREFETCHSTATUS_UNDERFLOW		((SLuint32) 0x00000001)
996 #define SL_PREFETCHSTATUS_SUFFICIENTDATA	((SLuint32) 0x00000002)
997 #define SL_PREFETCHSTATUS_OVERFLOW		((SLuint32) 0x00000003)
998 
999 
1000 extern SL_API const SLInterfaceID SL_IID_PREFETCHSTATUS;
1001 
1002 
1003 /** Prefetch status interface methods */
1004 
1005 struct SLPrefetchStatusItf_;
1006 typedef const struct SLPrefetchStatusItf_ * const * SLPrefetchStatusItf;
1007 
1008 typedef void (SLAPIENTRY *slPrefetchCallback) (
1009 	SLPrefetchStatusItf caller,
1010 	void *pContext,
1011 	SLuint32 event
1012 );
1013 
1014 struct SLPrefetchStatusItf_ {
1015 	SLresult (*GetPrefetchStatus) (
1016 		SLPrefetchStatusItf self,
1017 		SLuint32 *pStatus
1018 	);
1019 	SLresult (*GetFillLevel) (
1020 		SLPrefetchStatusItf self,
1021 		SLpermille *pLevel
1022 	);
1023 	SLresult (*RegisterCallback) (
1024 		SLPrefetchStatusItf self,
1025 		slPrefetchCallback callback,
1026 		void *pContext
1027 	);
1028 	SLresult (*SetCallbackEventsMask) (
1029 		SLPrefetchStatusItf self,
1030 		SLuint32 eventFlags
1031 	);
1032 	SLresult (*GetCallbackEventsMask) (
1033 		SLPrefetchStatusItf self,
1034 		SLuint32 *pEventFlags
1035 	);
1036 	SLresult (*SetFillUpdatePeriod) (
1037 		SLPrefetchStatusItf self,
1038 		SLpermille period
1039 	);
1040 	SLresult (*GetFillUpdatePeriod) (
1041 		SLPrefetchStatusItf self,
1042 		SLpermille *pPeriod
1043 	);
1044 };
1045 
1046 /*---------------------------------------------------------------------------*/
1047 /* Playback Rate interface                                                   */
1048 /*---------------------------------------------------------------------------*/
1049 
1050 #define SL_RATEPROP_RESERVED1		  		((SLuint32) 0x00000001)
1051 #define SL_RATEPROP_RESERVED2		  		((SLuint32) 0x00000002)
1052 #define SL_RATEPROP_SILENTAUDIO				((SLuint32) 0x00000100)
1053 #define SL_RATEPROP_STAGGEREDAUDIO	((SLuint32) 0x00000200)
1054 #define SL_RATEPROP_NOPITCHCORAUDIO	((SLuint32) 0x00000400)
1055 #define SL_RATEPROP_PITCHCORAUDIO	((SLuint32) 0x00000800)
1056 
1057 
1058 extern SL_API const SLInterfaceID SL_IID_PLAYBACKRATE;
1059 
1060 struct SLPlaybackRateItf_;
1061 typedef const struct SLPlaybackRateItf_ * const * SLPlaybackRateItf;
1062 
1063 struct SLPlaybackRateItf_ {
1064 	SLresult (*SetRate)(
1065 		SLPlaybackRateItf self,
1066 		SLpermille rate
1067 	);
1068 	SLresult (*GetRate)(
1069 		SLPlaybackRateItf self,
1070 		SLpermille *pRate
1071 	);
1072 	SLresult (*SetPropertyConstraints)(
1073 		SLPlaybackRateItf self,
1074 		SLuint32 constraints
1075 	);
1076 	SLresult (*GetProperties)(
1077 		SLPlaybackRateItf self,
1078 		SLuint32 *pProperties
1079 	);
1080 	SLresult (*GetCapabilitiesOfRate)(
1081 		SLPlaybackRateItf self,
1082 		SLpermille rate,
1083 		SLuint32 *pCapabilities
1084 	);
1085 	SLresult (*GetRateRange) (
1086 		SLPlaybackRateItf self,
1087 		SLuint8 index,
1088 		SLpermille *pMinRate,
1089 		SLpermille *pMaxRate,
1090 		SLpermille *pStepSize,
1091 		SLuint32 *pCapabilities
1092 	);
1093 };
1094 
1095 /*---------------------------------------------------------------------------*/
1096 /* Seek Interface                                                            */
1097 /*---------------------------------------------------------------------------*/
1098 
1099 #define SL_SEEKMODE_FAST		((SLuint32) 0x0001)
1100 #define SL_SEEKMODE_ACCURATE	((SLuint32) 0x0002)
1101 
1102 extern SL_API const SLInterfaceID SL_IID_SEEK;
1103 
1104 struct SLSeekItf_;
1105 typedef const struct SLSeekItf_ * const * SLSeekItf;
1106 
1107 struct SLSeekItf_ {
1108 	SLresult (*SetPosition)(
1109 		SLSeekItf self,
1110 		SLmillisecond pos,
1111 		SLuint32 seekMode
1112 	);
1113 	SLresult (*SetLoop)(
1114 		SLSeekItf self,
1115 		SLboolean loopEnable,
1116 		SLmillisecond startPos,
1117 		SLmillisecond endPos
1118 	);
1119 	SLresult (*GetLoop)(
1120 		SLSeekItf self,
1121 		SLboolean *pLoopEnabled,
1122 		SLmillisecond *pStartPos,
1123 		SLmillisecond *pEndPos
1124 	);
1125 };
1126 
1127 /*---------------------------------------------------------------------------*/
1128 /* Standard Recording Interface                                              */
1129 /*---------------------------------------------------------------------------*/
1130 
1131 /** Recording states */
1132 #define SL_RECORDSTATE_STOPPED 	((SLuint32) 0x00000001)
1133 #define SL_RECORDSTATE_PAUSED	((SLuint32) 0x00000002)
1134 #define SL_RECORDSTATE_RECORDING	((SLuint32) 0x00000003)
1135 
1136 
1137 /** Record event **/
1138 #define SL_RECORDEVENT_HEADATLIMIT	((SLuint32) 0x00000001)
1139 #define SL_RECORDEVENT_HEADATMARKER	((SLuint32) 0x00000002)
1140 #define SL_RECORDEVENT_HEADATNEWPOS	((SLuint32) 0x00000004)
1141 #define SL_RECORDEVENT_HEADMOVING	((SLuint32) 0x00000008)
1142 #define SL_RECORDEVENT_HEADSTALLED 	((SLuint32) 0x00000010)
1143 /* Note: SL_RECORDEVENT_BUFFER_INSUFFICIENT is deprecated, use SL_RECORDEVENT_BUFFER_FULL instead. */
1144 #define SL_RECORDEVENT_BUFFER_INSUFFICIENT      ((SLuint32) 0x00000020)
1145 #define SL_RECORDEVENT_BUFFER_FULL	((SLuint32) 0x00000020)
1146 
1147 
1148 extern SL_API const SLInterfaceID SL_IID_RECORD;
1149 
1150 struct SLRecordItf_;
1151 typedef const struct SLRecordItf_ * const * SLRecordItf;
1152 
1153 typedef void (SLAPIENTRY *slRecordCallback) (
1154 	SLRecordItf caller,
1155 	void *pContext,
1156 	SLuint32 event
1157 );
1158 
1159 /** Recording interface methods */
1160 struct SLRecordItf_ {
1161 	SLresult (*SetRecordState) (
1162 		SLRecordItf self,
1163 		SLuint32 state
1164 	);
1165 	SLresult (*GetRecordState) (
1166 		SLRecordItf self,
1167 		SLuint32 *pState
1168 	);
1169 	SLresult (*SetDurationLimit) (
1170 		SLRecordItf self,
1171 		SLmillisecond msec
1172 	);
1173 	SLresult (*GetPosition) (
1174 		SLRecordItf self,
1175 		SLmillisecond *pMsec
1176 	);
1177 	SLresult (*RegisterCallback) (
1178 		SLRecordItf self,
1179 		slRecordCallback callback,
1180 		void *pContext
1181 	);
1182 	SLresult (*SetCallbackEventsMask) (
1183 		SLRecordItf self,
1184 		SLuint32 eventFlags
1185 	);
1186 	SLresult (*GetCallbackEventsMask) (
1187 		SLRecordItf self,
1188 		SLuint32 *pEventFlags
1189 	);
1190 	SLresult (*SetMarkerPosition) (
1191 		SLRecordItf self,
1192 		SLmillisecond mSec
1193 	);
1194 	SLresult (*ClearMarkerPosition) (
1195 		SLRecordItf self
1196 	);
1197 	SLresult (*GetMarkerPosition) (
1198 		SLRecordItf self,
1199 		SLmillisecond *pMsec
1200 	);
1201 	SLresult (*SetPositionUpdatePeriod) (
1202 		SLRecordItf self,
1203 		SLmillisecond mSec
1204 	);
1205 	SLresult (*GetPositionUpdatePeriod) (
1206 		SLRecordItf self,
1207 		SLmillisecond *pMsec
1208 	);
1209 };
1210 
1211 /*---------------------------------------------------------------------------*/
1212 /* Equalizer interface                                                       */
1213 /*---------------------------------------------------------------------------*/
1214 
1215 #define SL_EQUALIZER_UNDEFINED				((SLuint16) 0xFFFF)
1216 
1217 extern SL_API const SLInterfaceID SL_IID_EQUALIZER;
1218 
1219 struct SLEqualizerItf_;
1220 typedef const struct SLEqualizerItf_ * const * SLEqualizerItf;
1221 
1222 struct SLEqualizerItf_ {
1223 	SLresult (*SetEnabled)(
1224 		SLEqualizerItf self,
1225 		SLboolean enabled
1226 	);
1227 	SLresult (*IsEnabled)(
1228 		SLEqualizerItf self,
1229 		SLboolean *pEnabled
1230 	);
1231 	SLresult (*GetNumberOfBands)(
1232 		SLEqualizerItf self,
1233 		SLuint16 *pAmount
1234 	);
1235 	SLresult (*GetBandLevelRange)(
1236 		SLEqualizerItf self,
1237 		SLmillibel *pMin,
1238 		SLmillibel *pMax
1239 	);
1240 	SLresult (*SetBandLevel)(
1241 		SLEqualizerItf self,
1242 		SLuint16 band,
1243 		SLmillibel level
1244 	);
1245 	SLresult (*GetBandLevel)(
1246 		SLEqualizerItf self,
1247 		SLuint16 band,
1248 		SLmillibel *pLevel
1249 	);
1250 	SLresult (*GetCenterFreq)(
1251 		SLEqualizerItf self,
1252 		SLuint16 band,
1253 		SLmilliHertz *pCenter
1254 	);
1255 	SLresult (*GetBandFreqRange)(
1256 		SLEqualizerItf self,
1257 		SLuint16 band,
1258 		SLmilliHertz *pMin,
1259 		SLmilliHertz *pMax
1260 	);
1261 	SLresult (*GetBand)(
1262 		SLEqualizerItf self,
1263 		SLmilliHertz frequency,
1264 		SLuint16 *pBand
1265 	);
1266 	SLresult (*GetCurrentPreset)(
1267 		SLEqualizerItf self,
1268 		SLuint16 *pPreset
1269 	);
1270 	SLresult (*UsePreset)(
1271 		SLEqualizerItf self,
1272 		SLuint16 index
1273 	);
1274 	SLresult (*GetNumberOfPresets)(
1275 		SLEqualizerItf self,
1276 		SLuint16 *pNumPresets
1277 	);
1278 	SLresult (*GetPresetName)(
1279 		SLEqualizerItf self,
1280 		SLuint16 index,
1281 		const SLchar ** ppName
1282 	);
1283 };
1284 
1285 /*---------------------------------------------------------------------------*/
1286 /* Volume Interface                                                           */
1287 /* --------------------------------------------------------------------------*/
1288 
1289 extern SL_API const SLInterfaceID SL_IID_VOLUME;
1290 
1291 struct SLVolumeItf_;
1292 typedef const struct SLVolumeItf_ * const * SLVolumeItf;
1293 
1294 struct SLVolumeItf_ {
1295 	SLresult (*SetVolumeLevel) (
1296 		SLVolumeItf self,
1297 		SLmillibel level
1298 	);
1299 	SLresult (*GetVolumeLevel) (
1300 		SLVolumeItf self,
1301 		SLmillibel *pLevel
1302 	);
1303 	SLresult (*GetMaxVolumeLevel) (
1304 		SLVolumeItf  self,
1305 		SLmillibel *pMaxLevel
1306 	);
1307 	SLresult (*SetMute) (
1308 		SLVolumeItf self,
1309 		SLboolean mute
1310 	);
1311 	SLresult (*GetMute) (
1312 		SLVolumeItf self,
1313 		SLboolean *pMute
1314 	);
1315 	SLresult (*EnableStereoPosition) (
1316 		SLVolumeItf self,
1317 		SLboolean enable
1318 	);
1319 	SLresult (*IsEnabledStereoPosition) (
1320 		SLVolumeItf self,
1321 		SLboolean *pEnable
1322 	);
1323 	SLresult (*SetStereoPosition) (
1324 		SLVolumeItf self,
1325 		SLpermille stereoPosition
1326 	);
1327 	SLresult (*GetStereoPosition) (
1328 		SLVolumeItf self,
1329 		SLpermille *pStereoPosition
1330 	);
1331 };
1332 
1333 
1334 /*---------------------------------------------------------------------------*/
1335 /* Device Volume Interface                                                   */
1336 /* --------------------------------------------------------------------------*/
1337 
1338 extern SL_API const SLInterfaceID SL_IID_DEVICEVOLUME;
1339 
1340 struct SLDeviceVolumeItf_;
1341 typedef const struct SLDeviceVolumeItf_ * const * SLDeviceVolumeItf;
1342 
1343 struct SLDeviceVolumeItf_ {
1344 	SLresult (*GetVolumeScale) (
1345 		SLDeviceVolumeItf self,
1346 		SLuint32 deviceID,
1347 		SLint32 *pMinValue,
1348 		SLint32 *pMaxValue,
1349 		SLboolean *pIsMillibelScale
1350 	);
1351 	SLresult (*SetVolume) (
1352 		SLDeviceVolumeItf self,
1353 		SLuint32 deviceID,
1354 		SLint32 volume
1355 	);
1356 	SLresult (*GetVolume) (
1357 		SLDeviceVolumeItf self,
1358 		SLuint32 deviceID,
1359 		SLint32 *pVolume
1360 	);
1361 };
1362 
1363 
1364 /*---------------------------------------------------------------------------*/
1365 /* Buffer Queue Interface                                                    */
1366 /*---------------------------------------------------------------------------*/
1367 
1368 extern SL_API const SLInterfaceID SL_IID_BUFFERQUEUE;
1369 
1370 struct SLBufferQueueItf_;
1371 typedef const struct SLBufferQueueItf_ * const * SLBufferQueueItf;
1372 
1373 typedef void (SLAPIENTRY *slBufferQueueCallback)(
1374 	SLBufferQueueItf caller,
1375 	void *pContext
1376 );
1377 
1378 /** Buffer queue state **/
1379 
1380 typedef struct SLBufferQueueState_ {
1381 	SLuint32	count;
1382 	SLuint32	playIndex;
1383 } SLBufferQueueState;
1384 
1385 
1386 struct SLBufferQueueItf_ {
1387 	SLresult (*Enqueue) (
1388 		SLBufferQueueItf self,
1389 		const void *pBuffer,
1390 		SLuint32 size
1391 	);
1392 	SLresult (*Clear) (
1393 		SLBufferQueueItf self
1394 	);
1395 	SLresult (*GetState) (
1396 		SLBufferQueueItf self,
1397 		SLBufferQueueState *pState
1398 	);
1399 	SLresult (*RegisterCallback) (
1400 		SLBufferQueueItf self,
1401 		slBufferQueueCallback callback,
1402 		void* pContext
1403 	);
1404 };
1405 
1406 
1407 /*---------------------------------------------------------------------------*/
1408 /* PresetReverb                                                              */
1409 /*---------------------------------------------------------------------------*/
1410 
1411 #define SL_REVERBPRESET_NONE		((SLuint16) 0x0000)
1412 #define SL_REVERBPRESET_SMALLROOM	((SLuint16) 0x0001)
1413 #define SL_REVERBPRESET_MEDIUMROOM	((SLuint16) 0x0002)
1414 #define SL_REVERBPRESET_LARGEROOM	((SLuint16) 0x0003)
1415 #define SL_REVERBPRESET_MEDIUMHALL	((SLuint16) 0x0004)
1416 #define SL_REVERBPRESET_LARGEHALL	((SLuint16) 0x0005)
1417 #define SL_REVERBPRESET_PLATE 		((SLuint16) 0x0006)
1418 
1419 
1420 extern SL_API const SLInterfaceID SL_IID_PRESETREVERB;
1421 
1422 struct SLPresetReverbItf_;
1423 typedef const struct SLPresetReverbItf_ * const * SLPresetReverbItf;
1424 
1425 struct SLPresetReverbItf_ {
1426 	SLresult (*SetPreset) (
1427 		SLPresetReverbItf self,
1428 		SLuint16 preset
1429 	);
1430 	SLresult (*GetPreset) (
1431 		SLPresetReverbItf self,
1432 		SLuint16 *pPreset
1433 	);
1434 };
1435 
1436 
1437 /*---------------------------------------------------------------------------*/
1438 /* EnvironmentalReverb                                                       */
1439 /*---------------------------------------------------------------------------*/
1440 
1441 #define SL_I3DL2_ENVIRONMENT_PRESET_DEFAULT \
1442 	{ SL_MILLIBEL_MIN,    0,  1000,   500, SL_MILLIBEL_MIN,  20, SL_MILLIBEL_MIN,  40, 1000,1000 }
1443 #define SL_I3DL2_ENVIRONMENT_PRESET_GENERIC \
1444 	{ -1000, -100, 1490,  830, -2602,   7,   200,  11, 1000,1000 }
1445 #define SL_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL \
1446 	{ -1000,-6000,  170,  100, -1204,   1,   207,   2, 1000,1000 }
1447 #define SL_I3DL2_ENVIRONMENT_PRESET_ROOM \
1448 	{ -1000, -454,  400,  830, -1646,   2,    53,   3, 1000,1000 }
1449 #define SL_I3DL2_ENVIRONMENT_PRESET_BATHROOM \
1450 	{ -1000,-1200, 1490,  540,  -370,   7,  1030,  11, 1000, 600 }
1451 #define SL_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM \
1452 	{ -1000,-6000,  500,  100, -1376,   3, -1104,   4, 1000,1000 }
1453 #define SL_I3DL2_ENVIRONMENT_PRESET_STONEROOM \
1454 	{ -1000, -300, 2310,  640,  -711,  12,    83,  17, 1000,1000 }
1455 #define SL_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM \
1456 	{ -1000, -476, 4320,  590,  -789,  20,  -289,  30, 1000,1000 }
1457 #define SL_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL \
1458 	{ -1000, -500, 3920,  700, -1230,  20,    -2,  29, 1000,1000 }
1459 #define SL_I3DL2_ENVIRONMENT_PRESET_CAVE \
1460 	{ -1000,    0, 2910, 1300,  -602,  15,  -302,  22, 1000,1000 }
1461 #define SL_I3DL2_ENVIRONMENT_PRESET_ARENA \
1462 	{ -1000, -698, 7240,  330, -1166,  20,    16,  30, 1000,1000 }
1463 #define SL_I3DL2_ENVIRONMENT_PRESET_HANGAR \
1464 	{ -1000,-1000, 10050,  230,  -602,  20,   198,  30, 1000,1000 }
1465 #define SL_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY \
1466 	{ -1000,-4000,  300,  100, -1831,   2, -1630,  30, 1000,1000 }
1467 #define SL_I3DL2_ENVIRONMENT_PRESET_HALLWAY \
1468 	{ -1000, -300, 1490,  590, -1219,   7,   441,  11, 1000,1000 }
1469 #define SL_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR \
1470 	{ -1000, -237, 2700,  790, -1214,  13,   395,  20, 1000,1000 }
1471 #define SL_I3DL2_ENVIRONMENT_PRESET_ALLEY \
1472 	{ -1000, -270, 1490,  860, -1204,   7,    -4,  11, 1000,1000 }
1473 #define SL_I3DL2_ENVIRONMENT_PRESET_FOREST \
1474 	{ -1000,-3300, 1490,  540, -2560, 162,  -613,  88,  790,1000 }
1475 #define SL_I3DL2_ENVIRONMENT_PRESET_CITY \
1476 	{ -1000, -800, 1490,  670, -2273,   7, -2217,  11,  500,1000 }
1477 #define SL_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS \
1478 	{ -1000,-2500, 1490,  210, -2780, 300, -2014, 100,  270,1000 }
1479 #define SL_I3DL2_ENVIRONMENT_PRESET_QUARRY \
1480 	{ -1000,-1000, 1490,  830, SL_MILLIBEL_MIN,  61,   500,  25, 1000,1000 }
1481 #define SL_I3DL2_ENVIRONMENT_PRESET_PLAIN \
1482 	{ -1000,-2000, 1490,  500, -2466, 179, -2514, 100,  210,1000 }
1483 #define SL_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT \
1484 	{ -1000,    0, 1650, 1500, -1363,   8, -1153,  12, 1000,1000 }
1485 #define SL_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE \
1486 	{ -1000,-1000, 2810,  140,   429,  14,   648,  21,  800, 600 }
1487 #define SL_I3DL2_ENVIRONMENT_PRESET_UNDERWATER \
1488 	{ -1000,-4000, 1490,  100,  -449,   7,  1700,  11, 1000,1000 }
1489 #define SL_I3DL2_ENVIRONMENT_PRESET_SMALLROOM \
1490 	{ -1000,-600, 1100, 830, -400, 5, 500, 10, 1000, 1000 }
1491 #define SL_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM \
1492 	{ -1000,-600, 1300, 830, -1000, 20, -200, 20, 1000, 1000 }
1493 #define SL_I3DL2_ENVIRONMENT_PRESET_LARGEROOM \
1494 	{ -1000,-600, 1500, 830, -1600, 5, -1000, 40, 1000, 1000 }
1495 #define SL_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL \
1496 	{ -1000,-600, 1800, 700, -1300, 15, -800, 30, 1000, 1000 }
1497 #define SL_I3DL2_ENVIRONMENT_PRESET_LARGEHALL \
1498 	{ -1000,-600, 1800, 700, -2000, 30, -1400, 60, 1000, 1000 }
1499 #define SL_I3DL2_ENVIRONMENT_PRESET_PLATE \
1500 	{ -1000,-200, 1300, 900, 0, 2, 0, 10, 1000, 750 }
1501 
1502 
1503 typedef struct SLEnvironmentalReverbSettings_ {
1504 	SLmillibel    roomLevel;
1505 	SLmillibel    roomHFLevel;
1506 	SLmillisecond decayTime;
1507 	SLpermille    decayHFRatio;
1508 	SLmillibel    reflectionsLevel;
1509 	SLmillisecond reflectionsDelay;
1510 	SLmillibel    reverbLevel;
1511 	SLmillisecond reverbDelay;
1512 	SLpermille    diffusion;
1513 	SLpermille    density;
1514 } SLEnvironmentalReverbSettings;
1515 
1516 
1517 
1518 
1519 extern SL_API const SLInterfaceID SL_IID_ENVIRONMENTALREVERB;
1520 
1521 
1522 struct SLEnvironmentalReverbItf_;
1523 typedef const struct SLEnvironmentalReverbItf_ * const * SLEnvironmentalReverbItf;
1524 
1525 struct SLEnvironmentalReverbItf_ {
1526 	SLresult (*SetRoomLevel) (
1527 		SLEnvironmentalReverbItf self,
1528 		SLmillibel room
1529 	);
1530 	SLresult (*GetRoomLevel) (
1531 		SLEnvironmentalReverbItf self,
1532 		SLmillibel *pRoom
1533 	);
1534 	SLresult (*SetRoomHFLevel) (
1535 		SLEnvironmentalReverbItf self,
1536 		SLmillibel roomHF
1537 	);
1538 	SLresult (*GetRoomHFLevel) (
1539 		SLEnvironmentalReverbItf self,
1540 		SLmillibel *pRoomHF
1541 	);
1542 	SLresult (*SetDecayTime) (
1543 		SLEnvironmentalReverbItf self,
1544 		SLmillisecond decayTime
1545 	);
1546 	SLresult (*GetDecayTime) (
1547 		SLEnvironmentalReverbItf self,
1548 		SLmillisecond *pDecayTime
1549 	);
1550 	SLresult (*SetDecayHFRatio) (
1551 		SLEnvironmentalReverbItf self,
1552 		SLpermille decayHFRatio
1553 	);
1554 	SLresult (*GetDecayHFRatio) (
1555 		SLEnvironmentalReverbItf self,
1556 		SLpermille *pDecayHFRatio
1557 	);
1558 	SLresult (*SetReflectionsLevel) (
1559 		SLEnvironmentalReverbItf self,
1560 		SLmillibel reflectionsLevel
1561 	);
1562 	SLresult (*GetReflectionsLevel) (
1563 		SLEnvironmentalReverbItf self,
1564 		SLmillibel *pReflectionsLevel
1565 	);
1566 	SLresult (*SetReflectionsDelay) (
1567 		SLEnvironmentalReverbItf self,
1568 		SLmillisecond reflectionsDelay
1569 	);
1570 	SLresult (*GetReflectionsDelay) (
1571 		SLEnvironmentalReverbItf self,
1572 		SLmillisecond *pReflectionsDelay
1573 	);
1574 	SLresult (*SetReverbLevel) (
1575 		SLEnvironmentalReverbItf self,
1576 		SLmillibel reverbLevel
1577 	);
1578 	SLresult (*GetReverbLevel) (
1579 		SLEnvironmentalReverbItf self,
1580 		SLmillibel *pReverbLevel
1581 	);
1582 	SLresult (*SetReverbDelay) (
1583 		SLEnvironmentalReverbItf self,
1584 		SLmillisecond reverbDelay
1585 	);
1586 	SLresult (*GetReverbDelay) (
1587 		SLEnvironmentalReverbItf self,
1588 		SLmillisecond *pReverbDelay
1589 	);
1590 	SLresult (*SetDiffusion) (
1591 		SLEnvironmentalReverbItf self,
1592 		SLpermille diffusion
1593 	);
1594 	SLresult (*GetDiffusion) (
1595 		SLEnvironmentalReverbItf self,
1596 		SLpermille *pDiffusion
1597 	);
1598 	SLresult (*SetDensity) (
1599 		SLEnvironmentalReverbItf self,
1600 		SLpermille density
1601 	);
1602 	SLresult (*GetDensity) (
1603 		SLEnvironmentalReverbItf self,
1604 		SLpermille *pDensity
1605 	);
1606 	SLresult (*SetEnvironmentalReverbProperties) (
1607 		SLEnvironmentalReverbItf self,
1608 		const SLEnvironmentalReverbSettings *pProperties
1609 	);
1610 	SLresult (*GetEnvironmentalReverbProperties) (
1611 		SLEnvironmentalReverbItf self,
1612 		SLEnvironmentalReverbSettings *pProperties
1613 	);
1614 };
1615 
1616 /*---------------------------------------------------------------------------*/
1617 /* Effects Send Interface                                                    */
1618 /*---------------------------------------------------------------------------*/
1619 
1620 
1621 extern SL_API const SLInterfaceID SL_IID_EFFECTSEND;
1622 
1623 struct SLEffectSendItf_;
1624 typedef const struct SLEffectSendItf_ * const * SLEffectSendItf;
1625 
1626 struct SLEffectSendItf_ {
1627 	SLresult (*EnableEffectSend) (
1628 		SLEffectSendItf self,
1629 		const void *pAuxEffect,
1630 		SLboolean enable,
1631 		SLmillibel initialLevel
1632 	);
1633 	SLresult (*IsEnabled) (
1634 		SLEffectSendItf self,
1635 		const void * pAuxEffect,
1636 		SLboolean *pEnable
1637 	);
1638 	SLresult (*SetDirectLevel) (
1639 		SLEffectSendItf self,
1640 		SLmillibel directLevel
1641 	);
1642 	SLresult (*GetDirectLevel) (
1643 		SLEffectSendItf self,
1644 		SLmillibel *pDirectLevel
1645 	);
1646 	SLresult (*SetSendLevel) (
1647 		SLEffectSendItf self,
1648 		const void *pAuxEffect,
1649 		SLmillibel sendLevel
1650 	);
1651 	SLresult (*GetSendLevel)(
1652 		SLEffectSendItf self,
1653 		const void *pAuxEffect,
1654 		SLmillibel *pSendLevel
1655 	);
1656 };
1657 
1658 
1659 /*---------------------------------------------------------------------------*/
1660 /* 3D Grouping Interface                                                     */
1661 /*---------------------------------------------------------------------------*/
1662 
1663 
1664 extern SL_API const SLInterfaceID SL_IID_3DGROUPING;
1665 
1666 
1667 struct SL3DGroupingItf_ ;
1668 typedef const struct SL3DGroupingItf_ * const * SL3DGroupingItf;
1669 
1670 struct SL3DGroupingItf_ {
1671 	SLresult (*Set3DGroup) (
1672 		SL3DGroupingItf self,
1673 		SLObjectItf group
1674 	);
1675 	SLresult (*Get3DGroup) (
1676 		SL3DGroupingItf self,
1677 		SLObjectItf *pGroup
1678 	);
1679 };
1680 
1681 
1682 /*---------------------------------------------------------------------------*/
1683 /* 3D Commit Interface                                                       */
1684 /*---------------------------------------------------------------------------*/
1685 
1686 
1687 extern SL_API const SLInterfaceID SL_IID_3DCOMMIT;
1688 
1689 struct SL3DCommitItf_;
1690 typedef const struct SL3DCommitItf_* const * SL3DCommitItf;
1691 
1692 struct SL3DCommitItf_ {
1693 	SLresult (*Commit) (
1694 		SL3DCommitItf self
1695 	);
1696 	SLresult (*SetDeferred) (
1697 		SL3DCommitItf self,
1698 		SLboolean deferred
1699 	);
1700 };
1701 
1702 
1703 /*---------------------------------------------------------------------------*/
1704 /* 3D Location Interface                                                     */
1705 /*---------------------------------------------------------------------------*/
1706 
1707 typedef struct SLVec3D_ {
1708 	SLint32	x;
1709 	SLint32	y;
1710 	SLint32	z;
1711 } SLVec3D;
1712 
1713 extern SL_API const SLInterfaceID SL_IID_3DLOCATION;
1714 
1715 struct SL3DLocationItf_;
1716 typedef const struct SL3DLocationItf_ * const * SL3DLocationItf;
1717 
1718 struct SL3DLocationItf_ {
1719 	SLresult (*SetLocationCartesian) (
1720 		SL3DLocationItf self,
1721 		const SLVec3D *pLocation
1722 	);
1723 	SLresult (*SetLocationSpherical) (
1724 		SL3DLocationItf self,
1725 		SLmillidegree azimuth,
1726 		SLmillidegree elevation,
1727 		SLmillimeter distance
1728 	);
1729 	SLresult (*Move) (
1730 		SL3DLocationItf self,
1731 		const SLVec3D *pMovement
1732 	);
1733 	SLresult (*GetLocationCartesian) (
1734 		SL3DLocationItf self,
1735 		SLVec3D *pLocation
1736 	);
1737 	SLresult (*SetOrientationVectors) (
1738 		SL3DLocationItf self,
1739 		const SLVec3D *pFront,
1740 		const SLVec3D *pAbove
1741 	);
1742 	SLresult (*SetOrientationAngles) (
1743 		SL3DLocationItf self,
1744 		SLmillidegree heading,
1745 		SLmillidegree pitch,
1746 		SLmillidegree roll
1747 	);
1748 	SLresult (*Rotate) (
1749 		SL3DLocationItf self,
1750 		SLmillidegree theta,
1751 		const SLVec3D *pAxis
1752 	);
1753 	SLresult (*GetOrientationVectors) (
1754 		SL3DLocationItf self,
1755 		SLVec3D *pFront,
1756 		SLVec3D *pUp
1757 	);
1758 };
1759 
1760 
1761 /*---------------------------------------------------------------------------*/
1762 /* 3D Doppler Interface                                                      */
1763 /*---------------------------------------------------------------------------*/
1764 
1765 
1766 extern SL_API const SLInterfaceID SL_IID_3DDOPPLER;
1767 
1768 struct SL3DDopplerItf_;
1769 typedef const struct SL3DDopplerItf_ * const * SL3DDopplerItf;
1770 
1771 struct SL3DDopplerItf_ {
1772 	SLresult (*SetVelocityCartesian) (
1773 		SL3DDopplerItf self,
1774 		const SLVec3D *pVelocity
1775 	);
1776 	SLresult (*SetVelocitySpherical) (
1777 		SL3DDopplerItf self,
1778 		SLmillidegree azimuth,
1779 		SLmillidegree elevation,
1780 		SLmillimeter speed
1781 	);
1782 	SLresult (*GetVelocityCartesian) (
1783 		SL3DDopplerItf self,
1784 		SLVec3D *pVelocity
1785 	);
1786 	SLresult (*SetDopplerFactor) (
1787 		SL3DDopplerItf self,
1788 		SLpermille dopplerFactor
1789 	);
1790 	SLresult (*GetDopplerFactor) (
1791 		SL3DDopplerItf self,
1792 		SLpermille *pDopplerFactor
1793 	);
1794 };
1795 
1796 /*---------------------------------------------------------------------------*/
1797 /* 3D Source Interface and associated defines                                */
1798 /* --------------------------------------------------------------------------*/
1799 
1800 #define SL_ROLLOFFMODEL_EXPONENTIAL	((SLuint32) 0x00000000)
1801 #define SL_ROLLOFFMODEL_LINEAR		((SLuint32) 0x00000001)
1802 
1803 
1804 extern SL_API const SLInterfaceID SL_IID_3DSOURCE;
1805 
1806 struct SL3DSourceItf_;
1807 typedef const struct SL3DSourceItf_ * const * SL3DSourceItf;
1808 
1809 struct SL3DSourceItf_ {
1810 	SLresult (*SetHeadRelative) (
1811 		SL3DSourceItf self,
1812 		SLboolean headRelative
1813 	);
1814 	SLresult (*GetHeadRelative) (
1815 		SL3DSourceItf self,
1816 		SLboolean *pHeadRelative
1817 	);
1818 	SLresult (*SetRolloffDistances) (
1819 		SL3DSourceItf self,
1820 		SLmillimeter minDistance,
1821 		SLmillimeter maxDistance
1822 	);
1823 	SLresult (*GetRolloffDistances) (
1824 		SL3DSourceItf self,
1825 		SLmillimeter *pMinDistance,
1826 		SLmillimeter *pMaxDistance
1827 	);
1828 	SLresult (*SetRolloffMaxDistanceMute) (
1829 		SL3DSourceItf self,
1830 		SLboolean mute
1831 	);
1832 	SLresult (*GetRolloffMaxDistanceMute) (
1833 		SL3DSourceItf self,
1834 		SLboolean *pMute
1835 	);
1836 	SLresult (*SetRolloffFactor) (
1837 		SL3DSourceItf self,
1838 		SLpermille rolloffFactor
1839 	);
1840 	SLresult (*GetRolloffFactor) (
1841 		SL3DSourceItf self,
1842 		SLpermille *pRolloffFactor
1843 	);
1844 	SLresult (*SetRoomRolloffFactor) (
1845 		SL3DSourceItf self,
1846 		SLpermille roomRolloffFactor
1847 	);
1848 	SLresult (*GetRoomRolloffFactor) (
1849 		SL3DSourceItf self,
1850 		SLpermille *pRoomRolloffFactor
1851 	);
1852 	SLresult (*SetRolloffModel) (
1853 		SL3DSourceItf self,
1854 		SLuint8 model
1855 	);
1856 	SLresult (*GetRolloffModel) (
1857 		SL3DSourceItf self,
1858 		SLuint8 *pModel
1859 	);
1860 	SLresult (*SetCone) (
1861 		SL3DSourceItf self,
1862 		SLmillidegree innerAngle,
1863 		SLmillidegree outerAngle,
1864 		SLmillibel outerLevel
1865 	);
1866 	SLresult (*GetCone) (
1867 		SL3DSourceItf self,
1868 		SLmillidegree *pInnerAngle,
1869 		SLmillidegree *pOuterAngle,
1870 		SLmillibel *pOuterLevel
1871 	);
1872 };
1873 
1874 /*---------------------------------------------------------------------------*/
1875 /* 3D Macroscopic Interface                                                  */
1876 /* --------------------------------------------------------------------------*/
1877 
1878 extern SL_API const SLInterfaceID SL_IID_3DMACROSCOPIC;
1879 
1880 struct SL3DMacroscopicItf_;
1881 typedef const struct SL3DMacroscopicItf_ * const * SL3DMacroscopicItf;
1882 
1883 struct SL3DMacroscopicItf_ {
1884 	SLresult (*SetSize) (
1885 		SL3DMacroscopicItf self,
1886 		SLmillimeter width,
1887 		SLmillimeter height,
1888 		SLmillimeter depth
1889 	);
1890 	SLresult (*GetSize) (
1891 		SL3DMacroscopicItf self,
1892 		SLmillimeter *pWidth,
1893 		SLmillimeter *pHeight,
1894 		SLmillimeter *pDepth
1895 	);
1896 	SLresult (*SetOrientationAngles) (
1897 		SL3DMacroscopicItf self,
1898 		SLmillidegree heading,
1899 		SLmillidegree pitch,
1900 		SLmillidegree roll
1901 	);
1902 	SLresult (*SetOrientationVectors) (
1903 		SL3DMacroscopicItf self,
1904 		const SLVec3D *pFront,
1905 		const SLVec3D *pAbove
1906 	);
1907 	SLresult (*Rotate) (
1908 		SL3DMacroscopicItf self,
1909 		SLmillidegree theta,
1910 		const SLVec3D *pAxis
1911 	);
1912 	SLresult (*GetOrientationVectors) (
1913 		SL3DMacroscopicItf self,
1914 		SLVec3D *pFront,
1915 		SLVec3D *pUp
1916 	);
1917 };
1918 
1919 /*---------------------------------------------------------------------------*/
1920 /* Mute Solo Interface                                                       */
1921 /* --------------------------------------------------------------------------*/
1922 
1923 
1924 extern SL_API const SLInterfaceID SL_IID_MUTESOLO;
1925 
1926 struct SLMuteSoloItf_;
1927 typedef const struct SLMuteSoloItf_ * const * SLMuteSoloItf;
1928 
1929 struct SLMuteSoloItf_ {
1930 	SLresult (*SetChannelMute) (
1931 		SLMuteSoloItf self,
1932 		SLuint8 chan,
1933 		SLboolean mute
1934 	);
1935 	SLresult (*GetChannelMute) (
1936 		SLMuteSoloItf self,
1937 		SLuint8 chan,
1938 		SLboolean *pMute
1939 	);
1940 	SLresult (*SetChannelSolo) (
1941 		SLMuteSoloItf self,
1942 		SLuint8 chan,
1943 		SLboolean solo
1944 	);
1945 	SLresult (*GetChannelSolo) (
1946 		SLMuteSoloItf self,
1947 		SLuint8 chan,
1948 		SLboolean *pSolo
1949 	);
1950 	SLresult (*GetNumChannels) (
1951 		SLMuteSoloItf self,
1952 		SLuint8 *pNumChannels
1953 	);
1954 };
1955 
1956 
1957 /*---------------------------------------------------------------------------*/
1958 /* Dynamic Interface Management Interface and associated types and macros    */
1959 /* --------------------------------------------------------------------------*/
1960 
1961 #define SL_DYNAMIC_ITF_EVENT_RUNTIME_ERROR			((SLuint32) 0x00000001)
1962 #define SL_DYNAMIC_ITF_EVENT_ASYNC_TERMINATION		((SLuint32) 0x00000002)
1963 #define SL_DYNAMIC_ITF_EVENT_RESOURCES_LOST			((SLuint32) 0x00000003)
1964 #define SL_DYNAMIC_ITF_EVENT_RESOURCES_LOST_PERMANENTLY	((SLuint32) 0x00000004)
1965 #define SL_DYNAMIC_ITF_EVENT_RESOURCES_AVAILABLE		((SLuint32) 0x00000005)
1966 
1967 
1968 
1969 
1970 extern SL_API const SLInterfaceID SL_IID_DYNAMICINTERFACEMANAGEMENT;
1971 
1972 struct SLDynamicInterfaceManagementItf_;
1973 typedef const struct SLDynamicInterfaceManagementItf_ * const * SLDynamicInterfaceManagementItf;
1974 
1975 typedef void (SLAPIENTRY *slDynamicInterfaceManagementCallback) (
1976 	SLDynamicInterfaceManagementItf caller,
1977 	void * pContext,
1978 	SLuint32 event,
1979 	SLresult result,
1980     const SLInterfaceID iid
1981 );
1982 
1983 
1984 struct SLDynamicInterfaceManagementItf_ {
1985 	SLresult (*AddInterface) (
1986 		SLDynamicInterfaceManagementItf self,
1987 		const SLInterfaceID iid,
1988 		SLboolean async
1989 	);
1990 	SLresult (*RemoveInterface) (
1991 		SLDynamicInterfaceManagementItf self,
1992 		const SLInterfaceID iid
1993 	);
1994 	SLresult (*ResumeInterface) (
1995 		SLDynamicInterfaceManagementItf self,
1996 		const SLInterfaceID iid,
1997 		SLboolean async
1998 	);
1999 	SLresult (*RegisterCallback) (
2000 		SLDynamicInterfaceManagementItf self,
2001 		slDynamicInterfaceManagementCallback callback,
2002 		void * pContext
2003 	);
2004 };
2005 
2006 /*---------------------------------------------------------------------------*/
2007 /* Midi Message Interface and associated types                               */
2008 /* --------------------------------------------------------------------------*/
2009 
2010 #define SL_MIDIMESSAGETYPE_NOTE_ON_OFF		((SLuint32) 0x00000001)
2011 #define SL_MIDIMESSAGETYPE_POLY_PRESSURE	((SLuint32) 0x00000002)
2012 #define SL_MIDIMESSAGETYPE_CONTROL_CHANGE	((SLuint32) 0x00000003)
2013 #define SL_MIDIMESSAGETYPE_PROGRAM_CHANGE	((SLuint32) 0x00000004)
2014 #define SL_MIDIMESSAGETYPE_CHANNEL_PRESSURE	((SLuint32) 0x00000005)
2015 #define SL_MIDIMESSAGETYPE_PITCH_BEND		((SLuint32) 0x00000006)
2016 #define SL_MIDIMESSAGETYPE_SYSTEM_MESSAGE	((SLuint32) 0x00000007)
2017 
2018 
2019 extern SL_API const SLInterfaceID SL_IID_MIDIMESSAGE;
2020 
2021 struct SLMIDIMessageItf_;
2022 typedef const struct SLMIDIMessageItf_ * const * SLMIDIMessageItf;
2023 
2024 typedef void (SLAPIENTRY *slMetaEventCallback) (
2025 	SLMIDIMessageItf caller,
2026 	void *pContext,
2027 	SLuint8 type,
2028     SLuint32 length,
2029 	const SLuint8 *pData,
2030 	SLuint32 tick,
2031 	SLuint16 track
2032 );
2033 
2034 typedef void (SLAPIENTRY *slMIDIMessageCallback) (
2035 	SLMIDIMessageItf caller,
2036 	void *pContext,
2037 	SLuint8 statusByte,
2038 	SLuint32 length,
2039 	const SLuint8 *pData,
2040 	SLuint32 tick,
2041 	SLuint16 track
2042 );
2043 
2044 struct SLMIDIMessageItf_ {
2045 	SLresult (*SendMessage) (
2046 		SLMIDIMessageItf self,
2047 		const SLuint8 *data,
2048 		SLuint32 length
2049 	);
2050 	SLresult (*RegisterMetaEventCallback) (
2051 		SLMIDIMessageItf self,
2052 		slMetaEventCallback callback,
2053 		void *pContext
2054 	);
2055 	SLresult (*RegisterMIDIMessageCallback) (
2056 		SLMIDIMessageItf self,
2057 		slMIDIMessageCallback callback,
2058 		void *pContext
2059 	);
2060 	SLresult (*AddMIDIMessageCallbackFilter) (
2061 		SLMIDIMessageItf self,
2062 		SLuint32 messageType
2063 	);
2064 	SLresult (*ClearMIDIMessageCallbackFilter) (
2065 		SLMIDIMessageItf self
2066 	);
2067 };
2068 
2069 
2070 /*---------------------------------------------------------------------------*/
2071 /* Midi Mute Solo interface                                                  */
2072 /* --------------------------------------------------------------------------*/
2073 
2074 
2075 extern SL_API const SLInterfaceID SL_IID_MIDIMUTESOLO;
2076 
2077 struct SLMIDIMuteSoloItf_;
2078 typedef const struct SLMIDIMuteSoloItf_ * const * SLMIDIMuteSoloItf;
2079 
2080 struct SLMIDIMuteSoloItf_ {
2081 	SLresult (*SetChannelMute) (
2082 		SLMIDIMuteSoloItf self,
2083 		SLuint8 channel,
2084 		SLboolean mute
2085 	);
2086 	SLresult (*GetChannelMute) (
2087 		SLMIDIMuteSoloItf self,
2088 		SLuint8 channel,
2089 		SLboolean *pMute
2090 	);
2091 	SLresult (*SetChannelSolo) (
2092 		SLMIDIMuteSoloItf self,
2093 		SLuint8 channel,
2094 		SLboolean solo
2095 	);
2096 	SLresult (*GetChannelSolo) (
2097 		SLMIDIMuteSoloItf self,
2098 		SLuint8 channel,
2099 		SLboolean *pSolo
2100 	);
2101 	SLresult (*GetTrackCount) (
2102 		SLMIDIMuteSoloItf self,
2103 		SLuint16 *pCount
2104 	);
2105 	SLresult (*SetTrackMute) (
2106 		SLMIDIMuteSoloItf self,
2107 		SLuint16 track,
2108 		SLboolean mute
2109 	);
2110 	SLresult (*GetTrackMute) (
2111 		SLMIDIMuteSoloItf self,
2112 		SLuint16 track,
2113 		SLboolean *pMute
2114 	);
2115 	SLresult (*SetTrackSolo) (
2116 		SLMIDIMuteSoloItf self,
2117 		SLuint16 track,
2118 		SLboolean solo
2119 	);
2120 	SLresult (*GetTrackSolo) (
2121 		SLMIDIMuteSoloItf self,
2122 		SLuint16 track,
2123 		SLboolean *pSolo
2124 	);
2125 };
2126 
2127 
2128 /*---------------------------------------------------------------------------*/
2129 /* Midi Tempo interface                                                      */
2130 /* --------------------------------------------------------------------------*/
2131 
2132 
2133 extern SL_API const SLInterfaceID SL_IID_MIDITEMPO;
2134 
2135 struct SLMIDITempoItf_;
2136 typedef const struct SLMIDITempoItf_ * const * SLMIDITempoItf;
2137 
2138 struct SLMIDITempoItf_ {
2139 	SLresult (*SetTicksPerQuarterNote) (
2140 		SLMIDITempoItf self,
2141 		SLuint32 tpqn
2142 	);
2143 	SLresult (*GetTicksPerQuarterNote) (
2144 		SLMIDITempoItf self,
2145 		SLuint32 *pTpqn
2146 	);
2147 	SLresult (*SetMicrosecondsPerQuarterNote) (
2148 		SLMIDITempoItf self,
2149 		SLmicrosecond uspqn
2150 	);
2151 	SLresult (*GetMicrosecondsPerQuarterNote) (
2152 		SLMIDITempoItf self,
2153 		SLmicrosecond *uspqn
2154 	);
2155 };
2156 
2157 
2158 /*---------------------------------------------------------------------------*/
2159 /* Midi Time interface                                                       */
2160 /* --------------------------------------------------------------------------*/
2161 
2162 
2163 extern SL_API const SLInterfaceID SL_IID_MIDITIME;
2164 
2165 struct SLMIDITimeItf_;
2166 typedef const struct SLMIDITimeItf_ * const * SLMIDITimeItf;
2167 
2168 struct SLMIDITimeItf_ {
2169 	SLresult (*GetDuration) (
2170 		SLMIDITimeItf self,
2171 		SLuint32 *pDuration
2172 	);
2173 	SLresult (*SetPosition) (
2174 		SLMIDITimeItf self,
2175 		SLuint32 position
2176 	);
2177 	SLresult (*GetPosition) (
2178 		SLMIDITimeItf self,
2179 		SLuint32 *pPosition
2180 	);
2181 	SLresult (*SetLoopPoints) (
2182 		SLMIDITimeItf self,
2183 		SLuint32 startTick,
2184 		SLuint32 numTicks
2185 	);
2186 	SLresult (*GetLoopPoints) (
2187 		SLMIDITimeItf self,
2188 		SLuint32 *pStartTick,
2189 		SLuint32 *pNumTicks
2190 	);
2191 };
2192 
2193 
2194 /*---------------------------------------------------------------------------*/
2195 /* Audio Decoder Capabilities Interface                                      */
2196 /* --------------------------------------------------------------------------*/
2197 
2198 /*Audio Codec related defines*/
2199 
2200 #define SL_RATECONTROLMODE_CONSTANTBITRATE	((SLuint32) 0x00000001)
2201 #define SL_RATECONTROLMODE_VARIABLEBITRATE	((SLuint32) 0x00000002)
2202 
2203 #define SL_AUDIOCODEC_PCM         ((SLuint32) 0x00000001)
2204 #define SL_AUDIOCODEC_MP3         ((SLuint32) 0x00000002)
2205 #define SL_AUDIOCODEC_AMR         ((SLuint32) 0x00000003)
2206 #define SL_AUDIOCODEC_AMRWB       ((SLuint32) 0x00000004)
2207 #define SL_AUDIOCODEC_AMRWBPLUS   ((SLuint32) 0x00000005)
2208 #define SL_AUDIOCODEC_AAC         ((SLuint32) 0x00000006)
2209 #define SL_AUDIOCODEC_WMA         ((SLuint32) 0x00000007)
2210 #define SL_AUDIOCODEC_REAL        ((SLuint32) 0x00000008)
2211 
2212 #define SL_AUDIOPROFILE_PCM                   ((SLuint32) 0x00000001)
2213 
2214 #define SL_AUDIOPROFILE_MPEG1_L3              ((SLuint32) 0x00000001)
2215 #define SL_AUDIOPROFILE_MPEG2_L3              ((SLuint32) 0x00000002)
2216 #define SL_AUDIOPROFILE_MPEG25_L3             ((SLuint32) 0x00000003)
2217 
2218 #define SL_AUDIOCHANMODE_MP3_MONO             ((SLuint32) 0x00000001)
2219 #define SL_AUDIOCHANMODE_MP3_STEREO           ((SLuint32) 0x00000002)
2220 #define SL_AUDIOCHANMODE_MP3_JOINTSTEREO      ((SLuint32) 0x00000003)
2221 #define SL_AUDIOCHANMODE_MP3_DUAL             ((SLuint32) 0x00000004)
2222 
2223 #define SL_AUDIOPROFILE_AMR			((SLuint32) 0x00000001)
2224 
2225 #define SL_AUDIOSTREAMFORMAT_CONFORMANCE	((SLuint32) 0x00000001)
2226 #define SL_AUDIOSTREAMFORMAT_IF1			((SLuint32) 0x00000002)
2227 #define SL_AUDIOSTREAMFORMAT_IF2			((SLuint32) 0x00000003)
2228 #define SL_AUDIOSTREAMFORMAT_FSF			((SLuint32) 0x00000004)
2229 #define SL_AUDIOSTREAMFORMAT_RTPPAYLOAD	((SLuint32) 0x00000005)
2230 #define SL_AUDIOSTREAMFORMAT_ITU			((SLuint32) 0x00000006)
2231 
2232 #define SL_AUDIOPROFILE_AMRWB			((SLuint32) 0x00000001)
2233 
2234 #define SL_AUDIOPROFILE_AMRWBPLUS		((SLuint32) 0x00000001)
2235 
2236 #define SL_AUDIOPROFILE_AAC_AAC			((SLuint32) 0x00000001)
2237 
2238 #define SL_AUDIOMODE_AAC_MAIN			((SLuint32) 0x00000001)
2239 #define SL_AUDIOMODE_AAC_LC			((SLuint32) 0x00000002)
2240 #define SL_AUDIOMODE_AAC_SSR			((SLuint32) 0x00000003)
2241 #define SL_AUDIOMODE_AAC_LTP			((SLuint32) 0x00000004)
2242 #define SL_AUDIOMODE_AAC_HE			((SLuint32) 0x00000005)
2243 #define SL_AUDIOMODE_AAC_SCALABLE		((SLuint32) 0x00000006)
2244 #define SL_AUDIOMODE_AAC_ERLC			((SLuint32) 0x00000007)
2245 #define SL_AUDIOMODE_AAC_LD			((SLuint32) 0x00000008)
2246 #define SL_AUDIOMODE_AAC_HE_PS			((SLuint32) 0x00000009)
2247 #define SL_AUDIOMODE_AAC_HE_MPS			((SLuint32) 0x0000000A)
2248 
2249 #define SL_AUDIOSTREAMFORMAT_MP2ADTS		((SLuint32) 0x00000001)
2250 #define SL_AUDIOSTREAMFORMAT_MP4ADTS		((SLuint32) 0x00000002)
2251 #define SL_AUDIOSTREAMFORMAT_MP4LOAS		((SLuint32) 0x00000003)
2252 #define SL_AUDIOSTREAMFORMAT_MP4LATM		((SLuint32) 0x00000004)
2253 #define SL_AUDIOSTREAMFORMAT_ADIF		((SLuint32) 0x00000005)
2254 #define SL_AUDIOSTREAMFORMAT_MP4FF		((SLuint32) 0x00000006)
2255 #define SL_AUDIOSTREAMFORMAT_RAW			((SLuint32) 0x00000007)
2256 
2257 #define SL_AUDIOPROFILE_WMA7		((SLuint32) 0x00000001)
2258 #define SL_AUDIOPROFILE_WMA8		((SLuint32) 0x00000002)
2259 #define SL_AUDIOPROFILE_WMA9		((SLuint32) 0x00000003)
2260 #define SL_AUDIOPROFILE_WMA10		((SLuint32) 0x00000004)
2261 
2262 #define SL_AUDIOMODE_WMA_LEVEL1		((SLuint32) 0x00000001)
2263 #define SL_AUDIOMODE_WMA_LEVEL2		((SLuint32) 0x00000002)
2264 #define SL_AUDIOMODE_WMA_LEVEL3		((SLuint32) 0x00000003)
2265 #define SL_AUDIOMODE_WMA_LEVEL4		((SLuint32) 0x00000004)
2266 #define SL_AUDIOMODE_WMAPRO_LEVELM0	((SLuint32) 0x00000005)
2267 #define SL_AUDIOMODE_WMAPRO_LEVELM1	((SLuint32) 0x00000006)
2268 #define SL_AUDIOMODE_WMAPRO_LEVELM2	((SLuint32) 0x00000007)
2269 #define SL_AUDIOMODE_WMAPRO_LEVELM3	((SLuint32) 0x00000008)
2270 
2271 #define SL_AUDIOPROFILE_REALAUDIO		((SLuint32) 0x00000001)
2272 
2273 #define SL_AUDIOMODE_REALAUDIO_G2		((SLuint32) 0x00000001)
2274 #define SL_AUDIOMODE_REALAUDIO_8			((SLuint32) 0x00000002)
2275 #define SL_AUDIOMODE_REALAUDIO_10		((SLuint32) 0x00000003)
2276 #define SL_AUDIOMODE_REALAUDIO_SURROUND	((SLuint32) 0x00000004)
2277 
2278 typedef struct SLAudioCodecDescriptor_ {
2279     SLuint32      maxChannels;
2280     SLuint32      minBitsPerSample;
2281     SLuint32      maxBitsPerSample;
2282     SLmilliHertz  minSampleRate;
2283     SLmilliHertz  maxSampleRate;
2284     SLboolean     isFreqRangeContinuous;
2285     SLmilliHertz *pSampleRatesSupported;
2286     SLuint32      numSampleRatesSupported;
2287     SLuint32      minBitRate;
2288     SLuint32      maxBitRate;
2289     SLboolean     isBitrateRangeContinuous;
2290     SLuint32     *pBitratesSupported;
2291     SLuint32      numBitratesSupported;
2292     SLuint32	  profileSetting;
2293     SLuint32      modeSetting;
2294 } SLAudioCodecDescriptor;
2295 
2296 /*Structure used to retrieve the profile and level settings supported by an audio encoder */
2297 
2298 typedef struct SLAudioCodecProfileMode_ {
2299     SLuint32 profileSetting;
2300     SLuint32 modeSetting;
2301 } SLAudioCodecProfileMode;
2302 
2303 extern SL_API const SLInterfaceID SL_IID_AUDIODECODERCAPABILITIES;
2304 
2305 struct SLAudioDecoderCapabilitiesItf_;
2306 typedef const struct SLAudioDecoderCapabilitiesItf_ * const * SLAudioDecoderCapabilitiesItf;
2307 
2308 struct SLAudioDecoderCapabilitiesItf_ {
2309     SLresult (*GetAudioDecoders) (
2310         SLAudioDecoderCapabilitiesItf self,
2311         SLuint32 * pNumDecoders ,
2312         SLuint32 *pDecoderIds
2313     );
2314     SLresult (*GetAudioDecoderCapabilities) (
2315         SLAudioDecoderCapabilitiesItf self,
2316         SLuint32 decoderId,
2317         SLuint32 *pIndex,
2318         SLAudioCodecDescriptor *pDescriptor
2319     );
2320 };
2321 
2322 
2323 
2324 
2325 /*---------------------------------------------------------------------------*/
2326 /* Audio Encoder Capabilities Interface                                      */
2327 /* --------------------------------------------------------------------------*/
2328 
2329 /* Structure used when setting audio encoding parameters */
2330 
2331 typedef struct SLAudioEncoderSettings_ {
2332     SLuint32 encoderId;
2333     SLuint32 channelsIn;
2334     SLuint32 channelsOut;
2335     SLmilliHertz sampleRate;
2336     SLuint32 bitRate;
2337     SLuint32 bitsPerSample;
2338     SLuint32 rateControl;
2339     SLuint32 profileSetting;
2340     SLuint32 levelSetting;
2341     SLuint32 channelMode;
2342     SLuint32 streamFormat;
2343     SLuint32 encodeOptions;
2344     SLuint32 blockAlignment;
2345 } SLAudioEncoderSettings;
2346 
2347 extern SL_API const SLInterfaceID SL_IID_AUDIOENCODERCAPABILITIES;
2348 
2349 struct SLAudioEncoderCapabilitiesItf_;
2350 typedef const struct SLAudioEncoderCapabilitiesItf_ * const * SLAudioEncoderCapabilitiesItf;
2351 
2352 struct SLAudioEncoderCapabilitiesItf_ {
2353     SLresult (*GetAudioEncoders) (
2354         SLAudioEncoderCapabilitiesItf self,
2355         SLuint32 *pNumEncoders ,
2356         SLuint32 *pEncoderIds
2357     );
2358     SLresult (*GetAudioEncoderCapabilities) (
2359         SLAudioEncoderCapabilitiesItf self,
2360         SLuint32 encoderId,
2361         SLuint32 *pIndex,
2362         SLAudioCodecDescriptor * pDescriptor
2363     );
2364 };
2365 
2366 
2367 /*---------------------------------------------------------------------------*/
2368 /* Audio Encoder Interface                                                   */
2369 /* --------------------------------------------------------------------------*/
2370 
2371 
2372 extern SL_API const SLInterfaceID SL_IID_AUDIOENCODER;
2373 
2374 struct SLAudioEncoderItf_;
2375 typedef const struct SLAudioEncoderItf_ * const * SLAudioEncoderItf;
2376 
2377 struct SLAudioEncoderItf_ {
2378     SLresult (*SetEncoderSettings) (
2379         SLAudioEncoderItf		self,
2380         SLAudioEncoderSettings 	*pSettings
2381     );
2382     SLresult (*GetEncoderSettings) (
2383         SLAudioEncoderItf		self,
2384         SLAudioEncoderSettings	*pSettings
2385     );
2386 };
2387 
2388 
2389 /*---------------------------------------------------------------------------*/
2390 /* Bass Boost Interface                                                      */
2391 /* --------------------------------------------------------------------------*/
2392 
2393 
2394 extern SL_API const SLInterfaceID SL_IID_BASSBOOST;
2395 
2396 struct SLBassBoostItf_;
2397 typedef const struct SLBassBoostItf_ * const * SLBassBoostItf;
2398 
2399 struct SLBassBoostItf_ {
2400 	SLresult (*SetEnabled)(
2401 		SLBassBoostItf self,
2402 		SLboolean enabled
2403 	);
2404 	SLresult (*IsEnabled)(
2405 		SLBassBoostItf self,
2406 		SLboolean *pEnabled
2407 	);
2408 	SLresult (*SetStrength)(
2409 		SLBassBoostItf self,
2410 		SLpermille strength
2411 	);
2412 	SLresult (*GetRoundedStrength)(
2413 		SLBassBoostItf self,
2414 		SLpermille *pStrength
2415 	);
2416 	SLresult (*IsStrengthSupported)(
2417 		SLBassBoostItf self,
2418 		SLboolean *pSupported
2419 	);
2420 };
2421 
2422 /*---------------------------------------------------------------------------*/
2423 /* Pitch Interface                                                           */
2424 /* --------------------------------------------------------------------------*/
2425 
2426 
2427 extern SL_API const SLInterfaceID SL_IID_PITCH;
2428 
2429 struct SLPitchItf_;
2430 typedef const struct SLPitchItf_ * const * SLPitchItf;
2431 
2432 struct SLPitchItf_ {
2433 	SLresult (*SetPitch) (
2434 		SLPitchItf self,
2435 		SLpermille pitch
2436 	);
2437 	SLresult (*GetPitch) (
2438 		SLPitchItf self,
2439 		SLpermille *pPitch
2440 	);
2441 	SLresult (*GetPitchCapabilities) (
2442 		SLPitchItf self,
2443 		SLpermille *pMinPitch,
2444 		SLpermille *pMaxPitch
2445 	);
2446 };
2447 
2448 
2449 /*---------------------------------------------------------------------------*/
2450 /* Rate Pitch Interface                                                      */
2451 /* RatePitchItf is an interface for controlling the rate a sound is played   */
2452 /* back. A change in rate will cause a change in pitch.                      */
2453 /* --------------------------------------------------------------------------*/
2454 
2455 
2456 extern SL_API const SLInterfaceID SL_IID_RATEPITCH;
2457 
2458 struct SLRatePitchItf_;
2459 typedef const struct SLRatePitchItf_ * const * SLRatePitchItf;
2460 
2461 struct SLRatePitchItf_ {
2462 	SLresult (*SetRate) (
2463 		SLRatePitchItf self,
2464 		SLpermille rate
2465 	);
2466 	SLresult (*GetRate) (
2467 		SLRatePitchItf self,
2468 		SLpermille *pRate
2469 	);
2470 	SLresult (*GetRatePitchCapabilities) (
2471 		SLRatePitchItf self,
2472 		SLpermille *pMinRate,
2473 		SLpermille *pMaxRate
2474 	);
2475 };
2476 
2477 
2478 /*---------------------------------------------------------------------------*/
2479 /* Virtualizer Interface                                                      */
2480 /* --------------------------------------------------------------------------*/
2481 
2482 
2483 extern SL_API const SLInterfaceID SL_IID_VIRTUALIZER;
2484 
2485 struct SLVirtualizerItf_;
2486 typedef const struct SLVirtualizerItf_ * const * SLVirtualizerItf;
2487 
2488 struct SLVirtualizerItf_ {
2489 	SLresult (*SetEnabled)(
2490 		SLVirtualizerItf self,
2491 		SLboolean enabled
2492 	);
2493 	SLresult (*IsEnabled)(
2494 		SLVirtualizerItf self,
2495 		SLboolean *pEnabled
2496 	);
2497 	SLresult (*SetStrength)(
2498 		SLVirtualizerItf self,
2499 		SLpermille strength
2500 	);
2501 	SLresult (*GetRoundedStrength)(
2502 		SLVirtualizerItf self,
2503 		SLpermille *pStrength
2504 	);
2505 	SLresult (*IsStrengthSupported)(
2506 		SLVirtualizerItf self,
2507 		SLboolean *pSupported
2508 	);
2509 };
2510 
2511 /*---------------------------------------------------------------------------*/
2512 /* Visualization Interface                                                   */
2513 /* --------------------------------------------------------------------------*/
2514 
2515 
2516 extern SL_API const SLInterfaceID SL_IID_VISUALIZATION;
2517 
2518 struct SLVisualizationItf_;
2519 typedef const struct SLVisualizationItf_ * const * SLVisualizationItf;
2520 
2521 typedef void (SLAPIENTRY *slVisualizationCallback) (
2522 	void *pContext,
2523 	const SLuint8 waveform[],
2524 	const SLuint8 fft[],
2525 	SLmilliHertz samplerate
2526 );
2527 
2528 struct SLVisualizationItf_{
2529 	SLresult (*RegisterVisualizationCallback)(
2530 		SLVisualizationItf self,
2531 		slVisualizationCallback callback,
2532 		void *pContext,
2533 		SLmilliHertz rate
2534 	);
2535 	SLresult (*GetMaxRate)(
2536 		SLVisualizationItf self,
2537 		SLmilliHertz* pRate
2538 	);
2539 };
2540 
2541 
2542 /*---------------------------------------------------------------------------*/
2543 /* Engine Interface                                                          */
2544 /* --------------------------------------------------------------------------*/
2545 
2546 
2547 extern SL_API const SLInterfaceID SL_IID_ENGINE;
2548 
2549 struct SLEngineItf_;
2550 typedef const struct SLEngineItf_ * const * SLEngineItf;
2551 
2552 
2553 struct SLEngineItf_ {
2554 
2555 	SLresult (*CreateLEDDevice) (
2556 		SLEngineItf self,
2557 		SLObjectItf * pDevice,
2558 		SLuint32 deviceID,
2559 		SLuint32 numInterfaces,
2560 		const SLInterfaceID * pInterfaceIds,
2561 		const SLboolean * pInterfaceRequired
2562 	);
2563 	SLresult (*CreateVibraDevice) (
2564 		SLEngineItf self,
2565 		SLObjectItf * pDevice,
2566 		SLuint32 deviceID,
2567 		SLuint32 numInterfaces,
2568 		const SLInterfaceID * pInterfaceIds,
2569 		const SLboolean * pInterfaceRequired
2570 	);
2571 	SLresult (*CreateAudioPlayer) (
2572 		SLEngineItf self,
2573 		SLObjectItf * pPlayer,
2574 		SLDataSource *pAudioSrc,
2575 		SLDataSink *pAudioSnk,
2576 		SLuint32 numInterfaces,
2577 		const SLInterfaceID * pInterfaceIds,
2578 		const SLboolean * pInterfaceRequired
2579 	);
2580 	SLresult (*CreateAudioRecorder) (
2581 		SLEngineItf self,
2582 		SLObjectItf * pRecorder,
2583 		SLDataSource *pAudioSrc,
2584 		SLDataSink *pAudioSnk,
2585 		SLuint32 numInterfaces,
2586 		const SLInterfaceID * pInterfaceIds,
2587 		const SLboolean * pInterfaceRequired
2588 	);
2589 	SLresult (*CreateMidiPlayer) (
2590 		SLEngineItf self,
2591 		SLObjectItf * pPlayer,
2592 		SLDataSource *pMIDISrc,
2593 		SLDataSource *pBankSrc,
2594 		SLDataSink *pAudioOutput,
2595 		SLDataSink *pVibra,
2596 		SLDataSink *pLEDArray,
2597 		SLuint32 numInterfaces,
2598 		const SLInterfaceID * pInterfaceIds,
2599 		const SLboolean * pInterfaceRequired
2600 	);
2601 	SLresult (*CreateListener) (
2602 		SLEngineItf self,
2603 		SLObjectItf * pListener,
2604 		SLuint32 numInterfaces,
2605 		const SLInterfaceID * pInterfaceIds,
2606 		const SLboolean * pInterfaceRequired
2607 	);
2608 	SLresult (*Create3DGroup) (
2609 		SLEngineItf self,
2610 		SLObjectItf * pGroup,
2611 		SLuint32 numInterfaces,
2612 		const SLInterfaceID * pInterfaceIds,
2613 		const SLboolean * pInterfaceRequired
2614 	);
2615 	SLresult (*CreateOutputMix) (
2616 		SLEngineItf self,
2617 		SLObjectItf * pMix,
2618 		SLuint32 numInterfaces,
2619 		const SLInterfaceID * pInterfaceIds,
2620 		const SLboolean * pInterfaceRequired
2621 	);
2622 	SLresult (*CreateMetadataExtractor) (
2623 		SLEngineItf self,
2624 		SLObjectItf * pMetadataExtractor,
2625 		SLDataSource * pDataSource,
2626 		SLuint32 numInterfaces,
2627 		const SLInterfaceID * pInterfaceIds,
2628 		const SLboolean * pInterfaceRequired
2629 	);
2630     SLresult (*CreateExtensionObject) (
2631         SLEngineItf self,
2632         SLObjectItf * pObject,
2633         void * pParameters,
2634         SLuint32 objectID,
2635         SLuint32 numInterfaces,
2636         const SLInterfaceID * pInterfaceIds,
2637         const SLboolean * pInterfaceRequired
2638     );
2639 	SLresult (*QueryNumSupportedInterfaces) (
2640 		SLEngineItf self,
2641 		SLuint32 objectID,
2642 		SLuint32 * pNumSupportedInterfaces
2643 	);
2644 	SLresult (*QuerySupportedInterfaces) (
2645 		SLEngineItf self,
2646 		SLuint32 objectID,
2647 		SLuint32 index,
2648 		SLInterfaceID * pInterfaceId
2649 	);
2650     SLresult (*QueryNumSupportedExtensions) (
2651         SLEngineItf self,
2652         SLuint32 * pNumExtensions
2653     );
2654     SLresult (*QuerySupportedExtension) (
2655         SLEngineItf self,
2656         SLuint32 index,
2657         SLchar * pExtensionName,
2658         SLint16 * pNameLength
2659     );
2660     SLresult (*IsExtensionSupported) (
2661         SLEngineItf self,
2662         const SLchar * pExtensionName,
2663         SLboolean * pSupported
2664     );
2665 };
2666 
2667 
2668 /*---------------------------------------------------------------------------*/
2669 /* Engine Capabilities Interface                                             */
2670 /* --------------------------------------------------------------------------*/
2671 
2672 
2673 extern SL_API const SLInterfaceID SL_IID_ENGINECAPABILITIES;
2674 
2675 struct SLEngineCapabilitiesItf_;
2676 typedef const struct SLEngineCapabilitiesItf_ * const * SLEngineCapabilitiesItf;
2677 
2678 struct SLEngineCapabilitiesItf_ {
2679 	SLresult (*QuerySupportedProfiles) (
2680 		SLEngineCapabilitiesItf self,
2681 		SLuint16 *pProfilesSupported
2682 	);
2683 	SLresult (*QueryAvailableVoices) (
2684 		SLEngineCapabilitiesItf self,
2685 		SLuint16 voiceType,
2686 		SLint16 *pNumMaxVoices,
2687 		SLboolean *pIsAbsoluteMax,
2688 		SLint16 *pNumFreeVoices
2689 	);
2690 	SLresult (*QueryNumberOfMIDISynthesizers) (
2691 		SLEngineCapabilitiesItf self,
2692 		SLint16 *pNumMIDIsynthesizers
2693 	);
2694 	SLresult (*QueryAPIVersion) (
2695 		SLEngineCapabilitiesItf self,
2696 		SLint16 *pMajor,
2697 		SLint16 *pMinor,
2698 		SLint16 *pStep
2699 	);
2700 	SLresult (*QueryLEDCapabilities) (
2701 		SLEngineCapabilitiesItf self,
2702         SLuint32 *pIndex,
2703 		SLuint32 *pLEDDeviceID,
2704 		SLLEDDescriptor *pDescriptor
2705 	);
2706 	SLresult (*QueryVibraCapabilities) (
2707 		SLEngineCapabilitiesItf self,
2708         SLuint32 *pIndex,
2709 		SLuint32 *pVibraDeviceID,
2710 		SLVibraDescriptor *pDescriptor
2711 	);
2712 	SLresult (*IsThreadSafe) (
2713 		SLEngineCapabilitiesItf self,
2714 		SLboolean *pIsThreadSafe
2715 	);
2716 };
2717 
2718 /*---------------------------------------------------------------------------*/
2719 /* Thread Sync Interface                                                     */
2720 /* --------------------------------------------------------------------------*/
2721 
2722 
2723 extern SL_API const SLInterfaceID SL_IID_THREADSYNC;
2724 
2725 struct SLThreadSyncItf_;
2726 typedef const struct SLThreadSyncItf_ * const * SLThreadSyncItf;
2727 
2728 
2729 struct SLThreadSyncItf_ {
2730 	SLresult (*EnterCriticalSection) (
2731 		SLThreadSyncItf self
2732 	);
2733 	SLresult (*ExitCriticalSection) (
2734 		SLThreadSyncItf self
2735 	);
2736 };
2737 
2738 
2739 /*****************************************************************************/
2740 /* SL engine constructor                                                     */
2741 /*****************************************************************************/
2742 
2743 #define SL_ENGINEOPTION_THREADSAFE	((SLuint32) 0x00000001)
2744 #define SL_ENGINEOPTION_LOSSOFCONTROL	((SLuint32) 0x00000002)
2745 
2746 typedef struct SLEngineOption_ {
2747 	SLuint32 feature;
2748 	SLuint32 data;
2749 } SLEngineOption;
2750 
2751 
2752 SL_API SLresult SLAPIENTRY slCreateEngine(
2753 	SLObjectItf             *pEngine,
2754 	SLuint32                numOptions,
2755 	const SLEngineOption    *pEngineOptions,
2756 	SLuint32                numInterfaces,
2757 	const SLInterfaceID     *pInterfaceIds,
2758 	const SLboolean         * pInterfaceRequired
2759 ) SL_API_DEPRECATED(30);
2760 
2761 SL_API SLresult SLAPIENTRY slQueryNumSupportedEngineInterfaces(
2762 	SLuint32 * pNumSupportedInterfaces
2763 ) SL_API_DEPRECATED(30);
2764 
2765 SL_API SLresult SLAPIENTRY slQuerySupportedEngineInterfaces(
2766 	SLuint32 index,
2767 	SLInterfaceID * pInterfaceId
2768 ) SL_API_DEPRECATED(30);
2769 
2770 #ifdef __cplusplus
2771 } /* extern "C" */
2772 #endif
2773 
2774 #endif /* OPENSL_ES_H_ */
2775