Remove the deprecated FLAC, Vorbis and MP3 factories.

svn-id: r47134
This commit is contained in:
Johannes Schickel 2010-01-07 17:14:44 +00:00
parent b47725540f
commit aa2f55ddc6
8 changed files with 5 additions and 145 deletions

View File

@ -448,7 +448,7 @@ Audio::AudioStream *Sound::makeMohawkWaveStream(Common::SeekableReadStream *stre
} else if (data_chunk.encoding == kCodecMPEG2) {
#ifdef USE_MAD
Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(data_chunk.audio_data, data_chunk.size, Common::DisposeAfterUse::YES);
return Audio::makeMP3Stream(dataStream, true, 0, 0, !loop);
return Audio::makeLoopingAudioStream(Audio::makeMP3Stream(dataStream, true), loop ? 0 : 1);
#else
warning ("MAD library not included - unable to play MP2 audio");
#endif

View File

@ -177,7 +177,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) {
if (!_audioSource) {
sprintf(fileName, "%s.flac", fileBase);
if (_file.open(fileName)) {
_audioSource = Audio::makeFlacStream(&_file, false, 0, 0, loop ? 0 : 1);
_audioSource = Audio::makeLoopingAudioStream(Audio::makeFlacStream(&_file, false), loop ? 0 : 1);
if (!_audioSource)
_file.close();
}
@ -186,7 +186,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) {
if (!_audioSource) {
sprintf(fileName, "%s.fla", fileBase);
if (_file.open(fileName)) {
_audioSource = Audio::makeFlacStream(&_file, false, 0, 0, loop ? 0 : 1);
_audioSource = Audio::makeLoopingAudioStream(Audio::makeFlacStream(&_file, false), loop ? 0 : 1);
if (!_audioSource)
_file.close();
}
@ -196,7 +196,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) {
if (!_audioSource) {
sprintf(fileName, "%s.ogg", fileBase);
if (_file.open(fileName)) {
_audioSource = Audio::makeVorbisStream(&_file, false, 0, 0, loop ? 0 : 1);
_audioSource = Audio::makeLoopingAudioStream(Audio::makeVorbisStream(&_file, false), loop ? 0 : 1);
if (!_audioSource)
_file.close();
}
@ -206,7 +206,7 @@ bool MusicHandle::play(const char *fileBase, bool loop) {
if (!_audioSource) {
sprintf(fileName, "%s.mp3", fileBase);
if (_file.open(fileName)) {
_audioSource = Audio::makeMP3Stream(&_file, false, 0, 0, loop ? 0 : 1);
_audioSource = Audio::makeLoopingAudioStream(Audio::makeMP3Stream(&_file, false), loop ? 0 : 1);
if (!_audioSource)
_file.close();
}

View File

@ -724,30 +724,6 @@ void FlacInputStream::callWrapError(const ::FLAC__SeekableStreamDecoder *decoder
#pragma mark --- Flac factory functions ---
#pragma mark -
AudioStream *makeFlacStream(
Common::SeekableReadStream *stream,
bool disposeAfterUse,
uint32 startTime,
uint32 duration,
uint numLoops) {
SeekableAudioStream *input = new FlacInputStream(stream, disposeAfterUse);
assert(input);
if (startTime || duration) {
Timestamp start(startTime, 1000), end(startTime + duration, 1000);
if (!duration)
end = input->getLength();
input = new SubSeekableAudioStream(input, start, end);
assert(input);
}
return makeLoopingAudioStream(input, numLoops);
}
SeekableAudioStream *makeFlacStream(
Common::SeekableReadStream *stream,
bool disposeAfterUse) {

View File

@ -54,29 +54,6 @@ namespace Audio {
class AudioStream;
class SeekableAudioStream;
/**
* TODO: This is an deprecated interface, it is only for the transition to
* SeekableAudioStream in the engines.
*
* Create a new AudioStream from the FLAC data in the given stream.
* Allows for looping (which is why we require a SeekableReadStream),
* and specifying only a portion of the data to be played, based
* on time offsets.
*
* @param stream the SeekableReadStream from which to read the FLAC data
* @param disposeAfterUse whether to delete the stream after use
* @param startTime the (optional) time offset in milliseconds from which to start playback
* @param duration the (optional) time in milliseconds specifying how long to play
* @param numLoops how often the data shall be looped (0 = infinite)
* @return a new AudioStream, or NULL, if an error occured
*/
AudioStream *makeFlacStream(
Common::SeekableReadStream *stream,
bool disposeAfterUse,
uint32 startTime,
uint32 duration,
uint numLoops);
/**
* Create a new SeekableAudioStream from the FLAC data in the given stream.
* Allows for seeking (which is why we require a SeekableReadStream).

View File

@ -338,29 +338,6 @@ int MP3InputStream::readBuffer(int16 *buffer, const int numSamples) {
#pragma mark --- MP3 factory functions ---
#pragma mark -
AudioStream *makeMP3Stream(
Common::SeekableReadStream *stream,
bool disposeAfterUse,
uint32 startTime,
uint32 duration,
uint numLoops) {
SeekableAudioStream *mp3 = new MP3InputStream(stream, disposeAfterUse);
assert(mp3);
if (startTime || duration) {
Timestamp start(startTime, 1000), end(startTime + duration, 1000);
if (!duration)
end = mp3->getLength();
mp3 = new SubSeekableAudioStream(mp3, start, end);
assert(mp3);
}
return makeLoopingAudioStream(mp3, numLoops);
}
SeekableAudioStream *makeMP3Stream(
Common::SeekableReadStream *stream,
bool disposeAfterUse) {

View File

@ -54,29 +54,6 @@ namespace Audio {
class AudioStream;
class SeekableAudioStream;
/**
* TODO: This is an deprecated interface, it is only for the transition to
* SeekableAudioStream in the engines.
*
* Create a new SeekableAudioStream from the MP3 data in the given stream.
* Allows for looping (which is why we require a SeekableReadStream),
* and specifying only a portion of the data to be played, based
* on time offsets.
*
* @param stream the SeekableReadStream from which to read the MP3 data
* @param disposeAfterUse whether to delete the stream after use
* @param startTime the (optional) time offset in milliseconds from which to start playback
* @param duration the (optional) time in milliseconds specifying how long to play
* @param numLoops how often the data shall be looped (0 = infinite)
* @return a new SeekableAudioStream, or NULL, if an error occured
*/
AudioStream *makeMP3Stream(
Common::SeekableReadStream *stream,
bool disposeAfterUse,
uint32 startTime,
uint32 duration,
uint numLoops);
/**
* Create a new SeekableAudioStream from the MP3 data in the given stream.
* Allows for seeking (which is why we require a SeekableReadStream).

View File

@ -239,30 +239,6 @@ bool VorbisInputStream::refill() {
#pragma mark --- Ogg Vorbis factory functions ---
#pragma mark -
AudioStream *makeVorbisStream(
Common::SeekableReadStream *stream,
bool disposeAfterUse,
uint32 startTime,
uint32 duration,
uint numLoops) {
SeekableAudioStream *input = new VorbisInputStream(stream, disposeAfterUse);
assert(input);
if (startTime || duration) {
Timestamp start(startTime, 1000), end(startTime + duration, 1000);
if (!duration)
end = input->getLength();
input = new SubSeekableAudioStream(input, start, end);
assert(input);
}
return makeLoopingAudioStream(input, numLoops);
}
SeekableAudioStream *makeVorbisStream(
Common::SeekableReadStream *stream,
bool disposeAfterUse) {

View File

@ -54,29 +54,6 @@ namespace Audio {
class AudioStream;
class SeekableAudioStream;
/**
* TODO: This is an deprecated interface, it is only for the transition to
* SeekableAudioStream in the engines.
*
* Create a new AudioStream from the Ogg Vorbis data in the given stream.
* Allows for looping (which is why we require a SeekableReadStream),
* and specifying only a portion of the data to be played, based
* on time offsets.
*
* @param stream the SeekableReadStream from which to read the Ogg Vorbis data
* @param disposeAfterUse whether to delete the stream after use
* @param startTime the (optional) time offset in milliseconds from which to start playback
* @param duration the (optional) time in milliseconds specifying how long to play
* @param numLoops how often the data shall be looped (0 = infinite)
* @return a new SeekableAudioStream, or NULL, if an error occured
*/
AudioStream *makeVorbisStream(
Common::SeekableReadStream *stream,
bool disposeAfterUse,
uint32 startTime,
uint32 duration,
uint numLoops);
/**
* Create a new SeekableAudioStream from the Ogg Vorbis data in the given stream.
* Allows for seeking (which is why we require a SeekableReadStream).