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