oalMacOSX_OALExtensions.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /**********************************************************************************************************************************
  2. *
  3. * OpenAL cross platform audio library
  4. * Copyright (c) 2004-2006, Apple Computer, Inc. All rights reserved.
  5. * Copyright (c) 2007-2008, Apple Inc. All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
  8. * conditions are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
  12. * disclaimer in the documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of Apple Inc. ("Apple") nor the names of its contributors may be used to endorse or promote products derived
  14. * from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  17. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS
  18. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  19. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  20. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  21. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. *
  23. **********************************************************************************************************************************/
  24. #ifndef __OAL_MAC_OSX_OAL_EXTENSIONS_H__
  25. #define __OAL_MAC_OSX_OAL_EXTENSIONS_H__
  26. #include <OpenAL/al.h>
  27. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  29. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  30. ALC_EXT_MAC_OSX
  31. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  32. // Retrieve functions via alGetProcAddress() by passing in strings: alcMacOSXMixerOutputRate or alcMacOSXGetMixerOutputRate
  33. // Setting the Mixer Output Rate effectively sets the samnple rate at which the mixer
  34. typedef ALvoid (*alcMacOSXRenderingQualityProcPtr) (ALint value);
  35. typedef ALvoid (*alMacOSXRenderChannelCountProcPtr) (ALint value);
  36. typedef ALvoid (*alcMacOSXMixerMaxiumumBussesProcPtr) (ALint value);
  37. typedef ALvoid (*alcMacOSXMixerOutputRateProcPtr) (ALdouble value);
  38. typedef ALint (*alcMacOSXGetRenderingQualityProcPtr) ();
  39. typedef ALint (*alMacOSXGetRenderChannelCountProcPtr) ();
  40. typedef ALint (*alcMacOSXGetMixerMaxiumumBussesProcPtr) ();
  41. typedef ALdouble (*alcMacOSXGetMixerOutputRateProcPtr) ();
  42. /* Render Quality. Used with alcMacOSXRenderingQuality() */
  43. #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_HIGH 'rqhi'
  44. #define ALC_MAC_OSX_SPATIAL_RENDERING_QUALITY_LOW 'rdlo'
  45. // High Quality Spatial Algorithm suitable only for headphone use
  46. #define ALC_IPHONE_SPATIAL_RENDERING_QUALITY_HEADPHONES 'hdph'
  47. /*
  48. Render Channels. Used with alMacOSXRenderChannelCount()
  49. Allows a user to force OpenAL to render to stereo, regardless of the audio hardware being used
  50. */
  51. #define ALC_MAC_OSX_RENDER_CHANNEL_COUNT_STEREO 'rcst'
  52. /* GameKit extension */
  53. #define AL_GAMEKIT 'gksr'
  54. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. AL_EXT_SOURCE_NOTIFICATIONS
  56. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  57. /*
  58. Source Notifications
  59. Eliminates the need for continuous polling for source state by providing a
  60. mechanism for the application to receive source state change notifications.
  61. Upon receiving a notification, the application can retrieve the actual state
  62. corresponding to the notification ID for which the notification was sent.
  63. */
  64. #define AL_QUEUE_HAS_LOOPED 0x9000
  65. /*
  66. Notification Proc: ALSourceNotificationProc
  67. sid - source id
  68. notificationID - id of state that has changed
  69. userData - user data provided to alSourceAddNotification()
  70. */
  71. typedef ALvoid (*alSourceNotificationProc)(ALuint sid, ALuint notificationID, ALvoid* userData);
  72. /*
  73. API: alSourceAddNotification
  74. sid - source id
  75. notificationID - id of state for which caller wants to be notified of a change
  76. notifyProc - notification proc
  77. userData - ptr to applications user data, will be returned in the notification proc
  78. Returns AL_NO_ERROR if request is successful.
  79. Valid IDs:
  80. AL_SOURCE_STATE
  81. AL_BUFFERS_PROCESSED
  82. AL_QUEUE_HAS_LOOPED - notification sent when a looping source has looped to it's start point
  83. */
  84. typedef ALenum (*alSourceAddNotificationProcPtr) (ALuint sid, ALuint notificationID, alSourceNotificationProc notifyProc, ALvoid* userData);
  85. /*
  86. API: alSourceRemoveStateNotification
  87. sid - source id
  88. notificationID - id of state for which caller wants to remove an existing notification
  89. notifyProc - notification proc
  90. userData - ptr to applications user data, will be returned in the notification proc
  91. */
  92. typedef ALvoid (*alSourceRemoveNotificationProcPtr) (ALuint sid, ALuint notificationID, alSourceNotificationProc notifyProc, ALvoid* userData);
  93. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94. ALC_EXT_ASA : Apple Spatial Audio Extension
  95. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
  96. /*
  97. Used with the ASA API calls: alcASAGetSource(), alcASASetSource(), alcASAGetListener(), alcASASetListener()
  98. */
  99. typedef ALenum (*alcASAGetSourceProcPtr) (ALuint property, ALuint source, ALvoid *data, ALuint* dataSize);
  100. typedef ALenum (*alcASASetSourceProcPtr) (ALuint property, ALuint source, ALvoid *data, ALuint dataSize);
  101. typedef ALenum (*alcASAGetListenerProcPtr) (ALuint property, ALvoid *data, ALuint* dataSize);
  102. typedef ALenum (*alcASASetListenerProcPtr) (ALuint property, ALvoid *data, ALuint dataSize);
  103. /* listener properties */
  104. #define ALC_ASA_REVERB_ON 'rvon' // type ALuint
  105. #define ALC_ASA_REVERB_GLOBAL_LEVEL 'rvgl' // type ALfloat -40.0 db - 40.0 db
  106. #define ALC_ASA_REVERB_ROOM_TYPE 'rvrt' // type ALint
  107. /* reverb room type presets for the ALC_ASA_REVERB_ROOM_TYPE property */
  108. #define ALC_ASA_REVERB_ROOM_TYPE_SmallRoom 0
  109. #define ALC_ASA_REVERB_ROOM_TYPE_MediumRoom 1
  110. #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom 2
  111. #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall 3
  112. #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall 4
  113. #define ALC_ASA_REVERB_ROOM_TYPE_Plate 5
  114. #define ALC_ASA_REVERB_ROOM_TYPE_MediumChamber 6
  115. #define ALC_ASA_REVERB_ROOM_TYPE_LargeChamber 7
  116. #define ALC_ASA_REVERB_ROOM_TYPE_Cathedral 8
  117. #define ALC_ASA_REVERB_ROOM_TYPE_LargeRoom2 9
  118. #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall2 10
  119. #define ALC_ASA_REVERB_ROOM_TYPE_MediumHall3 11
  120. #define ALC_ASA_REVERB_ROOM_TYPE_LargeHall2 12
  121. #define ALC_ASA_REVERB_EQ_GAIN 'rveg' // type ALfloat
  122. #define ALC_ASA_REVERB_EQ_BANDWITH 'rveb' // type ALfloat
  123. #define ALC_ASA_REVERB_EQ_FREQ 'rvef' // type ALfloat
  124. /* source properties */
  125. #define ALC_ASA_REVERB_SEND_LEVEL 'rvsl' // type ALfloat 0.0 (dry) - 1.0 (wet) (0-100% dry/wet mix, 0.0 default)
  126. #define ALC_ASA_OCCLUSION 'occl' // type ALfloat -100.0 db (most occlusion) - 0.0 db (no occlusion, 0.0 default)
  127. #define ALC_ASA_OBSTRUCTION 'obst' // type ALfloat -100.0 db (most obstruction) - 0.0 db (no obstruction, 0.0 default)
  128. #endif // __OAL_MAC_OSX_OAL_EXTENSIONS_H__