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