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