Changeset 2950 for code/branches/sound/src/orxonox
- Timestamp:
- May 4, 2009, 3:40:08 PM (16 years ago)
- Location:
- code/branches/sound/src/orxonox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sound/src/orxonox/CMakeLists.txt
r2748 r2950 58 58 core 59 59 network 60 #audio60 sound 61 61 ) 62 62 -
code/branches/sound/src/orxonox/objects/Level.cc
r2826 r2950 77 77 XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode); 78 78 XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype"); 79 80 XMLPortParamLoadOnly(Level, "ambientsound", loadAmbientSound, xmlelement, mode); 79 81 80 82 XMLPortObjectExtended(Level, BaseObject, "", addObject, getObject, xmlelement, mode, true, false); … … 148 150 } 149 151 152 void Level::loadAmbientSound(const std::string& filename) 153 { 154 if(filename == "") return; 155 else 156 { 157 if(this->ambientsound_ == NULL) 158 { 159 this->ambientsound_ = new SoundBase(); 160 this->sndmgr_.addSound(this->ambientsound_); 161 } 162 163 this->ambientsound_->loadFile(filename); 164 this->ambientsound_->play(); 165 } 166 } 167 150 168 void Level::playerEntered(PlayerInfo* player) 151 169 { -
code/branches/sound/src/orxonox/objects/Level.h
r2826 r2950 33 33 34 34 #include "network/synchronisable/Synchronisable.h" 35 #include "sound/SoundBase.h" 36 #include "sound/SoundManager.h" 35 37 #include "core/BaseObject.h" 36 38 … … 50 52 inline const std::string& getDescription() const 51 53 { return this->description_; } 54 55 void loadAmbientSound(const std::string& filename); 52 56 53 57 void playerEntered(PlayerInfo* player); … … 69 73 XMLFile* xmlfile_; 70 74 std::list<BaseObject*> objects_; 75 SoundManager sndmgr_; 76 SoundBase* ambientsound_; 71 77 }; 72 78 }
Note: See TracChangeset
for help on using the changeset viewer.