Oolite
Loading...
Searching...
No Matches
OOMusic Class Reference

#include <OOALMusic.h>

Inheritance diagram for OOMusic:
Collaboration diagram for OOMusic:

Instance Methods

(void) - playLooped:
(void) - stop
(BOOL) - isPlaying
(void) - setMusicGain:
(float) - musicGain
(OOSoundSource *) - musicSoundSource
(void) - dealloc [implementation]
(id) - initWithContentsOfFile: [implementation]
(NSString *) - name [implementation]
Instance Methods inherited from OOSound
(ALuint) - soundBuffer
(BOOL) - soundIncomplete
(void) - rewind
(id) - init [implementation]
(id) - initWithDecoder: [implementation]
(id) - initWithCustomSoundKey:
(jsval) - oo_jsValueInContext: [implementation]
(NSString *) - oo_jsDescription [implementation]
(NSString *) - oo_jsClassName [implementation]

Class Methods

(id) + allocWithZone: [implementation]
Class Methods inherited from OOSound
(BOOL) + setUp
(void) + update
(void) + setMasterVolume:
(float) + masterVolume
(BOOL) + isSoundOK
(id) + soundWithCustomSoundKey:

Private Attributes

OOSound * sound

Detailed Description

Definition at line 36 of file OOALMusic.h.

Method Documentation

◆ allocWithZone:

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

Definition at line 36 of file OOALMusic.m.

36 :(NSZone*)inZone
37{
38 return NSAllocateObject([OOMusic class], 0, inZone);
39}

◆ dealloc

- (void) dealloc
implementation

Definition at line 41 of file OOALMusic.m.

42{
43 if (sPlayingMusic == self)
44 [self stop];
45 [sound release];
46
47 [super dealloc];
48}
static OOMusic * sPlayingMusic
Definition OOALMusic.m:31

References dealloc, sPlayingMusic, and stop.

Referenced by dealloc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initWithContentsOfFile:

- (id) initWithContentsOfFile: (NSString*) inPath
implementation

Reimplemented from OOSound.

Definition at line 50 of file OOALMusic.m.

50 :(NSString*)inPath
51{
52 self = [super init];
53 if (nil != self) {
54 sound = [[OOSound alloc] initWithContentsOfFile:inPath];
55 if (nil == sound) {
56 [self release];
57 self = nil;
58 }
59 }
60
61 return self;
62}
return nil
OOSound * sound
Definition OOALMusic.h:38

References OOSound::init, nil, and sound.

Here is the call graph for this function:

◆ isPlaying

- (BOOL) isPlaying

Definition at line 103 of file OOALMusic.m.

104{
105 return sPlayingMusic == self && [sMusicSource isPlaying];
106}

References isPlaying, OOSoundSource::isPlaying, and sPlayingMusic.

Referenced by isPlaying, and OOMusicController::isPlaying.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ musicGain

- (float) musicGain

Definition at line 76 of file OOALMusic.m.

77{
78 if (nil == sMusicSource)
79 return 0.0f;
80 return [sMusicSource gain];
81}
static OOSoundSource * sMusicSource
Definition OOALMusic.m:32

References OOSoundSource::gain, musicGain, nil, and sMusicSource.

Referenced by musicGain.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ musicSoundSource

- (OOSoundSource *) musicSoundSource

Definition at line 98 of file OOALMusic.m.

99{
100 return sMusicSource;
101}

References musicSoundSource, and sMusicSource.

Referenced by musicSoundSource, and OOMusicController::soundSource.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name

- (NSString *) name
implementation

Reimplemented from OOSound.

Definition at line 64 of file OOALMusic.m.

65{
66 return [sound name];
67}

References name, and OOSound::name.

Referenced by name, and OOMusicController::playingMusic.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ playLooped:

- (void) playLooped: (BOOL) looped

Definition at line 83 of file OOALMusic.m.

83 :(BOOL)inLoop
84{
85 if (sPlayingMusic != self) {
86 if (nil == sMusicSource) {
87 sMusicSource = [[OOSoundSource alloc] init];
88 }
90 [sMusicSource setLoop:inLoop];
91 [sMusicSource setSound:sound];
93
94 sPlayingMusic = self;
95 }
96}
void setLoop:(BOOL inLoop)
void setSound:(OOSound *inSound)

References nil, OOSoundSource::play, OOSoundSource::setLoop:, OOSoundSource::setSound:, sMusicSource, sPlayingMusic, and OOSoundSource::stop.

Referenced by OOMusicController::playMusicNamed:loop:gain:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMusicGain:

- (void) setMusicGain: (float) newValue

Definition at line 69 of file OOALMusic.m.

69 :(float)newValue
70{
71 if (nil != sMusicSource) {
72 [sMusicSource setGain:newValue];
73 }
74}
void setGain:(float gain)

References nil, OOSoundSource::setGain:, and sMusicSource.

Referenced by OOMusicController::playMusicNamed:loop:gain:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop

- (void) stop

Definition at line 108 of file OOALMusic.m.

109{
110 if (sPlayingMusic == self) {
114 }
115}

References nil, OOSoundSource::setSound:, sPlayingMusic, stop, and OOSoundSource::stop.

Referenced by dealloc, OOMusicController::justStop, OOMusicController::playMusicNamed:loop:gain:, and stop.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ sound

- (OOSound*) sound
private

Definition at line 38 of file OOALMusic.h.

Referenced by initWithContentsOfFile:.


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