diff options
Diffstat (limited to 'engines/gob/sound/soundblaster.h')
-rw-r--r-- | engines/gob/sound/soundblaster.h | 59 |
1 files changed, 7 insertions, 52 deletions
diff --git a/engines/gob/sound/soundblaster.h b/engines/gob/sound/soundblaster.h index 575d4994be..c57e4a443e 100644 --- a/engines/gob/sound/soundblaster.h +++ b/engines/gob/sound/soundblaster.h @@ -27,23 +27,18 @@ #define GOB_SOUND_SOUNDBLASTER_H #include "common/mutex.h" -#include "common/frac.h" -#include "sound/audiostream.h" #include "sound/mixer.h" -#include "sound/softsynth/pcspk.h" + +#include "gob/sound/sounddesc.h" +#include "gob/sound/soundmixer.h" namespace Gob { -class SoundBlaster : public Audio::AudioStream { +class SoundBlaster : public SoundMixer { public: - char _playingSound; - SoundBlaster(Audio::Mixer &mixer); ~SoundBlaster(); - bool loadSample(SoundDesc &sndDesc, const char *fileName); - void freeSample(SoundDesc &sndDesc); - void playSample(SoundDesc &sndDesc, int16 repCount, int16 frequency, int16 fadeLength = 0); void stopSound(int16 fadeLength, SoundDesc *sndDesc = 0); @@ -53,61 +48,21 @@ public: void stopComposition(); void endComposition(); - bool isPlaying() const; - char getPlayingSound() const; - - void setRepeating(int32 repCount); - void waitEndPlay(bool interruptible = false, bool stopComp = true); - - static void convToSigned(byte *buffer, int length) { - while (length-- > 0) - *buffer++ ^= 0x80; - } - - int readBuffer(int16 *buffer, const int numSamples); - bool isStereo() const { return false; } - bool endOfData() const { return _end; } - bool endOfStream() const { return false; } - int getRate() const { return _rate; } - protected: - Audio::Mixer *_mixer; - - Audio::SoundHandle *_activeHandle; - Audio::SoundHandle _compositionHandle; + Common::Mutex _mutex; SoundDesc *_compositionSamples; int8 _compositionSampleCount; int16 _composition[50]; int8 _compositionPos; - Audio::SoundHandle _handle; - Common::Mutex _mutex; SoundDesc *_curSoundDesc; - bool _end; - int8 *_data; - uint32 _length; - uint32 _rate; - int32 _freq; - int32 _repCount; - - uint32 _offset; - frac_t _offsetFrac; - frac_t _offsetInc; - - int16 _cur; - int16 _last; - - bool _fade; - int32 _fadeVol; - int32 _fadeVolStep; - uint8 _fadeLength; - uint32 _fadeSamples; - uint32 _curFadeSamples; void setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency, int16 fadeLength); void checkEndSample(); + void endFade(); + void nextCompositionPos(); }; |