1/********************************************************************************************************************************** 2* 3* OpenAL cross platform audio library 4* Copyright (c) 2006, Apple Computer, Inc., Copyright (c) 2012, Apple Inc. All rights reserved. 5* 6* Redistribution and use in source and binary forms, with or without modification, are permitted provided 7* that the following conditions are met: 8* 9* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 10* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 11* disclaimer in the documentation and/or other materials provided with the distribution. 12* 3. Neither the name of Apple Inc. ("Apple") nor the names of its contributors may be used to endorse or promote 13* products derived from this software without specific prior written permission. 14* 15* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS 17* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 18* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 19* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 20* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21* 22**********************************************************************************************************************************/ 23 24#ifndef __MAC_OSX_OAL_EXTENSIONS_H__ 25#define __MAC_OSX_OAL_EXTENSIONS_H__ 26 27#include <OpenAL/al.h> 28#include <OpenAL/alc.h> 29 30/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ 32 33/* 34 Convert Data When Loading. 35 Default false, currently applies only to monophonic sounds. Use with alEnable()/alDisable() 36*/ 37 #define ALC_MAC_OSX_CONVERT_DATA_UPON_LOADING 0xF001 38 39/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 ALC_EXT_MAC_OSX 41 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ 42 43typedef ALvoid (*alcMacOSXRenderingQualityProcPtr) (ALint value); 44typedef ALvoid (*alMacOSXRenderChannelCountProcPtr) (ALint value); 45typedef ALvoid (*alcMacOSXMixerMaxiumumBussesProcPtr) (ALint value); 46typedef ALvoid (*alcMacOSXMixerOutputRateProcPtr) (ALdouble value); 47 48typedef ALint (*alcMacOSXGetRenderingQualityProcPtr) (); 49typedef ALint (*alMacOSXGetRenderChannelCountProcPtr) (); 50typedef ALint (*alcMacOSXGetMixerMaxiumumBussesProcPtr) (); 51typedef ALdouble (*alcMacOSXGetMixerOutputRateProcPtr) (); 52 53/* Render Quality. Used with alcMacOSXRenderingQuality() */ 54 55 #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_HIGH 'rqhi' 56 #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_LOW 'rdlo' 57 58/* 59 Render Channels. Used with alMacOSXRenderChannelCount() 60 Allows a user to force OpenAL to render to stereo, regardless of the audio hardware being used 61*/ 62 #define ALC_MAC_OSX_RENDER_CHANNEL_COUNT_STEREO 'rcst' 63 #define ALC_MAC_OSX_RENDER_CHANNEL_COUNT_MULTICHANNEL 'rcmc' 64 65/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 AL_EXT_STATIC_BUFFER 67 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ 68 69typedef ALvoid AL_APIENTRY (*alBufferDataStaticProcPtr) (ALint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq); 70 71/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 AL_EXT_SOURCE_NOTIFICATIONS 73 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ 74/* 75 Source Notifications 76 77 Eliminates the need for continuous polling for source state by providing a 78 mechanism for the application to receive source state change notifications. 79 Upon receiving a notification, the application can retrieve the actual state 80 corresponding to the notification ID for which the notification was sent. 81*/ 82 83#define AL_QUEUE_HAS_LOOPED 0x9000 84 85/* 86 Notification Proc: ALSourceNotificationProc 87 88 sid - source id 89 notificationID - id of state that has changed 90 userData - user data provided to alSourceAddNotification() 91*/ 92 93typedef ALvoid (*alSourceNotificationProc)(ALuint sid, ALuint notificationID, ALvoid* userData); 94 95/* 96 API: alSourceAddNotification 97 98 sid - source id 99 notificationID - id of state for which caller wants to be notified of a change 100 notifyProc - notification proc 101 userData - ptr to applications user data, will be returned in the notification proc 102 103 Returns AL_NO_ERROR if request is successful. 104 105 Valid IDs: 106 AL_SOURCE_STATE 107 AL_BUFFERS_PROCESSED 108 AL_QUEUE_HAS_LOOPED - notification sent when a looping source has looped to it's start point 109*/ 110typedef ALenum (*alSourceAddNotificationProcPtr) (ALuint sid, ALuint notificationID, alSourceNotificationProc notifyProc, ALvoid* userData); 111 112/* 113 API: alSourceRemoveStateNotification 114 115 sid - source id 116 notificationID - id of state for which caller wants to remove an existing notification 117 notifyProc - notification proc 118 userData - ptr to applications user data, will be returned in the notification proc 119*/ 120typedef ALvoid (*alSourceRemoveNotificationProcPtr) (ALuint sid, ALuint notificationID, alSourceNotificationProc notifyProc, ALvoid* userData); 121 122/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 ALC_EXT_ASA : Apple Spatial Audio Extension 124 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ 125/* 126 Used with the ASA API calls: alcASAGetSource(), alcASASetSource(), alcASAGetListener(), alcASASetListener() 127*/ 128 129typedef ALenum (*alcASAGetSourceProcPtr) (ALuint property, ALuint source, ALvoid *data, ALuint* dataSize); 130typedef ALenum (*alcASASetSourceProcPtr) (ALuint property, ALuint source, ALvoid *data, ALuint dataSize); 131typedef ALenum (*alcASAGetListenerProcPtr) (ALuint property, ALvoid *data, ALuint* dataSize); 132typedef ALenum (*alcASASetListenerProcPtr) (ALuint property, ALvoid *data, ALuint dataSize); 133 134 /* listener properties */ 135 #define ALC_ASA_REVERB_ON 'rvon' // type ALuint 136 #define ALC_ASA_REVERB_GLOBAL_LEVEL 'rvgl' // type ALfloat -40.0 db - 40.0 db 137 138 #define ALC_ASA_REVERB_ROOM_TYPE 'rvrt' // type ALint 139 140 /* reverb room type presets for the ALC_ASA_REVERB_ROOM_TYPE property */ 141 #define ALC_ASA_REVERB_ROOM_TYPE_SmallRoom 0 142 #define ALC_ASA_REVERB_ROOM_TYPE_MediumRoom 1 143 #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom 2 144 #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall 3 145 #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall 4 146 #define ALC_ASA_REVERB_ROOM_TYPE_Plate 5 147 #define ALC_ASA_REVERB_ROOM_TYPE_MediumChamber 6 148 #define ALC_ASA_REVERB_ROOM_TYPE_LargeChamber 7 149 #define ALC_ASA_REVERB_ROOM_TYPE_Cathedral 8 150 #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom2 9 151 #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall2 10 152 #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall3 11 153 #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall2 12 154 155 #define ALC_ASA_REVERB_PRESET 'rvps' // type ALchar* - (set only) path to an au preset file 156 157 #define ALC_ASA_REVERB_EQ_GAIN 'rveg' // type ALfloat 158 #define ALC_ASA_REVERB_EQ_BANDWITH 'rveb' // type ALfloat 159 #define ALC_ASA_REVERB_EQ_FREQ 'rvef' // type ALfloat 160 161 #define ALC_ASA_REVERB_QUALITY 'rvqt' // type ALint 162 163 /* reverb quality settings for the ALC_ASA_REVERB_QUALITY property */ 164 #define ALC_ASA_REVERB_QUALITY_Max 0x7F 165 #define ALC_ASA_REVERB_QUALITY_High 0x60 166 #define ALC_ASA_REVERB_QUALITY_Medium 0x40 167 #define ALC_ASA_REVERB_QUALITY_Low 0x20 168 #define ALC_ASA_REVERB_QUALITY_Min 0 169 170 /* source properties */ 171 #define ALC_ASA_REVERB_SEND_LEVEL 'rvsl' // type ALfloat 0.0 (dry) - 1.0 (wet) (0-100% dry/wet mix, 0.0 default) 172 #define ALC_ASA_OCCLUSION 'occl' // type ALfloat -100.0 db (most occlusion) - 0.0 db (no occlusion, 0.0 default) 173 #define ALC_ASA_OBSTRUCTION 'obst' // type ALfloat -100.0 db (most obstruction) - 0.0 db (no obstruction, 0.0 default) 174 175/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 176 ALC_EXT_ASA_ROGER_BEEP : Apple Spatial Audio Extension for Roger Beep Effect 177 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ 178 179/* 180 Roger Beep : an effect to simulate effects such as Walkie Talkie noise. It is designed to replace the 181 source audio data with a specific 'tone' when falling below a specified db threshold for a specified time. 182 This Extension will be present when the Roger Beep Audio Unit is present on the system (10.5 or greater) 183 Use the alcASAGetSource() and alcASASetSource() APIs in the ALC_EXT_ASA extension. 184*/ 185 186 /* source properties */ 187 #define ALC_ASA_ROGER_BEEP_ENABLE 'rben' // type ALboolean - initializes Roger Beep for use - returns error if source is not in a Stopped or Initial state 188 #define ALC_ASA_ROGER_BEEP_ON 'rbon' // type ALboolean - set effect on/off (bypass) - default setting is true (on) 189 #define ALC_ASA_ROGER_BEEP_GAIN 'rbgn' // type ALfloat - 20.0 (db) apply maximum effect : -80.0(db) apply minimum effect amount 190 #define ALC_ASA_ROGER_BEEP_SENSITIVITY 'rbsn' // type ALint - specifiy a predefined sensitivity setting 191 #define ALC_ASA_ROGER_BEEP_TYPE 'rbtp' // type ALint - choose predefined specific Roger Beep tone 192 #define ALC_ASA_ROGER_BEEP_PRESET 'rbps' // type ALchar* - path to an au preset file (set only) 193 194 /* settings for the ALC_ASA_ROGER_BEEP_TYPE property */ 195 #define ALC_ASA_ROGER_BEEP_TYPE_quindartone 0 196 #define ALC_ASA_ROGER_BEEP_TYPE_whitenoise 1 197 #define ALC_ASA_ROGER_BEEP_TYPE_walkietalkie 2 198 199 /* settings for the ALC_ASA_ROGER_BEEP_SENSITIVITY property */ 200 201 #define ALC_ASA_ROGER_BEEP_SENSITIVITY_Light 0 202 #define ALC_ASA_ROGER_BEEP_SENSITIVITY_Medium 1 203 #define ALC_ASA_ROGER_BEEP_SENSITIVITY_Heavy 2 204 205/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 206 ALC_EXT_ASA_DISTORTION : Apple Spatial Audio Extension for Distortion Effect 207 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ 208 209/* 210 Distortion Effect 211 This Extension will be present when the Distortion Audio Unit is present on the system (10.5 or greater) 212 Use the alcASAGetSource() and alcASASetSource() APIs in the ALC_EXT_ASA extension. 213*/ 214 215 /* source properties */ 216 #define ALC_ASA_DISTORTION_ENABLE 'dsen' // type ALboolean - initializes Distortion for use - returns error if source is not in a Stopped or Initial state 217 #define ALC_ASA_DISTORTION_ON 'dson' // type ALboolean - set effect on/off (bypass) - default setting is true (on) 218 #define ALC_ASA_DISTORTION_MIX 'dsmx' // type ALfloat - mix balance between dry signal and distortion effect - 0.0 (no effect) - 100.0 (all effect) 219 #define ALC_ASA_DISTORTION_TYPE 'dstp' // type ALint - choose predefined distortion settings 220 #define ALC_ASA_DISTORTION_PRESET 'dsps' // type ALchar* - path to an au preset file (set only) 221 222 /* settings for the ALC_ASA_DISTORTION_TYPE property */ 223 #define ALC_ASA_DISTORTION_TYPE_BitBrush 0 224 #define ALC_ASA_DISTORTION_TYPE_BufferBeats 1 225 #define ALC_ASA_DISTORTION_TYPE_LoFi 2 226 #define ALC_ASA_DISTORTION_TYPE_BrokenSpeaker 3 227 #define ALC_ASA_DISTORTION_TYPE_Cellphone 4 228 #define ALC_ASA_DISTORTION_TYPE_Decimated1 5 229 #define ALC_ASA_DISTORTION_TYPE_Decimated2 6 230 #define ALC_ASA_DISTORTION_TYPE_Decimated3 7 231 #define ALC_ASA_DISTORTION_TYPE_Decimated4 8 232 #define ALC_ASA_DISTORTION_TYPE_DistortedFunk 9 233 #define ALC_ASA_DISTORTION_TYPE_DistortionCubed 10 234 #define ALC_ASA_DISTORTION_TYPE_DistortionSquared 11 235 #define ALC_ASA_DISTORTION_TYPE_Echo1 12 236 #define ALC_ASA_DISTORTION_TYPE_Echo2 13 237 #define ALC_ASA_DISTORTION_TYPE_EchoTight1 14 238 #define ALC_ASA_DISTORTION_TYPE_EchoTight2 15 239 #define ALC_ASA_DISTORTION_TYPE_EverythingBroken 16 240 #define ALC_ASA_DISTORTION_TYPE_AlienChatter 17 241 #define ALC_ASA_DISTORTION_TYPE_CosmicInteference 18 242 #define ALC_ASA_DISTORTION_TYPE_GoldenPi 19 243 #define ALC_ASA_DISTORTION_TYPE_RadioTower 20 244 #define ALC_ASA_DISTORTION_TYPE_Waves 21 245 246 247 248#endif // __MAC_OSX_OAL_EXTENSIONS_H__