diff options
Diffstat (limited to 'Swift/Controllers/SoundEventController.cpp')
-rw-r--r-- | Swift/Controllers/SoundEventController.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Swift/Controllers/SoundEventController.cpp b/Swift/Controllers/SoundEventController.cpp new file mode 100644 index 0000000..46d6ddb --- /dev/null +++ b/Swift/Controllers/SoundEventController.cpp @@ -0,0 +1,21 @@ +#include "Swift/Controllers/SoundEventController.h" + +#include <boost/bind.hpp> + +#include "Swift/Controllers/EventController.h" +#include "Swift/Controllers/SoundPlayer.h" + +namespace Swift { + +SoundEventController::SoundEventController(EventController* eventController, SoundPlayer* soundPlayer) { + eventController_ = eventController; + soundPlayer_ = soundPlayer; + eventController_->onEventQueueEventAdded.connect(boost::bind(&SoundEventController::handleEventQueueEventAdded, this, _1)); +} + +void SoundEventController::handleEventQueueEventAdded(boost::shared_ptr<MessageEvent> event) { + soundPlayer_->playSound(SoundPlayer::MessageReceived); +} + + +} |