summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-20 18:27:23 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-20 18:27:23 (GMT)
commit8149107ade43f9c9fff8fe134f1bce5b5e8b2234 (patch)
treef395f60c01cd3564fcc61ba1fa7ab65e5e2a6821 /Swift/QtUI/QtSoundPlayer.cpp
parent059ace39c432a89845e245604af03f5f71e1da84 (diff)
downloadswift-8149107ade43f9c9fff8fe134f1bce5b5e8b2234.zip
swift-8149107ade43f9c9fff8fe134f1bce5b5e8b2234.tar.bz2
Use QSound for sounds.
Diffstat (limited to 'Swift/QtUI/QtSoundPlayer.cpp')
-rw-r--r--Swift/QtUI/QtSoundPlayer.cpp28
1 files changed, 3 insertions, 25 deletions
diff --git a/Swift/QtUI/QtSoundPlayer.cpp b/Swift/QtUI/QtSoundPlayer.cpp
index 4aa6b8e..246509e 100644
--- a/Swift/QtUI/QtSoundPlayer.cpp
+++ b/Swift/QtUI/QtSoundPlayer.cpp
@@ -1,40 +1,18 @@
#include "QtSoundPlayer.h"
-#ifdef Q_WS_X11
-#include "mediaobject.h"
-#include "audiooutput.h"
-#else
-#include <phonon/MediaObject>
-#include <phonon/AudioOutput>
-#endif
+#include <QSound>
-namespace Swift{
+namespace Swift {
QtSoundPlayer::QtSoundPlayer() {
- audioOutput_ = new Phonon::AudioOutput(Phonon::NotificationCategory);
-
- messageReceived_ = new Phonon::MediaObject();
- messageReceived_->setCurrentSource(Phonon::MediaSource(":/sounds/message-received.wav"));
- Phonon::createPath(messageReceived_, audioOutput_);
- connect(messageReceived_, SIGNAL(finished()), this, SLOT(handleFinished()));
}
-QtSoundPlayer::~QtSoundPlayer() {
- delete messageReceived_;
- delete audioOutput_;
-}
-
void QtSoundPlayer::playSound(SoundEffect sound) {
switch (sound) {
case MessageReceived:
- //messageReceived_->stop();
- messageReceived_->play();
+ QSound::play(":/sounds/message-received.wav");
break;
}
}
-void QtSoundPlayer::handleFinished() {
- messageReceived_->stop();
-}
-
}