diff options
Diffstat (limited to 'Swift/Controllers/SoundEventController.cpp')
-rw-r--r-- | Swift/Controllers/SoundEventController.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Swift/Controllers/SoundEventController.cpp b/Swift/Controllers/SoundEventController.cpp index 46d6ddb..133becf 100644 --- a/Swift/Controllers/SoundEventController.cpp +++ b/Swift/Controllers/SoundEventController.cpp @@ -7,15 +7,19 @@ namespace Swift { -SoundEventController::SoundEventController(EventController* eventController, SoundPlayer* soundPlayer) { +SoundEventController::SoundEventController(EventController* eventController, SoundPlayer* soundPlayer, bool playSounds) { eventController_ = eventController; soundPlayer_ = soundPlayer; + playSounds_ = playSounds; eventController_->onEventQueueEventAdded.connect(boost::bind(&SoundEventController::handleEventQueueEventAdded, this, _1)); } void SoundEventController::handleEventQueueEventAdded(boost::shared_ptr<MessageEvent> event) { - soundPlayer_->playSound(SoundPlayer::MessageReceived); + if (playSounds_) soundPlayer_->playSound(SoundPlayer::MessageReceived); } +void SoundEventController::setPlaySounds(bool playSounds) { + playSounds_ = playSounds; +} } |