Changeset 6406 for code/branches/presentation2/src/orxonox/sound
- Timestamp:
- Dec 23, 2009, 8:45:56 PM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/sound/AmbientSound.cc
r6394 r6406 35 35 #include "core/XMLPort.h" 36 36 #include "SoundManager.h" 37 #include "MoodManager.h"38 37 39 38 namespace orxonox … … 111 110 { 112 111 this->ambientSource_ = source; 112 this->moodChanged(this->getMood()); 113 } 114 115 void AmbientSound::moodChanged(const std::string& mood) 116 { 113 117 if (GameMode::playsSound()) 114 118 { 115 const std::string& path = "ambient/" + MoodManager::getInstance().getMood() + '/' + source;119 const std::string& path = "ambient/" + MoodManager::getInstance().getMood() + '/' + this->ambientSource_; 116 120 shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path); 117 121 if (fileInfo != NULL) 118 122 this->setSource(path); 119 123 else 120 COUT(3) << "Sound: " << source<< ": Not a valid name! Ambient sound will not change." << std::endl;124 COUT(3) << "Sound: " << this->ambientSource_ << ": Not a valid name! Ambient sound will not change." << std::endl; 121 125 } 122 126 } -
code/branches/presentation2/src/orxonox/sound/AmbientSound.h
r6382 r6406 34 34 35 35 #include "core/BaseObject.h" 36 #include "sound/BaseSound.h"37 36 #include "network/synchronisable/Synchronisable.h" 37 #include "BaseSound.h" 38 #include "MoodManager.h" 38 39 39 40 namespace orxonox … … 44 45 * 45 46 */ 46 class _OrxonoxExport AmbientSound : public BaseSound, public BaseObject, public Synchronisable 47 class _OrxonoxExport AmbientSound : public BaseSound, public BaseObject, public Synchronisable, public MoodListener 47 48 { 48 49 friend class SoundManager; … … 74 75 void registerVariables(); 75 76 float getRealVolume(); 77 void moodChanged(const std::string& mood); 76 78 inline void ambientSourceChanged() 77 79 { this->setAmbientSource(this->ambientSource_); }
Note: See TracChangeset
for help on using the changeset viewer.