/libs/ObjectAL/Actions/OALAudioActions.h

http://github.com/kstenerud/ObjectAL-for-iPhone · C Header · 237 lines · 65 code · 51 blank · 121 comment · 0 complexity · a2e79b21f751ed66822aad2433d3e913 MD5 · raw file

  1. //
  2. // OALAudioActions.h
  3. // ObjectAL
  4. //
  5. // Created by Karl Stenerud on 10-10-10.
  6. //
  7. // Copyright 2010 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 "OALAction.h"
  27. #import "ALTypes.h"
  28. #pragma mark OALGainAction
  29. /**
  30. * A function-based action that modifies the target's gain.
  31. * The target's gain poperty is assumed to be a float, accepting values
  32. * from 0.0 (no sound) to 1.0 (max gain).
  33. */
  34. @interface OALGainAction: OALFunctionAction
  35. {
  36. }
  37. @end
  38. #pragma mark -
  39. #pragma mark OALPitchAction
  40. /**
  41. * A function-based action that modifies the target's pitch.
  42. * The target's pitch property is assumed to be a float, with
  43. * 1.0 representing normal pitch, and lower values giving lower pitch.
  44. */
  45. @interface OALPitchAction: OALFunctionAction
  46. {
  47. }
  48. @end
  49. #pragma mark -
  50. #pragma mark OALPanAction
  51. /**
  52. * A function-based action that modifies the target's pan.
  53. * The target's pan property is assumed to be a float, accepting values
  54. * from -1.0 (max left) to 1.0 (max right).
  55. */
  56. @interface OALPanAction: OALFunctionAction
  57. {
  58. }
  59. @end
  60. #pragma mark -
  61. #pragma mark OALPlaceAction
  62. /**
  63. * Places the target at the specified position.
  64. */
  65. @interface OALPlaceAction : OALAction
  66. {
  67. ALPoint position;
  68. }
  69. #pragma mark Properties
  70. /** The position where the target will be placed. */
  71. @property(readwrite,assign,nonatomic) ALPoint position;
  72. #pragma mark Object Management
  73. /** Create an action with the specified position.
  74. *
  75. * @param position The position to place the target at.
  76. * @return A new action.
  77. */
  78. + (id) actionWithPosition:(ALPoint) position;
  79. /** Initialize an action with the specified position.
  80. *
  81. * @param position The position to place the target at.
  82. * @return The initialized action.
  83. */
  84. - (id) initWithPosition:(ALPoint) position;
  85. @end
  86. #pragma mark -
  87. #pragma mark OALMoveToAction
  88. /**
  89. * Moves the target from its current position to the specified
  90. * position over time in 3D space.
  91. */
  92. @interface OALMoveToAction : OALAction
  93. {
  94. float unitsPerSecond;
  95. /** The point this move is starting at. */
  96. ALPoint startPoint;
  97. ALPoint position;
  98. /** The distance being moved. */
  99. ALPoint delta;
  100. }
  101. #pragma mark Properties
  102. /** The position to move the target to. */
  103. @property(readwrite,assign,nonatomic) ALPoint position;
  104. /** The speed at which to move the target.
  105. * If this is 0, the target will be moved at the speed determined by duration.
  106. */
  107. @property(readwrite,assign,nonatomic) float unitsPerSecond;
  108. #pragma mark Object Management
  109. /** Create a new action.
  110. *
  111. * @param duration The duration of the move.
  112. * @param position The position to move to.
  113. * @return A new action.
  114. */
  115. + (id) actionWithDuration:(float) duration position:(ALPoint) position;
  116. /** Create a new action.
  117. *
  118. * @param unitsPerSecond The rate of movement.
  119. * @param position The position to move to.
  120. * @return A new action.
  121. */
  122. + (id) actionWithUnitsPerSecond:(float) unitsPerSecond position:(ALPoint) position;
  123. /** Initialize an action.
  124. *
  125. * @param duration The duration of the move.
  126. * @param position The position to move to.
  127. * @return The initialized action.
  128. */
  129. - (id) initWithDuration:(float) duration position:(ALPoint) position;
  130. /** Initialize an action.
  131. *
  132. * @param unitsPerSecond The rate of movement.
  133. * @param position The position to move to.
  134. * @return The initialized action.
  135. */
  136. - (id) initWithUnitsPerSecond:(float) unitsPerSecond position:(ALPoint) position;
  137. @end
  138. #pragma mark -
  139. #pragma mark OALMoveByAction
  140. /**
  141. * Moves the target from its current position by the specified
  142. * delta over time in 3D space.
  143. */
  144. @interface OALMoveByAction : OALAction
  145. {
  146. float unitsPerSecond;
  147. /** The point this move is starting at. */
  148. ALPoint startPoint;
  149. ALPoint delta;
  150. }
  151. #pragma mark Properties
  152. /** The amount to move the target by. */
  153. @property(readwrite,assign,nonatomic) ALPoint delta;
  154. /** The speed at which to move the target.
  155. * If this is 0, the target will be moved at the speed determined by duration.
  156. */
  157. @property(readwrite,assign,nonatomic) float unitsPerSecond;
  158. /** Create a new action.
  159. *
  160. * @param duration The duration of the move.
  161. * @param delta The amount to move by.
  162. * @return A new action.
  163. */
  164. + (id) actionWithDuration:(float) duration delta:(ALPoint) delta;
  165. /** Create a new action.
  166. *
  167. * @param unitsPerSecond The rate of movement.
  168. * @param delta The amount to move by.
  169. * @return A new action.
  170. */
  171. + (id) actionWithUnitsPerSecond:(float) unitsPerSecond delta:(ALPoint) delta;
  172. /** Initialize an action.
  173. *
  174. * @param duration The duration of the move.
  175. * @param delta The amount to move by.
  176. * @return The initialized action.
  177. */
  178. - (id) initWithDuration:(float) duration delta:(ALPoint) delta;
  179. /** Initialize an action.
  180. *
  181. * @param unitsPerSecond The rate of movement.
  182. * @param delta The amount to move by.
  183. * @return The initialized action.
  184. */
  185. - (id) initWithUnitsPerSecond:(float) unitsPerSecond delta:(ALPoint) delta;
  186. @end