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/QtUI/QtSoundPlayer.cpp
parente2d9f9e47056a41d5e5a67ea3130ccdd860a06ed (diff)
downloadswift-1231acac77f2811a94f9bc83e38abb8ed85468b3.zip
swift-1231acac77f2811a94f9bc83e38abb8ed85468b3.tar.bz2
Moving resources into Swift/ and starting on Sound.
Diffstat (limited to 'Swift/QtUI/QtSoundPlayer.cpp')
-rw-r--r--Swift/QtUI/QtSoundPlayer.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/Swift/QtUI/QtSoundPlayer.cpp b/Swift/QtUI/QtSoundPlayer.cpp
new file mode 100644
index 0000000..937d077
--- /dev/null
+++ b/Swift/QtUI/QtSoundPlayer.cpp
@@ -0,0 +1,29 @@
+#include "QtSoundPlayer.h"
+
+#include <phonon/MediaObject>
+#include <phonon/AudioOutput>
+
+namespace Swift{
+
+QtSoundPlayer::QtSoundPlayer() {
+ audioOutput_ = new Phonon::AudioOutput(Phonon::NotificationCategory);
+
+ messageReceived_ = new Phonon::MediaObject();
+ messageReceived_->setCurrentSource(Phonon::MediaSource(":/sounds/messageReceived.wav"));
+ Phonon::Path path = Phonon::createPath(messageReceived_, audioOutput_);
+}
+
+QtSoundPlayer::~QtSoundPlayer() {
+ delete messageReceived_;
+ delete audioOutput_;
+}
+
+void QtSoundPlayer::playSound(SoundEffect sound) {
+ switch (sound) {
+ case MessageReceived:
+ messageReceived_->play();
+ break;
+ }
+}
+
+} \ No newline at end of file