2
Copyright 2007 Luciano Montanaro <mikelima@cirulla.net>
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the
16
Free Software Foundation, Inc.,
17
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#ifndef KGRSOUNDBANK_H
21
#define KGRSOUNDBANK_H
23
#include <Phonon/MediaObject>
24
#include <Phonon/MediaSource>
26
class KGrSoundBank : public QObject
32
* Construct the KGrSoundBank class.
33
* \param number - how many audio channels are required
35
KGrSoundBank(int number);
39
* Play a sound effect.
40
* This method returns a token that can be used to stop the sound if it is
41
* still playing. Trying to stop a completed sound has no effect.
43
int play (int effect, bool looping = false);
46
* Stop playing the sound associated with the given token.
48
void stop (int token);
51
* Load a sound sample.
52
* A token is returned to use to play back the sample.
54
int loadSound (const QString &fileName);
57
* Stop sound and discard the loaded sound effects.
62
* Stop all sounds currently playing.
67
* Set volume for the sound effects.
68
* \param volume the playing volume. 0.0 means mute, 1.0 means full volume.
70
void setEffectsVolume (double volume);
73
* Set volume for the background music.
74
* \param volume the playing volume. 0.0 means mute, 1.0 means full volume.
76
void setMusicVolume (double volume);
78
void setMuted (bool mute);
86
QVector< Phonon::MediaSource > soundSamples;
87
QVector< Phonon::MediaObject * > channels;
88
QVector< int > tokens;
94
#endif // KGRSOUNDBANK_H
95
// vi: set sw=4 cino=\:0g0 :