From 507f8b6ca5679c4898b721520dd4011f6b9e5824 Mon Sep 17 00:00:00 2001 From: manuel Date: Fri, 8 Apr 2011 15:18:38 +0200 Subject: make audioplayer useful --- pacman-c++/audioplayer.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'pacman-c++/audioplayer.h') 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 @@ #define AUDIOPLAYER_H #include +#include +#include #include namespace Phonon @@ -15,24 +17,42 @@ class AudioPlayer { Q_OBJECT +public: + enum Sound { + Intro = 0, + WakaWaka, + EatingCherry, + Die + }; + public: AudioPlayer(); static AudioPlayer *self(); + bool isWorking(); void stop(); void setMuted(bool mute = true); - void playIntro(); + void play(Sound sound); + void enqueue(Sound sound); + Phonon::State state(); signals: void finished(); +private: + void test(); + void preload(); + private slots: void finished_p(); void stateChanged_p(Phonon::State newstate, Phonon::State oldstate); + void testFinished(); private: + bool m_working; Phonon::MediaObject *m_player; Phonon::AudioOutput *m_output; static AudioPlayer *m_instance; + QList m_sounds; }; #endif // AUDIOPLAYER_H -- cgit v1.2.3