summaryrefslogtreecommitdiffstats
path: root/pacman-c++/audioplayer.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-08 15:18:38 +0200
committermanuel <manuel@mausz.at>2011-04-08 15:18:38 +0200
commit507f8b6ca5679c4898b721520dd4011f6b9e5824 (patch)
treeba162976ed22e04586f6268db6a2e46621c1c036 /pacman-c++/audioplayer.h
parentd1d48ba62695572a2091867b827b1304b0da08d3 (diff)
downloadfoop-507f8b6ca5679c4898b721520dd4011f6b9e5824.tar.gz
foop-507f8b6ca5679c4898b721520dd4011f6b9e5824.tar.bz2
foop-507f8b6ca5679c4898b721520dd4011f6b9e5824.zip
make audioplayer useful
Diffstat (limited to 'pacman-c++/audioplayer.h')
-rw-r--r--pacman-c++/audioplayer.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/pacman-c++/audioplayer.h b/pacman-c++/audioplayer.h
index 3dc3cfd..dd128c5 100644
--- a/pacman-c++/audioplayer.h
+++ b/pacman-c++/audioplayer.h
@@ -2,6 +2,8 @@
2#define AUDIOPLAYER_H 2#define AUDIOPLAYER_H
3 3
4#include <QObject> 4#include <QObject>
5#include <QList>
6#include <QFile>
5#include <phonon/phononnamespace.h> 7#include <phonon/phononnamespace.h>
6 8
7namespace Phonon 9namespace Phonon
@@ -16,23 +18,41 @@ class AudioPlayer
16 Q_OBJECT 18 Q_OBJECT
17 19
18public: 20public:
21 enum Sound {
22 Intro = 0,
23 WakaWaka,
24 EatingCherry,
25 Die
26 };
27
28public:
19 AudioPlayer(); 29 AudioPlayer();
20 static AudioPlayer *self(); 30 static AudioPlayer *self();
31 bool isWorking();
21 void stop(); 32 void stop();
22 void setMuted(bool mute = true); 33 void setMuted(bool mute = true);
23 void playIntro(); 34 void play(Sound sound);
35 void enqueue(Sound sound);
36 Phonon::State state();
24 37
25signals: 38signals:
26 void finished(); 39 void finished();
27 40
41private:
42 void test();
43 void preload();
44
28private slots: 45private slots:
29 void finished_p(); 46 void finished_p();
30 void stateChanged_p(Phonon::State newstate, Phonon::State oldstate); 47 void stateChanged_p(Phonon::State newstate, Phonon::State oldstate);
48 void testFinished();
31 49
32private: 50private:
51 bool m_working;
33 Phonon::MediaObject *m_player; 52 Phonon::MediaObject *m_player;
34 Phonon::AudioOutput *m_output; 53 Phonon::AudioOutput *m_output;
35 static AudioPlayer *m_instance; 54 static AudioPlayer *m_instance;
55 QList<QFile *> m_sounds;
36}; 56};
37 57
38#endif // AUDIOPLAYER_H 58#endif // AUDIOPLAYER_H