summaryrefslogtreecommitdiffstats
path: root/pacman-c++/common/audiointerface.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-05-11 17:38:29 +0200
committermanuel <manuel@mausz.at>2011-05-11 17:38:29 +0200
commitca29fc0babe8fc985a9e4656f80fc7faec4ac8a5 (patch)
treefb48f74ffcddcd8b260ebf78062623427aeda862 /pacman-c++/common/audiointerface.h
parent535c342a2f28e0a1e90010b2f0ff4018eeeb200a (diff)
downloadfoop-ca29fc0babe8fc985a9e4656f80fc7faec4ac8a5.tar.gz
foop-ca29fc0babe8fc985a9e4656f80fc7faec4ac8a5.tar.bz2
foop-ca29fc0babe8fc985a9e4656f80fc7faec4ac8a5.zip
- fix audio plugin and make that a real interface
- that fixes a duplicate statis audiomanager (1x pacman, 1x audio plugin) on windows - display won/lost dialog upon gameend
Diffstat (limited to 'pacman-c++/common/audiointerface.h')
-rw-r--r--pacman-c++/common/audiointerface.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/pacman-c++/common/audiointerface.h b/pacman-c++/common/audiointerface.h
new file mode 100644
index 0000000..66679b6
--- /dev/null
+++ b/pacman-c++/common/audiointerface.h
@@ -0,0 +1,60 @@
1#ifndef AUDIOINTERFACE_H
2#define AUDIOINTERFACE_H
3
4#include <QObject>
5#include <QFile>
6
7class AudioPlayer
8 : public QObject
9{
10 Q_OBJECT
11 friend class AudioManager;
12
13public:
14 virtual ~AudioPlayer()
15 {}
16 virtual bool isWorking() const = 0;
17 virtual void setMuted(bool mute = true) = 0;
18 virtual bool isMuted() const = 0;
19 virtual void play() = 0;
20 virtual bool isPlaying() = 0;
21 virtual void pause() = 0;
22 virtual bool isPaused() = 0;
23 virtual void stop() = 0;
24 virtual bool isStopped() = 0;
25 virtual void clear() = 0;
26 virtual void clearQueue() = 0;
27 virtual void setPrefinishMark(qint32 msecToEnd) = 0;
28 virtual void seek(qint64 time) = 0;
29
30signals:
31 void finished();
32 void prefinishMarkReached(qint32 mark);
33
34protected:
35 AudioPlayer(QObject *parent = 0)
36 : QObject(parent)
37 {}
38 virtual void setWorking(bool working = true) = 0;
39 virtual void test(QFile *sound, unsigned int length) = 0;
40 virtual void play(QFile *sound, unsigned int length) = 0;
41 virtual void setSource(QFile *sound, unsigned int length) = 0;
42 virtual void enqueue(QFile *sound, unsigned int length) = 0;
43
44protected slots:
45 virtual void prefinishMarkReached_ex(qint32 mark) = 0;
46};
47
48/* --------------------------------------------------------------- */
49
50class AudioPlayerFactory
51{
52public:
53 virtual ~AudioPlayerFactory()
54 {}
55 virtual AudioPlayer *create(QObject *parent = 0) = 0;
56};
57
58Q_DECLARE_INTERFACE(AudioPlayerFactory, "at.ac.tuwien.foop.pacman.AudioPlayerFactory/1.0");
59
60#endif // AUDIOINTERFACE_H