summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-09-12 18:55:01 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-09-12 18:55:01 (GMT)
commit7dafb815ca404f1e15c9cdf6b26817c941dae4ec (patch)
tree5f1a523042bd4b9ccb84efce74ab2441dacef8ea /Swift/Controllers/SoundEventController.cpp
parent7e157ace6678dd4af7a091ea5cc5fbc3baabe7f7 (diff)
downloadswift-contrib-7dafb815ca404f1e15c9cdf6b26817c941dae4ec.zip
swift-contrib-7dafb815ca404f1e15c9cdf6b26817c941dae4ec.tar.bz2
Getting ready for sounds to be turned off.
Diffstat (limited to 'Swift/Controllers/SoundEventController.cpp')
-rw-r--r--Swift/Controllers/SoundEventController.cpp8
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;
+}
}