/libs/ObjectAL/OpenAL/ALCaptureDevice.h

http://github.com/kstenerud/ObjectAL-for-iPhone · C Header · 137 lines · 31 code · 27 blank · 79 comment · 0 complexity · a21d3669f939240be2f9ee1dd1217b19 MD5 · raw file

  1. //
  2. // ALCaptureDevice.h
  3. // ObjectAL
  4. //
  5. // Created by Karl Stenerud on 10-01-11.
  6. //
  7. // Copyright 2009 Karl Stenerud
  8. //
  9. // Licensed under the Apache License, Version 2.0 (the "License");
  10. // you may not use this file except in compliance with the License.
  11. // You may obtain a copy of the License at
  12. //
  13. // http://www.apache.org/licenses/LICENSE-2.0
  14. //
  15. // Unless required by applicable law or agreed to in writing, software
  16. // distributed under the License is distributed on an "AS IS" BASIS,
  17. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. // See the License for the specific language governing permissions and
  19. // limitations under the License.
  20. //
  21. // Note: You are NOT required to make the license available from within your
  22. // iOS application. Including it in your project is sufficient.
  23. //
  24. // Attribution is not required, but appreciated :)
  25. //
  26. #import <Foundation/Foundation.h>
  27. #import <OpenAL/alc.h>
  28. #pragma mark ALCaptureDevice
  29. /**
  30. * *UNIMPLEMENTED FOR IOS* An OpenAL device for capturing sound data.
  31. * Note: This functionality is NOT implemented in iOS OpenAL! <br>
  32. * This class is a placeholder in case such functionality is added in a future iOS SDK.
  33. */
  34. @interface ALCaptureDevice : NSObject
  35. {
  36. ALCdevice* device;
  37. }
  38. #pragma mark Properties
  39. /** The number of capture samples available. */
  40. @property(readonly) int captureSamples;
  41. /** The OpenAL device pointer. */
  42. @property(readonly) ALCdevice* device;
  43. /** List of strings describing all extensions available on this device (NSString*). */
  44. @property(readonly) NSArray* extensions;
  45. /** The specification revision for this implementation (major version). */
  46. @property(readonly) int majorVersion;
  47. /** The specification revision for this implementation (minor version). */
  48. @property(readonly) int minorVersion;
  49. #pragma mark Object Management
  50. /** Open the specified device.
  51. *
  52. * @param deviceSpecifier The name of the device to open (nil = default device).
  53. * @param frequency The frequency to capture at.
  54. * @param format The audio format to capture as.
  55. * @param bufferSize The size of buffer that the device must allocate for audio capture.
  56. * @return A new capture device.
  57. */
  58. + (id) deviceWithDeviceSpecifier:(NSString*) deviceSpecifier
  59. frequency:(ALCuint) frequency
  60. format:(ALCenum) format
  61. bufferSize:(ALCsizei) bufferSize;
  62. /** Open the specified device.
  63. *
  64. * @param deviceSpecifier The name of the device to open (nil = default device).
  65. * @param frequency The frequency to capture at.
  66. * @param format The audio format to capture as.
  67. * @param bufferSize The size of buffer that the device must allocate for audio capture.
  68. * @return The initialized capture device.
  69. */
  70. - (id) initWithDeviceSpecifier:(NSString*) deviceSpecifier
  71. frequency:(ALCuint) frequency
  72. format:(ALCenum) format
  73. bufferSize:(ALCsizei) bufferSize;
  74. /** Close any OS resources in use by this object.
  75. * Any operations called on this object after closing will likely fail.
  76. */
  77. - (void) close;
  78. #pragma mark Audio Capture
  79. /** Start capturing samples.
  80. *
  81. * @return TRUE if the operation was successful.
  82. */
  83. - (bool) startCapture;
  84. /** Stop capturing samples.
  85. *
  86. * @return TRUE if the operation was successful.
  87. */
  88. - (bool) stopCapture;
  89. /** Move captured samples to the specified buffer.
  90. * This method will fail if less than the specified number of samples have been captured.
  91. *
  92. * @param numSamples The number of samples to move.
  93. * @param buffer the buffer to move the samples into.
  94. * @return TRUE if the operation was successful.
  95. */
  96. - (bool) moveSamples:(ALCsizei) numSamples toBuffer:(ALCvoid*) buffer;
  97. #pragma mark Extensions
  98. /** Check if the specified extension is present.
  99. *
  100. * @param name The name of the extension to check.
  101. * @return TRUE if the extension is present.
  102. */
  103. - (bool) isExtensionPresent:(NSString*) name;
  104. /** Get the address of the specified procedure (C function address).
  105. *
  106. * @param functionName The name of the procedure to get.
  107. * @return the procedure's address, or NULL if it wasn't found.
  108. */
  109. - (void*) getProcAddress:(NSString*) functionName;
  110. @end