summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/SoundEventController.cpp')
-rw-r--r--Swift/Controllers/SoundEventController.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/Swift/Controllers/SoundEventController.cpp b/Swift/Controllers/SoundEventController.cpp
index 43c8ed0..433937b 100644
--- a/Swift/Controllers/SoundEventController.cpp
+++ b/Swift/Controllers/SoundEventController.cpp
@@ -18,39 +18,39 @@
namespace Swift {
SoundEventController::SoundEventController(EventController* eventController, SoundPlayer* soundPlayer, SettingsProvider* settings, HighlightManager* highlightManager) {
- settings_ = settings;
- eventController_ = eventController;
- soundPlayer_ = soundPlayer;
- eventController_->onEventQueueEventAdded.connect(boost::bind(&SoundEventController::handleEventQueueEventAdded, this, _1));
- highlightManager_ = highlightManager;
- highlightManager_->onHighlight.connect(boost::bind(&SoundEventController::handleHighlight, this, _1));
+ settings_ = settings;
+ eventController_ = eventController;
+ soundPlayer_ = soundPlayer;
+ eventController_->onEventQueueEventAdded.connect(boost::bind(&SoundEventController::handleEventQueueEventAdded, this, _1));
+ highlightManager_ = highlightManager;
+ highlightManager_->onHighlight.connect(boost::bind(&SoundEventController::handleHighlight, this, _1));
- settings_->onSettingChanged.connect(boost::bind(&SoundEventController::handleSettingChanged, this, _1));
+ settings_->onSettingChanged.connect(boost::bind(&SoundEventController::handleSettingChanged, this, _1));
- playSounds_ = settings->getSetting(SettingConstants::PLAY_SOUNDS);
+ playSounds_ = settings->getSetting(SettingConstants::PLAY_SOUNDS);
}
void SoundEventController::handleEventQueueEventAdded(boost::shared_ptr<StanzaEvent> event) {
- if (playSounds_ && boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event)) {
- soundPlayer_->playSound(SoundPlayer::MessageReceived, "");
- }
+ if (playSounds_ && boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event)) {
+ soundPlayer_->playSound(SoundPlayer::MessageReceived, "");
+ }
}
void SoundEventController::handleHighlight(const HighlightAction& action) {
- if (playSounds_ && action.playSound()) {
- soundPlayer_->playSound(SoundPlayer::MessageReceived, action.getSoundFile());
- }
+ if (playSounds_ && action.playSound()) {
+ soundPlayer_->playSound(SoundPlayer::MessageReceived, action.getSoundFile());
+ }
}
void SoundEventController::setPlaySounds(bool playSounds) {
- playSounds_ = playSounds;
- settings_->storeSetting(SettingConstants::PLAY_SOUNDS, playSounds);
+ playSounds_ = playSounds;
+ settings_->storeSetting(SettingConstants::PLAY_SOUNDS, playSounds);
}
void SoundEventController::handleSettingChanged(const std::string& settingPath) {
- if (SettingConstants::PLAY_SOUNDS.getKey() == settingPath) {
- playSounds_ = settings_->getSetting(SettingConstants::PLAY_SOUNDS);
- }
+ if (SettingConstants::PLAY_SOUNDS.getKey() == settingPath) {
+ playSounds_ = settings_->getSetting(SettingConstants::PLAY_SOUNDS);
+ }
}
}