PageRenderTime 31ms CodeModel.GetById 18ms app.highlight 8ms RepoModel.GetById 2ms app.codeStats 0ms

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