Changeset 11071 for code/trunk/src/orxonox/sound
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/sound/AmbientSound.cc
r10624 r11071 92 92 { 93 93 const std::string& path = "ambient/" + mood + '/' + this->ambientSource_; 94 s hared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path);95 if (fileInfo != NULL)94 std::shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(path); 95 if (fileInfo != nullptr) 96 96 { 97 97 orxout(user_info) << "Loading ambient sound " << path << "..." << endl; // TODO: make this output internal if we implement sound streaming -
code/trunk/src/orxonox/sound/AmbientSound.h
r9939 r11071 50 50 AmbientSound(); 51 51 52 v oid play();53 bool stop();54 v oid pause();52 virtual void play() override; 53 virtual bool stop() override; 54 virtual void pause() override; 55 55 56 56 bool setAmbientSource(const std::string& source); … … 66 66 67 67 private: 68 v oid preDestroy();69 float getRealVolume();70 bool moodChanged(const std::string& mood);68 virtual void preDestroy() override; 69 virtual float getRealVolume() override; 70 virtual bool moodChanged(const std::string& mood) override; 71 71 inline void ambientSourceChanged() 72 72 { this->setAmbientSource(this->ambientSource_); } -
code/trunk/src/orxonox/sound/BaseSound.cc
r10624 r11071 49 49 , volume_(0.7) 50 50 , bLooping_(false) 51 , state_(St opped)51 , state_(State::Stopped) 52 52 , pitch_ (1.0) 53 53 { … … 63 63 BaseSound::~BaseSound() 64 64 { 65 if (this->state_ != St opped)65 if (this->state_ != State::Stopped) 66 66 this->stop(); 67 67 // Release buffer 68 if (this->soundBuffer_ != NULL)68 if (this->soundBuffer_ != nullptr) 69 69 { 70 70 assert(GameMode::playsSound()); … … 83 83 void BaseSound::doPlay() 84 84 { 85 this->state_ = Playing;86 if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != NULL)85 this->state_ = State::Playing; 86 if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != nullptr) 87 87 { 88 88 if (!alIsSource(this->audioSource_)) … … 102 102 bool BaseSound::doStop() 103 103 { 104 this->state_ = St opped;104 this->state_ = State::Stopped; 105 105 if (alIsSource(this->audioSource_)) 106 106 { … … 123 123 if (this->isStopped()) 124 124 return; 125 this->state_ = Paused;125 this->state_ = State::Paused; 126 126 if (alIsSource(this->audioSource_)) 127 127 alSourcePause(this->audioSource_); … … 151 151 orxout(internal_warning, context::sound) << "Setting source parameters to 0 failed: " 152 152 << SoundManager::getALErrorString(error) << endl; 153 assert(this->soundBuffer_ != NULL);153 assert(this->soundBuffer_ != nullptr); 154 154 alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer()); 155 155 if (ALuint error = alGetError()) … … 209 209 } 210 210 211 if (this->soundBuffer_ != NULL)211 if (this->soundBuffer_ != nullptr) 212 212 { 213 213 if (this->soundBuffer_->getFilename() == source) … … 233 233 // Get new sound buffer 234 234 this->soundBuffer_ = SoundManager::getInstance().getSoundBuffer(this->source_); 235 if (this->soundBuffer_ == NULL)235 if (this->soundBuffer_ == nullptr) 236 236 return; 237 237 … … 256 256 else // No source acquired so far, but might be set to playing or paused 257 257 { 258 State state = static_cast<State>(this->state_); // save258 State state = this->state_; // save 259 259 if (this->isPlaying() || this->isPaused()) 260 260 doPlay(); 261 if (state == Paused)262 { 263 this->state_ = Paused;261 if (state == State::Paused) 262 { 263 this->state_ = State::Paused; 264 264 doPause(); 265 265 } … … 271 271 switch (this->state_) 272 272 { 273 case Playing:273 case State::Playing: 274 274 this->play(); 275 275 break; 276 case Paused:276 case State::Paused: 277 277 this->pause(); 278 278 break; 279 case St opped:279 case State::Stopped: 280 280 default: 281 281 this->stop(); -
code/trunk/src/orxonox/sound/BaseSound.h
r9667 r11071 33 33 34 34 #include <string> 35 #include < boost/shared_ptr.hpp>35 #include <memory> 36 36 #include <OgreDataStream.h> 37 37 #include "core/object/Listable.h" … … 54 54 virtual void pause() { this->doPause(); } 55 55 56 bool isPlaying() const { return this->state_ == Playing; }57 bool isPaused() const { return this->state_ == Paused; }58 bool isStopped() const { return this->state_ == St opped; }56 bool isPlaying() const { return this->state_ == State::Playing; } 57 bool isPaused() const { return this->state_ == State::Paused; } 58 bool isStopped() const { return this->state_ == State::Stopped; } 59 59 60 60 virtual void setSource(const std::string& source); … … 76 76 77 77 protected: 78 enum State78 enum class State 79 79 { 80 80 Stopped, … … 107 107 ALuint audioSource_; 108 108 bool bPooling_; 109 s hared_ptr<SoundBuffer> soundBuffer_;109 std::shared_ptr<SoundBuffer> soundBuffer_; 110 110 std::string source_; 111 111 float volume_; 112 112 bool bLooping_; 113 uint8_tstate_; // This Variable is actually of type State113 State state_; // This Variable is actually of type State 114 114 float pitch_; 115 115 -
code/trunk/src/orxonox/sound/SoundBuffer.cc
r8858 r11071 39 39 namespace orxonox 40 40 { 41 SoundBuffer::SoundBuffer(const std::string& filename, std::list<s hared_ptr<SoundBuffer>>::iterator poolIterator)41 SoundBuffer::SoundBuffer(const std::string& filename, std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator) 42 42 : filename_(filename) 43 43 , audioBuffer_(AL_NONE) … … 45 45 { 46 46 if (this->filename_.empty()) 47 ThrowException(General, "SoundBuffer construction: fileInfo was NULL");47 ThrowException(General, "SoundBuffer construction: fileInfo was nullptr"); 48 48 49 49 // Get resource info 50 s hared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename);51 if (fileInfo == NULL)50 std::shared_ptr<ResourceInfo> fileInfo = Resource::getInfo(filename); 51 if (fileInfo == nullptr) 52 52 { 53 53 orxout(internal_error, context::sound) << "Sound file '" << filename << "' not found" << endl; … … 83 83 } 84 84 85 void SoundBuffer::loadStandard(const s hared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)85 void SoundBuffer::loadStandard(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream) 86 86 { 87 87 // Read everything into a temporary buffer … … 127 127 } 128 128 129 void SoundBuffer::loadOgg(const s hared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream)129 void SoundBuffer::loadOgg(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream) 130 130 { 131 131 char inbuffer[256*1024]; … … 138 138 vorbisCallbacks.seek_func = &seekVorbis; 139 139 vorbisCallbacks.tell_func = &tellVorbis; 140 vorbisCallbacks.close_func = NULL;140 vorbisCallbacks.close_func = nullptr; 141 141 142 142 OggVorbis_File vf; 143 int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);143 int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks); 144 144 if (ret < 0) 145 145 { -
code/trunk/src/orxonox/sound/SoundBuffer.h
r10624 r11071 33 33 34 34 #include <list> 35 #include < boost/shared_ptr.hpp>35 #include <memory> 36 36 #include "core/Resource.h" 37 37 … … 45 45 { 46 46 friend class SoundManager; 47 #if !defined(_MSC_VER) || _MSC_VER >= 150048 // Make sure nobody deletes an instance (using strong pointers)49 template <class T>50 friend void boost::checked_delete(T*);51 #endif52 47 53 48 public: 54 #if defined(_MSC_VER) && _MSC_VER < 150055 49 ~SoundBuffer(); 56 #endif57 50 inline ALuint getBuffer() 58 51 { return this->audioBuffer_; } … … 64 57 65 58 private: 66 SoundBuffer(const std::string& filename, std::list<shared_ptr<SoundBuffer> >::iterator poolIterator); 67 #if !defined(_MSC_VER) || _MSC_VER >= 1500 68 ~SoundBuffer(); 69 #endif 70 void loadStandard(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream); 71 void loadOgg(const shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream); 59 SoundBuffer(const std::string& filename, std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator); 60 void loadStandard(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream); 61 void loadOgg(const std::shared_ptr<ResourceInfo>& fileInfo, DataStreamPtr dataStream); 72 62 73 63 std::string filename_; 74 64 ALuint audioBuffer_; 75 std::list<s hared_ptr<SoundBuffer>>::iterator poolIterator_;65 std::list<std::shared_ptr<SoundBuffer>>::iterator poolIterator_; 76 66 }; 77 67 } -
code/trunk/src/orxonox/sound/SoundManager.cc
r10624 r11071 83 83 ThrowException(InitialisationAborted, "Sound: Not loading at all"); 84 84 #if !defined(ORXONOX_PLATFORM_APPLE) 85 if (!alutInitWithoutContext( NULL, NULL))85 if (!alutInitWithoutContext(nullptr, nullptr)) 86 86 ThrowException(InitialisationFailed, "Sound Error: ALUT initialisation failed: " << alutGetErrorString(alutGetError())); 87 87 Loki::ScopeGuard alutExitGuard = Loki::MakeGuard(&alutExit); … … 90 90 /* 91 91 // Get list of available sound devices and display them 92 const char* devices = alcGetString( NULL, ALC_DEVICE_SPECIFIER);92 const char* devices = alcGetString(nullptr, ALC_DEVICE_SPECIFIER); 93 93 char* device = new char[strlen(devices)+1]; 94 94 strcpy(device, devices); … … 110 110 this->device_ = alcOpenDevice(renderDevice.c_str()); 111 111 */ 112 this->device_ = alcOpenDevice( NULL);113 if (this->device_ == NULL)112 this->device_ = alcOpenDevice(nullptr); 113 if (this->device_ == nullptr) 114 114 ThrowException(InitialisationFailed, "Sound Error: Could not open sound device."); 115 115 Loki::ScopeGuard closeDeviceGuard = Loki::MakeGuard(&alcCloseDevice, this->device_); 116 116 117 117 // Create sound context and make it the currently used one 118 this->context_ = alcCreateContext(this->device_, NULL);119 if (this->context_ == NULL)118 this->context_ = alcCreateContext(this->device_, nullptr); 119 if (this->context_ == nullptr) 120 120 ThrowException(InitialisationFailed, "Sound Error: Could not create ALC context"); 121 121 Loki::ScopeGuard desroyContextGuard = Loki::MakeGuard(&alcDestroyContext, this->context_); … … 189 189 190 190 // Relieve context to destroy it 191 if (!alcMakeContextCurrent( NULL))191 if (!alcMakeContextCurrent(nullptr)) 192 192 orxout(internal_error, context::sound) << "Could not unset ALC context" << endl; 193 193 alcDestroyContext(this->context_); … … 294 294 { 295 295 case SoundType::All: 296 for ( ObjectList<BaseSound>::iterator it = ObjectList<BaseSound>::begin(); it != ObjectList<BaseSound>::end(); ++it)297 (*it)->updateVolume();296 for (BaseSound* sound : ObjectList<BaseSound>()) 297 sound->updateVolume(); 298 298 break; 299 299 case SoundType::Music: 300 for ( ObjectList<AmbientSound>::iterator it = ObjectList<AmbientSound>::begin(); it != ObjectList<AmbientSound>::end(); ++it)301 (*it)->updateVolume();300 for (AmbientSound* sound : ObjectList<AmbientSound>()) 301 sound->updateVolume(); 302 302 break; 303 303 case SoundType::Effects: 304 for ( ObjectList<WorldSound>::iterator it = ObjectList<WorldSound>::begin(); it != ObjectList<WorldSound>::end(); ++it)305 (*it)->updateVolume();304 for (WorldSound* sound : ObjectList<WorldSound>()) 305 sound->updateVolume(); 306 306 break; 307 307 default: … … 350 350 void SoundManager::registerAmbientSound(AmbientSound* newAmbient) 351 351 { 352 if (newAmbient != NULL&& !this->bDestructorCalled_)352 if (newAmbient != nullptr && !this->bDestructorCalled_) 353 353 { 354 354 for (AmbientList::const_iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it) … … 373 373 void SoundManager::unregisterAmbientSound(AmbientSound* oldAmbient) 374 374 { 375 if (oldAmbient == NULL|| ambientSounds_.empty() || this->bDestructorCalled_)375 if (oldAmbient == nullptr || ambientSounds_.empty() || this->bDestructorCalled_) 376 376 return; 377 377 … … 405 405 void SoundManager::pauseAmbientSound(AmbientSound* ambient) 406 406 { 407 if (ambient != NULL)408 { 409 for ( AmbientList::iterator it = this->ambientSounds_.begin(); it != this->ambientSounds_.end(); ++it)410 { 411 if ( it->first == ambient)407 if (ambient != nullptr) 408 { 409 for (std::pair<AmbientSound*, bool>& pair : this->ambientSounds_) 410 { 411 if (pair.first == ambient) 412 412 { 413 it->second = true;414 this->fadeOut( it->first);413 pair.second = true; 414 this->fadeOut(pair.first); 415 415 return; 416 416 } … … 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) … … 505 505 } 506 506 507 s hared_ptr<SoundBuffer> SoundManager::getSoundBuffer(const std::string& filename)508 { 509 s hared_ptr<SoundBuffer> buffer;507 std::shared_ptr<SoundBuffer> SoundManager::getSoundBuffer(const std::string& filename) 508 { 509 std::shared_ptr<SoundBuffer> buffer; 510 510 // Check active or pooled buffers 511 511 SoundBufferMap::const_iterator it = this->soundBuffers_.find(filename); … … 538 538 } 539 539 540 void SoundManager::releaseSoundBuffer(const s hared_ptr<SoundBuffer>& buffer, bool bPoolBuffer)540 void SoundManager::releaseSoundBuffer(const std::shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer) 541 541 { 542 542 // Check if others are still using the buffer … … 551 551 while (this->effectsPoolSize_ + it->second->getSize() > this->maxEffectsPoolSize_s && !this->effectsPool_.empty()) 552 552 { 553 s hared_ptr<SoundBuffer> bufferDel = this->effectsPool_.back();553 std::shared_ptr<SoundBuffer> bufferDel = this->effectsPool_.back(); 554 554 this->effectsPoolSize_ -= bufferDel->getSize(); 555 555 bufferDel->poolIterator_ = this->effectsPool_.end(); … … 576 576 ALuint source = this->availableSoundSources_.back(); 577 577 this->availableSoundSources_.pop_back(); 578 this->usedSoundSources_. push_back(std::make_pair(source, object));578 this->usedSoundSources_.emplace_back(source, object); 579 579 return source; 580 580 } … … 588 588 if (alIsSource(source) && !alGetError()) 589 589 { 590 this->usedSoundSources_. push_back(std::make_pair(source, object));590 this->usedSoundSources_.emplace_back(source, object); 591 591 return source; 592 592 } … … 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/trunk/src/orxonox/sound/SoundManager.h
r10624 r11071 36 36 #include <map> 37 37 #include <string> 38 #include < boost/shared_ptr.hpp>38 #include <memory> 39 39 40 40 #include "util/Singleton.h" … … 68 68 ~SoundManager(); 69 69 70 v oid preUpdate(const Clock& time);71 v oid postUpdate(const Clock& time){ /*no action*/ }70 virtual void preUpdate(const Clock& time) override; 71 virtual void postUpdate(const Clock& time) override { /*no action*/ } 72 72 void setConfigValues(); 73 73 … … 96 96 // tolua_end 97 97 98 s hared_ptr<SoundBuffer> getSoundBuffer(const std::string& filename);99 void releaseSoundBuffer(const s hared_ptr<SoundBuffer>& buffer, bool bPoolBuffer);98 std::shared_ptr<SoundBuffer> getSoundBuffer(const std::string& filename); 99 void releaseSoundBuffer(const std::shared_ptr<SoundBuffer>& buffer, bool bPoolBuffer); 100 100 101 101 ALuint getSoundSource(BaseSound* object); … … 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<s hared_ptr<SoundBuffer>> EffectsPoolList;141 typedef std::list<std::shared_ptr<SoundBuffer>> EffectsPoolList; 142 142 EffectsPoolList effectsPool_; 143 typedef std::map<std::string, s hared_ptr<SoundBuffer>> SoundBufferMap;143 typedef std::map<std::string, std::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 -
code/trunk/src/orxonox/sound/SoundStreamer.cc
r8858 r11071 45 45 vorbisCallbacks.seek_func = &seekVorbis; 46 46 vorbisCallbacks.tell_func = &tellVorbis; 47 vorbisCallbacks.close_func = NULL;47 vorbisCallbacks.close_func = nullptr; 48 48 49 49 OggVorbis_File vf; 50 int ret = ov_open_callbacks(dataStream.get(), &vf, NULL, 0, vorbisCallbacks);50 int ret = ov_open_callbacks(dataStream.get(), &vf, nullptr, 0, vorbisCallbacks); 51 51 if (ret < 0) 52 52 { … … 68 68 int current_section; 69 69 70 for( int i = 0; i < 4; i++)70 for(ALuint& initbuffer : initbuffers) 71 71 { 72 72 long ret = ov_read(&vf, inbuffer, sizeof(inbuffer), 0, 2, 1, ¤t_section); … … 82 82 } 83 83 84 alBufferData(initbuffer s[i], format, &inbuffer, ret, vorbisInfo->rate);84 alBufferData(initbuffer, format, &inbuffer, ret, vorbisInfo->rate); 85 85 } 86 86 alSourceQueueBuffers(audioSource, 4, initbuffers); -
code/trunk/src/orxonox/sound/WorldAmbientSound.cc
r10624 r11071 49 49 this->ambientSound_ = new AmbientSound(); 50 50 this->registerVariables(); 51 soundList_. push_back("Earth.ogg");52 soundList_. push_back("Jupiter.ogg");53 soundList_. push_back("Mars.ogg");54 soundList_. push_back("allgorythm-lift_up.ogg");55 soundList_. push_back("allgorythm-resonance_blaster.ogg");56 soundList_. push_back("AlphaCentauri.ogg");57 soundList_. push_back("Asteroid_rocks.ogg");58 soundList_. push_back("Ganymede.ogg");59 soundList_. push_back("luke_grey_-_hypermode.ogg");51 soundList_.emplace_back("Earth.ogg"); 52 soundList_.emplace_back("Jupiter.ogg"); 53 soundList_.emplace_back("Mars.ogg"); 54 soundList_.emplace_back("allgorythm-lift_up.ogg"); 55 soundList_.emplace_back("allgorythm-resonance_blaster.ogg"); 56 soundList_.emplace_back("AlphaCentauri.ogg"); 57 soundList_.emplace_back("Asteroid_rocks.ogg"); 58 soundList_.emplace_back("Ganymede.ogg"); 59 soundList_.emplace_back("luke_grey_-_hypermode.ogg"); 60 60 61 61 } … … 114 114 115 115 //HACK: Assuption - there is only one WorldAmbientSound in a level and only one level is used. 116 for (ObjectList<WorldAmbientSound>::iterator it = ObjectList<WorldAmbientSound>::begin(); 117 it != ObjectList<WorldAmbientSound>::end(); ++it) 116 for (WorldAmbientSound* sound : ObjectList<WorldAmbientSound>()) 118 117 { 119 while( it->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){118 while(sound->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){ 120 119 WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size(); 121 120 } -
code/trunk/src/orxonox/sound/WorldAmbientSound.h
r9939 r11071 50 50 virtual ~WorldAmbientSound(); 51 51 52 v oid XMLPort(Element& xmlelement, XMLPort::Mode mode);53 v oid XMLEventPort(Element& xmlelement, XMLPort::Mode mode);52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 53 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; 54 54 55 virtual void changedActivity() ;55 virtual void changedActivity() override; 56 56 57 57 void play(); -
code/trunk/src/orxonox/sound/WorldSound.cc
r9939 r11071 58 58 registerVariable(bLooping_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::loopingChanged)); 59 59 registerVariable(pitch_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::pitchChanged)); 60 registerVariable( (uint8_t&)(BaseSound::state_), ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged));60 registerVariable(BaseSound::state_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged)); 61 61 } 62 62 -
code/trunk/src/orxonox/sound/WorldSound.h
r9667 r11071 47 47 WorldSound(Context* context); 48 48 49 v oid XMLPort(Element& xmlelement, XMLPort::Mode mode);50 v oid XMLEventPort(Element& xmlelement, XMLPort::Mode mode);51 v oid changedActivity();49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 50 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override; 51 virtual void changedActivity() override; 52 52 53 v oid tick(float dt);53 virtual void tick(float dt) override; 54 54 55 55 protected: … … 58 58 private: 59 59 void registerVariables(); 60 v oid initialiseSource();61 float getRealVolume();60 virtual void initialiseSource() override; 61 virtual float getRealVolume() override; 62 62 }; 63 63 }
Note: See TracChangeset
for help on using the changeset viewer.