diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cryo/sound.cpp | 78 | ||||
-rw-r--r-- | engines/cryo/sound.h | 19 |
2 files changed, 0 insertions, 97 deletions
diff --git a/engines/cryo/sound.cpp b/engines/cryo/sound.cpp index 48670912e8..68f067588f 100644 --- a/engines/cryo/sound.cpp +++ b/engines/cryo/sound.cpp @@ -110,82 +110,4 @@ void CSoundChannel::applyVolumeChange() { _mixer->setChannelBalance(_soundHandle, balance);
}
-/****************************************************************/
-
-SoundGroup::SoundGroup(int16 numSounds, int16 length, int16 sampleSize, float rate, int16 mode) {
- if (numSounds < kCryoMaxClSounds)
- _numSounds = numSounds;
- else
- error("SoundGroup - numSounds >= kCryoMaxClSounds");
-
- for (int i = 0; i < _numSounds; i++) {
- _sounds[i] = new Sound(length, rate, sampleSize, mode);
- _sounds[i]->_maxLength = length;
- }
- _soundIndex = 0;
- _playIndex = 0;
-}
-
-// Original name: CLSoundGroup_Free
-SoundGroup::~SoundGroup() {
- for (int16 i = 0; i < _numSounds; i++)
- delete(_sounds[i]);
-}
-
-// Original name: CLSoundGroup_GetNextBuffer
-void *SoundGroup::getNextBuffer() {
- Sound *sound = _sounds[_soundIndex];
- return sound->_sndHandle + sound->_headerLen;
-}
-
-// Original name: CLSoundGroup_AssignDatas
-bool SoundGroup::assignDatas(void *buffer, int length, bool isSigned) {
- Sound *sound = _sounds[_soundIndex];
-
- sound->_buffer = (char *)buffer;
- sound->_length = length;
- // if(sound->reversed && sound->sampleSize == 16)
- // ReverseBlock16(buffer, length);
- // if(isSigned)
- // CLSound_Signed2NonSigned(buffer, length);
- if (_soundIndex == _numSounds - 1)
- _soundIndex = 0;
- else
- _soundIndex++;
-
- return true;
-}
-
-// Original name: CLSoundGroup_SetDatas
-bool SoundGroup::setDatas(void *data, int length, bool isSigned) {
- Sound *sound = _sounds[_soundIndex];
- if (length >= sound->_maxLength)
- error("CLSoundGroup_SetDatas - Unexpected length");
-
- void *buffer = sound->_sndHandle + sound->_headerLen;
- sound->_buffer = (char *)buffer;
- memcpy(buffer, data, length);
- sound->_length = length;
- // if(sound->reversed && sound->sampleSize == 16)
- // ReverseBlock16(buffer, length);
- // if(isSigned)
- // CLSound_Signed2NonSigned(buffer, length);
- if (_soundIndex == _numSounds - 1)
- _soundIndex = 0;
- else
- _soundIndex++;
-
- return true;
-}
-
-// Original name: CLSoundGroup_PlayNextSample
-void SoundGroup::playNextSample(SoundChannel *ch) {
- ch->play(_sounds[_playIndex]);
- if (_playIndex == _numSounds - 1)
- _playIndex = 0;
- else
- _playIndex++;
-}
-
-
}
diff --git a/engines/cryo/sound.h b/engines/cryo/sound.h index c6fee3c45f..72232cc4f1 100644 --- a/engines/cryo/sound.h +++ b/engines/cryo/sound.h @@ -67,23 +67,4 @@ public: void setVolumeRight(unsigned int volume);
};
-#define kCryoMaxClSounds 64
-
-class SoundGroup {
-private:
- Sound *_sounds[kCryoMaxClSounds];
- int16 _numSounds;
- int16 _soundIndex;
- int16 _playIndex;
-
-public:
- SoundGroup(int16 numSounds, int16 length, int16 sampleSize, float rate, int16 mode);
- ~SoundGroup();
-
- bool assignDatas(void *buffer, int length, bool isSigned);
- void playNextSample(SoundChannel *ch);
- bool setDatas(void *data, int length, bool isSigned);
- void *getNextBuffer();
-};
-
}
|