diff options
Diffstat (limited to 'pacman-c++/audioplayer.h')
| -rw-r--r-- | pacman-c++/audioplayer.h | 22 |
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 | ||
| 7 | namespace Phonon | 9 | namespace Phonon |
| @@ -16,23 +18,41 @@ class AudioPlayer | |||
| 16 | Q_OBJECT | 18 | Q_OBJECT |
| 17 | 19 | ||
| 18 | public: | 20 | public: |
| 21 | enum Sound { | ||
| 22 | Intro = 0, | ||
| 23 | WakaWaka, | ||
| 24 | EatingCherry, | ||
| 25 | Die | ||
| 26 | }; | ||
| 27 | |||
| 28 | public: | ||
| 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 | ||
| 25 | signals: | 38 | signals: |
| 26 | void finished(); | 39 | void finished(); |
| 27 | 40 | ||
| 41 | private: | ||
| 42 | void test(); | ||
| 43 | void preload(); | ||
| 44 | |||
| 28 | private slots: | 45 | private 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 | ||
| 32 | private: | 50 | private: |
| 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 |
