summaryrefslogtreecommitdiffstats
blob: 937d0773bb1cccc2b0b88d05c9f45d3be6a0988e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
	}
}

}