Changeset 10769 for code/branches/cpp11_v2/src/orxonox/sound
- Timestamp:
- Nov 7, 2015, 10:23:42 AM (10 years ago)
- Location:
- code/branches/cpp11_v2/src/orxonox/sound
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/orxonox/sound/SoundBuffer.cc
r10765 r10769 39 39 namespace orxonox 40 40 { 41 SoundBuffer::SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer> 41 SoundBuffer::SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer>>::iterator poolIterator) 42 42 : filename_(filename) 43 43 , audioBuffer_(AL_NONE) -
code/branches/cpp11_v2/src/orxonox/sound/SoundBuffer.h
r10624 r10769 64 64 65 65 private: 66 SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer> 66 SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer>>::iterator poolIterator); 67 67 #if !defined(_MSC_VER) || _MSC_VER >= 1500 68 68 ~SoundBuffer(); … … 73 73 std::string filename_; 74 74 ALuint audioBuffer_; 75 std::list<shared_ptr<SoundBuffer> 75 std::list<shared_ptr<SoundBuffer>>::iterator poolIterator_; 76 76 }; 77 77 } -
code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc
r10765 r10769 422 422 { 423 423 // If we're already fading out --> remove that 424 for (std::list<StrongPtr<AmbientSound> 424 for (std::list<StrongPtr<AmbientSound>>::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++) 425 425 { 426 426 if (*it == sound) … … 438 438 { 439 439 // If we're already fading in --> remove that 440 for (std::list<StrongPtr<AmbientSound> 440 for (std::list<StrongPtr<AmbientSound>>::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++) 441 441 { 442 442 if (*it == sound) … … 461 461 462 462 // FADE IN 463 for (std::list<StrongPtr<AmbientSound> 463 for (std::list<StrongPtr<AmbientSound>>::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); ) 464 464 { 465 465 if ((*it)->getVolume() + this->crossFadeStep_*dt > 1.0f) … … 476 476 477 477 // FADE OUT 478 for (std::list<StrongPtr<AmbientSound> 478 for (std::list<StrongPtr<AmbientSound>>::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); ) 479 479 { 480 480 if ((*it)->getVolume() - this->crossFadeStep_*dt < 0.0f) … … 606 606 #endif 607 607 this->availableSoundSources_.push_back(source); 608 for (std::vector<std::pair<ALuint, BaseSound*> 608 for (std::vector<std::pair<ALuint, BaseSound*>>::iterator it = this->usedSoundSources_.begin(); 609 609 it != this->usedSoundSources_.end(); ++it) 610 610 { -
code/branches/cpp11_v2/src/orxonox/sound/SoundManager.h
r10624 r10769 125 125 126 126 // Ambient sound related 127 typedef std::list<std::pair<AmbientSound*, bool> 127 typedef std::list<std::pair<AmbientSound*, bool>> AmbientList; 128 128 AmbientList ambientSounds_; 129 129 //! Absolute change per second (0.1 means 10% of the nominal volume) for cross fading 130 130 float crossFadeStep_; 131 std::list<StrongPtr<AmbientSound> 132 std::list<StrongPtr<AmbientSound> 131 std::list<StrongPtr<AmbientSound>> fadeInList_; 132 std::list<StrongPtr<AmbientSound>> fadeOutList_; 133 133 134 134 // Volume related … … 139 139 static const unsigned int maxEffectsPoolSize_s = 40 * 1024 * 1024; 140 140 unsigned int effectsPoolSize_; 141 typedef std::list<shared_ptr<SoundBuffer> 141 typedef std::list<shared_ptr<SoundBuffer>> EffectsPoolList; 142 142 EffectsPoolList effectsPool_; 143 typedef std::map<std::string, shared_ptr<SoundBuffer> 143 typedef std::map<std::string, shared_ptr<SoundBuffer>> SoundBufferMap; 144 144 SoundBufferMap soundBuffers_; 145 145 … … 148 148 unsigned int maxSources_; 149 149 std::vector<ALuint> availableSoundSources_; 150 std::vector<std::pair<ALuint, BaseSound*> 150 std::vector<std::pair<ALuint, BaseSound*>> usedSoundSources_; 151 151 152 152 bool bDestructorCalled_; ///< Becomes true if the destructor is called - used to prevent ambient sounds from registering after the lists were cleared
Note: See TracChangeset
for help on using the changeset viewer.