00001
00002
00003
00004
00005
00006
00007
00008
00009 #import "SoundPlayerForMacTrek.h"
00010
00011
00012 @implementation SoundPlayerForMacTrek
00013
00014 - (void) subscibeToNotifications {
00015
00016 [super subscibeToNotifications];
00017
00018 [notificationCenter addObserver:self selector:@selector(handleTransporter) name:@"SPW_BEAMUP2_TEXT"];
00019 [notificationCenter addObserver:self selector:@selector(handleTransporter) name:@"SPW_BEAM_D_PLANET_TEXT"];
00020 [notificationCenter addObserver:self selector:@selector(handleTransporter) name:@"SPW_BEAM_U_TEXT"];
00021 }
00022
00023 - (void) loadSounds {
00024
00025 [super loadSounds];
00026
00027 SoundEffect *sound;
00028
00029 sound = [[SoundEffect alloc] init];
00030 [sound loadSoundWithName:@"SoundEffects2/transporter"];
00031 [soundEffects setObject:sound forKey:@"TRANSPORTER_SOUND"];
00032 }
00033
00034 - (void) handleTransporter {
00035 [self playSoundEffect:@"TRANSPORTER_SOUND"];
00036 }
00037
00038 @end