diff options
-rw-r--r-- | engines/kyra/sound_towns.cpp | 4 | ||||
-rw-r--r-- | engines/mohawk/video/qt_player.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/sound_br.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/sound_ns.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/player_mod.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/sound.cpp | 4 | ||||
-rw-r--r-- | engines/sky/sound.cpp | 2 | ||||
-rw-r--r-- | sound/audiostream.cpp | 2 | ||||
-rw-r--r-- | sound/raw.cpp | 32 | ||||
-rw-r--r-- | sound/raw.h | 17 | ||||
-rw-r--r-- | sound/voc.cpp | 2 |
11 files changed, 13 insertions, 58 deletions
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 9628ed1da9..eabdae27d8 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -3926,7 +3926,7 @@ void SoundTowns::playSoundEffect(uint8 track) { uint32 outputRate = uint32(11025 * calculatePhaseStep(note, sfxRootNoteOffs, sfxRate, 11025, 0x2000)); _currentSFX = Audio::makeRawMemoryStream(sfxPlaybackBuffer, playbackBufferSize, DisposeAfterUse::YES, - outputRate, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN, 0, 0); + outputRate, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, _currentSFX); } @@ -4298,7 +4298,7 @@ int32 SoundTownsPC98_v2::voicePlay(const char *file, Audio::SoundHandle *handle, uint32 outputRate = uint32(11025 * SoundTowns::calculatePhaseStep(0x3c, 0x3c, sfxRate, 11025, 0x2000)); _currentSFX = Audio::makeRawMemoryStream(sfx, outsize, DisposeAfterUse::YES, outputRate, - Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN, 0, 0); + Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundChannels[h], _currentSFX); if (handle) *handle = _soundChannels[h]; diff --git a/engines/mohawk/video/qt_player.cpp b/engines/mohawk/video/qt_player.cpp index e53818fe2e..f62968d383 100644 --- a/engines/mohawk/video/qt_player.cpp +++ b/engines/mohawk/video/qt_player.cpp @@ -1170,7 +1170,7 @@ Audio::AudioStream *QTPlayer::createAudioStream(Common::SeekableReadStream *stre byte *data = (byte *)malloc(dataSize); stream->read(data, dataSize); delete stream; - return Audio::makeRawMemoryStream(data, dataSize, DisposeAfterUse::YES, _streams[_audioStreamIndex]->sample_rate, flags, 0, 0); + return Audio::makeRawMemoryStream(data, dataSize, DisposeAfterUse::YES, _streams[_audioStreamIndex]->sample_rate, flags); } else if (_streams[_audioStreamIndex]->codec_tag == MKID_BE('ima4')) { // Riven uses this codec (as do some Myst ME videos) return Audio::makeADPCMStream(stream, true, stream->size(), Audio::kADPCMApple, _streams[_audioStreamIndex]->sample_rate, _streams[_audioStreamIndex]->channels, 34); diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index b775ce48d9..c144ec8662 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -477,7 +477,7 @@ Audio::AudioStream *AmigaSoundMan_br::loadChannelData(const char *filename, Chan // TODO: Confirm sound rate int rate = 11025; - input = Audio::makeRawMemoryStream((byte *)data, dataSize, DisposeAfterUse::YES, rate, 0, 0, 0); + input = Audio::makeRawMemoryStream((byte *)data, dataSize, DisposeAfterUse::YES, rate, 0); } else { input = Audio::make8SVXStream(*stream, looping); } diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index 303d323265..07a7ab7828 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -377,7 +377,7 @@ Audio::AudioStream *AmigaSoundMan_ns::loadChannelData(const char *filename, Chan if (!scumm_stricmp("beep", filename)) { int rate = 11934; ch->volume = 160; - input = Audio::makeRawMemoryStream((byte *)beepSoundBuffer, beepSoundBufferSize, DisposeAfterUse::NO, rate, 0, 0, 0); + input = Audio::makeRawMemoryStream((byte *)beepSoundBuffer, beepSoundBufferSize, DisposeAfterUse::NO, rate, 0); } else { Common::SeekableReadStream *stream = _vm->_disk->loadSound(filename); input = Audio::make8SVXStream(*stream, looping); diff --git a/engines/scumm/player_mod.cpp b/engines/scumm/player_mod.cpp index 9364ce0ee5..7410fff4e5 100644 --- a/engines/scumm/player_mod.cpp +++ b/engines/scumm/player_mod.cpp @@ -95,7 +95,7 @@ void Player_MOD::startChannel(int id, void *data, int size, int rate, uint8 vol, _channels[i].pan = pan; _channels[i].freq = rate; _channels[i].ctr = 0; - _channels[i].input = Audio::makeRawMemoryStream((const byte*)data, size, DisposeAfterUse::YES, rate, (loopStart != loopEnd ? Audio::FLAG_LOOP : 0), loopStart, loopEnd); + _channels[i].input = Audio::makeRawMemoryStream_OLD((const byte*)data, size, DisposeAfterUse::YES, rate, (loopStart != loopEnd ? Audio::FLAG_LOOP : 0), loopStart, loopEnd); // read the first sample _channels[i].input->readBuffer(&_channels[i].pos, 1); } diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index e9aa6079b5..05912208b0 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -353,7 +353,7 @@ void Sound::playSound(int soundID) { if (loopEnd > 0) flags |= Audio::FLAG_LOOP; - stream = Audio::makeRawMemoryStream(sound, waveSize, DisposeAfterUse::YES, rate, flags, loopStart, loopEnd); + stream = Audio::makeRawMemoryStream_OLD(sound, waveSize, DisposeAfterUse::YES, rate, flags, loopStart, loopEnd); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID, 255, 0); } break; @@ -446,7 +446,7 @@ void Sound::playSound(int soundID) { } memcpy(sound, ptr + READ_BE_UINT16(ptr + 8), size); - stream = Audio::makeRawMemoryStream(sound, size, DisposeAfterUse::YES, rate, flags, loopStart, loopEnd); + stream = Audio::makeRawMemoryStream_OLD(sound, size, DisposeAfterUse::YES, rate, flags, loopStart, loopEnd); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID, vol, 0); } else { diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp index 1b7fd8fa50..b6792907e9 100644 --- a/engines/sky/sound.cpp +++ b/engines/sky/sound.cpp @@ -1121,7 +1121,7 @@ void Sound::playSound(uint16 sound, uint16 volume, uint8 channel) { } - Audio::AudioStream *stream = Audio::makeRawMemoryStream(_soundData + dataOfs, dataSize, DisposeAfterUse::NO, sampleRate, flags, loopSta, loopEnd); + Audio::AudioStream *stream = Audio::makeRawMemoryStream_OLD(_soundData + dataOfs, dataSize, DisposeAfterUse::NO, sampleRate, flags, loopSta, loopEnd); if (channel == 0) _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_ingameSound0, stream, SOUND_CH0, volume, 0); diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp index d233f39edf..a2156b698d 100644 --- a/sound/audiostream.cpp +++ b/sound/audiostream.cpp @@ -253,7 +253,7 @@ bool SubSeekableAudioStream::seek(const Timestamp &where) { void QueuingAudioStream::queueBuffer(byte *data, uint32 size, DisposeAfterUse::Flag disposeAfterUse, byte flags) { - AudioStream *stream = makeRawMemoryStream(data, size, disposeAfterUse, getRate(), flags, 0, 0); + AudioStream *stream = makeRawMemoryStream_OLD(data, size, disposeAfterUse, getRate(), flags, 0, 0); queueAudioStream(stream, DisposeAfterUse::YES); } diff --git a/sound/raw.cpp b/sound/raw.cpp index ef77f3040f..7899c8af87 100644 --- a/sound/raw.cpp +++ b/sound/raw.cpp @@ -359,7 +359,7 @@ SeekableAudioStream *makeRawMemoryStream(const byte *ptr, uint32 len, } -AudioStream *makeRawMemoryStream(const byte *ptr, uint32 len, +AudioStream *makeRawMemoryStream_OLD(const byte *ptr, uint32 len, DisposeAfterUse::Flag autoFree, int rate, byte flags, uint loopStart, uint loopEnd) { @@ -422,34 +422,4 @@ SeekableAudioStream *makeRawDiskStream(Common::SeekableReadStream *stream, RawDi } } -AudioStream *makeRawDiskStream(Common::SeekableReadStream *stream, RawDiskStreamAudioBlock *block, - int numBlocks, int rate, byte flags, DisposeAfterUse::Flag disposeStream, uint loopStart, uint loopEnd) { - SeekableAudioStream *s = makeRawDiskStream(stream, block, numBlocks, rate, flags, disposeStream); - - if ((flags & Audio::FLAG_LOOP) != 0) { - const bool isStereo = (flags & Audio::FLAG_STEREO) != 0; - const bool is16Bit = (flags & Audio::FLAG_16BITS) != 0; - - const uint len = s->getLength().totalNumberOfFrames() / (is16Bit ? 2 : 1) / (isStereo ? 2 : 1); - - if (loopEnd == 0) - loopEnd = len; - assert(loopStart <= loopEnd); - assert(loopEnd <= len); - - // Verify the buffer sizes are sane - if (is16Bit && isStereo) - assert((loopStart & 3) == 0 && (loopEnd & 3) == 0); - else if (is16Bit || isStereo) - assert((loopStart & 1) == 0 && (loopEnd & 1) == 0); - - const uint32 extRate = s->getRate() * (is16Bit ? 2 : 1) * (isStereo ? 2 : 1); - - return new SubLoopingAudioStream(s, 0, Timestamp(0, loopStart, extRate), Timestamp(0, loopEnd, extRate)); - } else { - return s; - } -} - - } // End of namespace Audio diff --git a/sound/raw.h b/sound/raw.h index 6c2ced0180..d187c325e1 100644 --- a/sound/raw.h +++ b/sound/raw.h @@ -95,7 +95,7 @@ SeekableAudioStream *makeRawMemoryStream(const byte *ptr, uint32 len, * signed native endian). Optionally supports (infinite) looping of a portion * of the data. */ -AudioStream *makeRawMemoryStream(const byte *ptr, uint32 len, +AudioStream *makeRawMemoryStream_OLD(const byte *ptr, uint32 len, DisposeAfterUse::Flag autofreeBuffer, int rate, byte flags, uint loopStart, uint loopEnd); @@ -128,21 +128,6 @@ SeekableAudioStream *makeRawDiskStream(Common::SeekableReadStream *stream, int rate, byte flags, DisposeAfterUse::Flag disposeStream); -/** - * NOTE: - * This API is considered deprecated. - * - * Factory function for a Raw Disk Stream. This can stream raw PCM - * audio data from disk. The function takes an pointer to an array of - * RawDiskStreamAudioBlock which defines the start position and length of - * each block of uncompressed audio in the stream. - */ -AudioStream *makeRawDiskStream(Common::SeekableReadStream *stream, - RawDiskStreamAudioBlock *block, int numBlocks, - int rate, byte flags, - DisposeAfterUse::Flag disposeStream, - uint loopStart, uint loopEnd); - } // End of namespace Audio diff --git a/sound/voc.cpp b/sound/voc.cpp index 27f78f9eeb..a5e5096ad3 100644 --- a/sound/voc.cpp +++ b/sound/voc.cpp @@ -353,7 +353,7 @@ AudioStream *makeVOCStream(Common::SeekableReadStream &stream, byte flags, uint if (!data) return 0; - return makeRawMemoryStream(data, size, DisposeAfterUse::YES, rate, flags, loopStart, loopEnd); + return makeRawMemoryStream_OLD(data, size, DisposeAfterUse::YES, rate, flags, loopStart, loopEnd); #endif } |