Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOSoundMixer Class Reference

#include <OOALSoundMixer.h>

+ Inheritance diagram for OOSoundMixer:
+ Collaboration diagram for OOSoundMixer:

Instance Methods

(void) - update
 
(OOSoundChannel *) - popChannel
 
(void) - pushChannel:
 
(id) - init [implementation]
 
(void) - shutdown [implementation]
 
(id) - copyWithZone: [implementation]
 
(id) - retain [implementation]
 
(NSUInteger) - retainCount [implementation]
 
(void) - release [implementation]
 
(id) - autorelease [implementation]
 

Class Methods

(id) + sharedMixer
 
(id) + allocWithZone: [implementation]
 

Protected Attributes

OOSoundChannel_channels [kMixerGeneralChannels]
 
OOSoundChannel_freeList
 
uint32_t _maxChannels
 
uint32_t _playMask
 

Detailed Description

Definition at line 43 of file OOALSoundMixer.h.

Method Documentation

◆ allocWithZone:

+ (id) allocWithZone: (NSZone *) inZone
implementation

Provided by category OOSoundMixer(Singleton).

Definition at line 35 of file OOALSoundMixer.m.

139 :(NSZone *)inZone
140{
141 if (sSingleton == nil)
142 {
143 sSingleton = [super allocWithZone:inZone];
144 return sSingleton;
145 }
146 return nil;
147}
static OODebugMonitor * sSingleton
return nil

◆ autorelease

- (id) autorelease
implementation

Provided by category OOSoundMixer(Singleton).

Definition at line 35 of file OOALSoundMixer.m.

173{
174 return self;
175}

◆ copyWithZone:

- (id) copyWithZone: (NSZone *) inZone
implementation

Provided by category OOSoundMixer(Singleton).

Definition at line 35 of file OOALSoundMixer.m.

150 :(NSZone *)inZone
151{
152 return self;
153}

◆ init

- (id) init
implementation

Definition at line 35 of file OOALSoundMixer.m.

51{
52 BOOL OK = YES;
53 uint32_t idx = 0, count = kMixerGeneralChannels;
54 OOSoundChannel *channel;
55
56 if (!(self = [super init])) return nil;
57 if (![OOSound setUp]) OK = NO;
58
59 if (OK)
60 {
61 // Allocate channels
62 do
63 {
64 channel = [[OOSoundChannel alloc] init];
65 if (nil != channel)
66 {
67 _channels[idx++] = channel;
68 [self pushChannel:channel];
69 }
70 } while (--count);
71 }
72
73 if (!OK)
74 {
75 [super release];
76// static analyser complains about this next line; probably nothing - CIM
77 self = nil;
78 }
79 else
80 {
81 sSingleton = self;
82 }
83
84 return sSingleton;
85}
@ kMixerGeneralChannels
unsigned count
OOSoundChannel * _channels[kMixerGeneralChannels]

◆ popChannel

- (OOSoundChannel *) popChannel

Definition at line 35 of file OOALSoundMixer.m.

110{
111 OOSoundChannel *channel = _freeList;
112 _freeList = [channel next];
113 [channel setNext:nil];
114
115 return channel;
116}
OOSoundChannel * next()
void setNext:(OOSoundChannel *next)
OOSoundChannel * _freeList

◆ pushChannel:

- (void) pushChannel: (OOSoundChannel *) channel

Definition at line 35 of file OOALSoundMixer.m.

119 :(OOSoundChannel *)channel
120{
121 assert(channel != nil);
122
123 [channel setNext:_freeList];
124 _freeList = channel;
125}

◆ release

- (void) release
implementation

Provided by category OOSoundMixer(Singleton).

Definition at line 35 of file OOALSoundMixer.m.

169{}

◆ retain

- (id) retain
implementation

Provided by category OOSoundMixer(Singleton).

Definition at line 35 of file OOALSoundMixer.m.

157{
158 return self;
159}

◆ retainCount

- (NSUInteger) retainCount
implementation

Provided by category OOSoundMixer(Singleton).

Definition at line 35 of file OOALSoundMixer.m.

163{
164 return UINT_MAX;
165}

◆ sharedMixer

+ (id) sharedMixer

Definition at line 35 of file OOALSoundMixer.m.

41{
42 if (nil == sSingleton)
43 {
44 [[self alloc] init];
45 }
46 return sSingleton;
47}

◆ shutdown

- (void) shutdown
implementation

Definition at line 35 of file OOALSoundMixer.m.

90{
91 uint32_t i;
92 for (i = 0; i < kMixerGeneralChannels; ++i)
93 {
95 }
96}
#define DESTROY(x)
Definition OOCocoa.h:77

◆ update

- (void) update

Definition at line 35 of file OOALSoundMixer.m.

100{
101 uint32_t i;
102 for (i = 0; i < kMixerGeneralChannels; ++i)
103 {
104 [_channels[i] update];
105 }
106}

Member Data Documentation

◆ _channels

- (OOSoundChannel* _channels[kMixerGeneralChannels])
protected

Definition at line 45 of file OOALSoundMixer.h.

◆ _freeList

- (OOSoundChannel*) _freeList
protected

Definition at line 46 of file OOALSoundMixer.h.

◆ _maxChannels

- (uint32_t) _maxChannels
protected

Definition at line 48 of file OOALSoundMixer.h.

◆ _playMask

- (uint32_t) _playMask
protected

Definition at line 49 of file OOALSoundMixer.h.


The documentation for this class was generated from the following files: