25 #include "common/str.h" 26 #include "common/file.h" 27 #include "common/list.h" 28 #include "audio/mixer.h" 32 class SeekableReadStream;
37 enum SoundFormat { RAW, RAW80, MP3, OGG, FLAC };
52 SoundSample() : _offset(0), _length(0), _frequency(0), _format(RAW), _data(NULL), _stream(NULL) { }
76 virtual uint size()
const = 0;
82 virtual bool isOpen()
const = 0;
87 virtual void clearCache() = 0;
96 virtual SoundSample *getSample(
int i, uint freq) = 0;
106 _path(NULL), _samples(NULL), _sampleCount(0), _defaultFreq(defaultFreq), _opened(
false), _f(NULL) {
111 void openArchive(
const char *path);
114 uint
size()
const override {
return _sampleCount; }
115 bool isOpen()
const override {
return _opened; }
117 void clearCache()
override;
136 ZipSoundArchive() : _archive(NULL), _path(NULL), _extension(NULL), _format(RAW), _sampleCount(0), _defaultFreq(0), _cache() { }
139 void openArchive(
const char *path,
const char *extension, SoundFormat format,
int raw_frequency = 0);
142 uint
size()
const override {
return _sampleCount; }
143 bool isOpen()
const override {
return _archive != NULL; }
145 void clearCache()
override;
151 const char *_extension;
167 #define SOUND_HANDLES 10 188 uint playSound(
const SoundSample *buffer,
int volume,
bool loop);
192 bool isMutedSound()
const {
return _muteSound; }
198 bool isMutedVoice()
const {
return _muteVoice; }
200 void stopAll() { stopVoice(); stopSound(); }
204 bool showSubtitles()
const {
return _showSubtitles; }
205 int talkSpeed()
const {
return _talkSpeed; }
210 sndHandleType handleType,
bool loop);
226 #endif // DRACI_SOUND_H
bool isOpen() const override
Definition: sound.h:115
bool isOpen() const override
Definition: sound.h:143
Definition: archive.h:141
uint size() const override
Definition: sound.h:142
Definition: algorithm.h:29
Definition: animation.h:30
uint size() const override
Definition: sound.h:114