Changeset 10555 for code/branches/core7/src/orxonox/sound
- Timestamp:
- Aug 29, 2015, 5:35:59 PM (9 years ago)
- Location:
- code/branches/core7/src/orxonox/sound
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/orxonox/sound/AmbientSound.cc
r10380 r10555 51 51 if (GameMode::playsSound()) 52 52 { 53 // Smoothly fade out by keeping a S martPtr53 // Smoothly fade out by keeping a StrongPtr 54 54 SoundManager::getInstance().unregisterAmbientSound(this); 55 55 } -
code/branches/core7/src/orxonox/sound/SoundBuffer.h
r6764 r10555 46 46 friend class SoundManager; 47 47 #if !defined(_MSC_VER) || _MSC_VER >= 1500 48 // Make sure nobody deletes an instance (using s martpointers)48 // Make sure nobody deletes an instance (using strong pointers) 49 49 template <class T> 50 50 friend void boost::checked_delete(T*); -
code/branches/core7/src/orxonox/sound/SoundManager.cc
r10464 r10555 165 165 SoundManager::~SoundManager() 166 166 { 167 // Erase fade lists because of the s martpointers167 // Erase fade lists because of the strong pointers 168 168 this->bDestructorCalled_ = true; 169 169 this->fadeInList_.clear(); … … 419 419 } 420 420 421 void SoundManager::fadeIn(const S martPtr<AmbientSound>& sound)421 void SoundManager::fadeIn(const StrongPtr<AmbientSound>& sound) 422 422 { 423 423 // If we're already fading out --> remove that 424 for (std::list<S martPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++)424 for (std::list<StrongPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); it++) 425 425 { 426 426 if (*it == sound) … … 435 435 } 436 436 437 void SoundManager::fadeOut(const S martPtr<AmbientSound>& sound)437 void SoundManager::fadeOut(const StrongPtr<AmbientSound>& sound) 438 438 { 439 439 // If we're already fading in --> remove that 440 for (std::list<S martPtr<AmbientSound> >::iterator it = this->fadeInList_.begin(); it != this->fadeInList_.end(); it++)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<S martPtr<AmbientSound> >::iterator it= this->fadeInList_.begin(); it != this->fadeInList_.end(); )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<S martPtr<AmbientSound> >::iterator it = this->fadeOutList_.begin(); it != this->fadeOutList_.end(); )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) -
code/branches/core7/src/orxonox/sound/SoundManager.h
r10413 r10555 40 40 #include "util/Singleton.h" 41 41 #include "core/config/Configurable.h" 42 #include "core/object/S martPtr.h"42 #include "core/object/StrongPtr.h" 43 43 #include "core/UpdateListener.h" 44 44 … … 106 106 private: 107 107 void processCrossFading(float dt); 108 void fadeIn(const S martPtr<AmbientSound>& sound);109 void fadeOut(const S martPtr<AmbientSound>& sound);108 void fadeIn(const StrongPtr<AmbientSound>& sound); 109 void fadeOut(const StrongPtr<AmbientSound>& sound); 110 110 111 111 void checkFadeStepValidity(); … … 129 129 //! Absolute change per second (0.1 means 10% of the nominal volume) for cross fading 130 130 float crossFadeStep_; 131 std::list<S martPtr<AmbientSound> > fadeInList_;132 std::list<S martPtr<AmbientSound> > fadeOutList_;131 std::list<StrongPtr<AmbientSound> > fadeInList_; 132 std::list<StrongPtr<AmbientSound> > fadeOutList_; 133 133 134 134 // Volume related
Note: See TracChangeset
for help on using the changeset viewer.