kgoldrunner
kgrsoundbank.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KGRSOUNDBANK_H
00021 #define KGRSOUNDBANK_H
00022
00023 #include <Phonon/MediaObject>
00024 #include <Phonon/MediaSource>
00025
00026 class KGrSoundBank : public QObject
00027 {
00028 Q_OBJECT
00029 public:
00030
00035 KGrSoundBank(int number);
00036 ~KGrSoundBank();
00037
00043 int play (int effect, bool looping = false);
00044
00048 void stop (int token);
00049
00054 int loadSound (const QString &fileName);
00055
00059 void reset();
00060
00064 void stopAllSounds();
00065
00070 void setEffectsVolume (double volume);
00071
00076 void setMusicVolume (double volume);
00077
00078 void setMuted (bool mute);
00079
00080 private slots:
00081 void freeChannels();
00082
00083 private:
00084 QVector< Phonon::MediaSource > soundSamples;
00085 QVector< Phonon::MediaObject * > channels;
00086 QVector< int > tokens;
00087
00088 int currentToken;
00089 bool muted;
00090 };
00091
00092 #endif // KGRSOUNDBANK_H
00093