summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-06-28 09:41:38 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-06-28 09:41:38 (GMT)
commit1231acac77f2811a94f9bc83e38abb8ed85468b3 (patch)
treec5c6e99544750d13ccc41717f0f6a28694028582 /Swift/Controllers/SoundEventController.cpp
parente2d9f9e47056a41d5e5a67ea3130ccdd860a06ed (diff)
downloadswift-1231acac77f2811a94f9bc83e38abb8ed85468b3.zip
swift-1231acac77f2811a94f9bc83e38abb8ed85468b3.tar.bz2
Moving resources into Swift/ and starting on Sound.
Diffstat (limited to 'Swift/Controllers/SoundEventController.cpp')
-rw-r--r--Swift/Controllers/SoundEventController.cpp21
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);
+}
+
+
+}