Changeset 6046 for code/branches/sound3/src/orxonox/sound/AmbientSound.cc
- Timestamp:
- Nov 11, 2009, 5:55:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound3/src/orxonox/sound/AmbientSound.cc
r6031 r6046 65 65 { 66 66 COUT(3) << this->getSource() << ": Playing" << std::endl; 67 SoundManager::getInstance().registerAmbientSound(this); 68 SUPER(AmbientSound, play); 67 if(GameMode::playsSound()) 68 { 69 SoundManager::getInstance().registerAmbientSound(this); 70 this->BaseSound::play(); 71 } 69 72 } 70 73 71 74 void AmbientSound::replay() 72 75 { 73 SUPER(AmbientSound, play);76 this->BaseSound::play(); 74 77 } 75 78 76 79 void AmbientSound::stop() 77 80 { 78 SUPER(AmbientSound, stop); 79 SoundManager::getInstance().unregisterAmbientSound(this); 81 if(GameMode::playsSound()) 82 { 83 SoundManager::getInstance().unregisterAmbientSound(this); 84 } 80 85 } 81 86 82 void AmbientSound:: pause()87 void AmbientSound::doStop() 83 88 { 84 SUPER(AmbientSound, pause);89 this->BaseSound::stop(); 85 90 } 86 91 87 92 void AmbientSound::setSource(const std::string& source) 88 93 { 89 if(source.find('/') == std::string.npos )94 if(source.find('/') == std::string.npos && GameMode::playsSound()) 90 95 { 91 96 std::string filePath = SoundManager::getInstance().getAmbientPath(source); 92 97 if(!(filePath.empty())) 93 98 { 94 BaseSound::setSource(filePath);99 this->BaseSound::setSource(filePath); 95 100 return; 96 101 } … … 102 107 { 103 108 COUT(3) << this->getSource() << ": ChangedActivity: " << this->isActive() << std::endl; 104 SUPER(AmbientSound, changedActivity);109 this->BaseObject::changedActivity(); 105 110 if(this->isActive()) 106 111 { … … 112 117 } 113 118 } 114 115 119 }
Note: See TracChangeset
for help on using the changeset viewer.