42@interface OOSoundSourcePool (Private)
44- (uint8_t)selectSlotForPriority:(
float)priority;
50+ (instancetype)poolWithCount:(uint8_t)count minRepeatTime:(
OOTimeDelta)minRepeat
52 return [[[
self alloc] initWithCount:count minRepeatTime:minRepeat] autorelease];
55- (id)initWithCount:(uint8_t)count minRepeatTime:(
OOTimeDelta)minRepeat
57 if ((
self = [super init])) {
84 for (i = 0; i !=
_count; i++) {
94- (void)playSoundWithKey:(NSString*)key
95 priority:(
float)priority
106 now = [UNIVERSE getTime];
107 absExpiryTime = expiryTime + now;
140 [
element->source setPosition:position];
141 [
element->source playSound:sound];
154- (void)playSoundWithKey:(NSString*)key
155 priority:(
float)priority
165- (void)playSoundWithKey:(NSString*)key
166 priority:(
float)priority
176- (void)playSoundWithKey:(NSString*)key
177 priority:(
float)priority
184- (void)playSoundWithKey:(NSString*)key
189- (void)playSoundWithKey:(NSString*)key position:(
Vector)position
194- (void)playSoundWithKey:(NSString*)key overlap:(BOOL)overlap
203- (void)playSoundWithKey:(NSString*)key overlap:(BOOL)overlap position:(
Vector)position
214@implementation OOSoundSourcePool (Private)
216- (uint8_t)selectSlotForPriority:(
float)priority
222#define NEXT(x) (((x) + 1) % _count)
228 element = &_sources[
curr];
232 else if (element->
priority < priority) {
235 else if (curr != _reserved)
236 unexpiredLower = curr;
245 return unexpiredLower;
struct OOSoundSourcePoolElement PoolElement
uint8_t selectSlotForPriority:(float priority)
void playSoundWithKey:priority:expiryTime:overlap:position:(NSString *key,[priority] float priority,[expiryTime] OOTimeDelta expiryTime,[overlap] BOOL overlap,[position] Vector position)
void playSoundWithKey:priority:position:(NSString *key,[priority] float priority,[position] Vector position)
void playSoundWithKey:priority:expiryTime:(NSString *key,[priority] float priority,[expiryTime] OOTimeDelta expiryTime)
struct OOSoundSourcePoolElement * _sources
OOTimeAbsolute _nextRepeat
void playSoundWithKey:priority:(NSString *key,[priority] float priority)
id soundWithCustomSoundKey:(NSString *key)
OOTimeAbsolute expiryTime