summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2009-07-04 20:24:20 (GMT)
committerKevin Smith <git@kismith.co.uk>2009-07-04 20:24:20 (GMT)
commit83ca0f4806ed30fb974420db4171201c451fb583 (patch)
tree0931883fcad6903bdaa5e81d743d42e5c43e2ec0 /Swift/QtUI/QtSoundPlayer.cpp
parent0bee0cc8ec06d3508934111c08140d435307798d (diff)
downloadswift-contrib-83ca0f4806ed30fb974420db4171201c451fb583.zip
swift-contrib-83ca0f4806ed30fb974420db4171201c451fb583.tar.bz2
Ding on new messages.
Diffstat (limited to 'Swift/QtUI/QtSoundPlayer.cpp')
-rw-r--r--Swift/QtUI/QtSoundPlayer.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Swift/QtUI/QtSoundPlayer.cpp b/Swift/QtUI/QtSoundPlayer.cpp
index 937d077..5dd3db3 100644
--- a/Swift/QtUI/QtSoundPlayer.cpp
+++ b/Swift/QtUI/QtSoundPlayer.cpp
@@ -3,14 +3,16 @@
#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_);
+ messageReceived_->setCurrentSource(Phonon::MediaSource(":/sounds/message-received.wav"));
+ Phonon::createPath(messageReceived_, audioOutput_);
+ connect(messageReceived_, SIGNAL(finished()), this, SLOT(handleFinished()));
}
QtSoundPlayer::~QtSoundPlayer() {
@@ -21,9 +23,14 @@ QtSoundPlayer::~QtSoundPlayer() {
void QtSoundPlayer::playSound(SoundEffect sound) {
switch (sound) {
case MessageReceived:
+ //messageReceived_->stop();
messageReceived_->play();
break;
}
}
+void QtSoundPlayer::handleFinished() {
+ messageReceived_->stop();
+}
+
} \ No newline at end of file