diff options
Diffstat (limited to 'pacman-c++/audioplayer.h')
| -rw-r--r-- | pacman-c++/audioplayer.h | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/pacman-c++/audioplayer.h b/pacman-c++/audioplayer.h deleted file mode 100644 index 474b6ca..0000000 --- a/pacman-c++/audioplayer.h +++ /dev/null | |||
| @@ -1,65 +0,0 @@ | |||
| 1 | #ifndef AUDIOPLAYER_H | ||
| 2 | #define AUDIOPLAYER_H | ||
| 3 | |||
| 4 | #include <QObject> | ||
| 5 | #include <QList> | ||
| 6 | #include <QFile> | ||
| 7 | #include <phonon/phononnamespace.h> | ||
| 8 | |||
| 9 | namespace Phonon | ||
| 10 | { | ||
| 11 | class MediaObject; | ||
| 12 | class AudioOutput; | ||
| 13 | } | ||
| 14 | |||
| 15 | class AudioPlayer | ||
| 16 | : public QObject | ||
| 17 | { | ||
| 18 | Q_OBJECT | ||
| 19 | |||
| 20 | public: | ||
| 21 | enum Sound { | ||
| 22 | Intro = 0, | ||
| 23 | WakaWaka, | ||
| 24 | EatingCherry, | ||
| 25 | Die | ||
| 26 | }; | ||
| 27 | |||
| 28 | public: | ||
| 29 | AudioPlayer(); | ||
| 30 | static AudioPlayer *self(); | ||
| 31 | bool isWorking() const; | ||
| 32 | void stop(); | ||
| 33 | void setMuted(bool mute = true); | ||
| 34 | bool isMuted() const; | ||
| 35 | void play(Sound sound); | ||
| 36 | void clear(); | ||
| 37 | void enqueue(Sound sound); | ||
| 38 | void clearQueue() const; | ||
| 39 | Phonon::State state(); | ||
| 40 | |||
| 41 | signals: | ||
| 42 | void finished(); | ||
| 43 | void aboutToFinish(); | ||
| 44 | void mutedChanged(bool muted); | ||
| 45 | |||
| 46 | private: | ||
| 47 | void test(); | ||
| 48 | void preload(); | ||
| 49 | |||
| 50 | private slots: | ||
| 51 | void finished_p(); | ||
| 52 | void aboutToFinish_p(); | ||
| 53 | void stateChanged_p(Phonon::State newstate, Phonon::State oldstate); | ||
| 54 | void mutedChanged_p(bool muted); | ||
| 55 | void testFinished(); | ||
| 56 | |||
| 57 | private: | ||
| 58 | bool m_working; | ||
| 59 | Phonon::MediaObject *m_player; | ||
| 60 | Phonon::AudioOutput *m_output; | ||
| 61 | static AudioPlayer *m_instance; | ||
| 62 | QList<QFile *> m_sounds; | ||
| 63 | }; | ||
| 64 | |||
| 65 | #endif // AUDIOPLAYER_H | ||
