[Scummvm-cvs-logs] SF.net SVN: scummvm:[47134] scummvm/trunk

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Jan 7 18:14:44 CET 2010


Revision: 47134
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47134&view=rev
Author:   lordhoto
Date:     2010-01-07 17:14:44 +0000 (Thu, 07 Jan 2010)

Log Message:
-----------
Remove the deprecated FLAC, Vorbis and MP3 factories.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/sound.cpp
    scummvm/trunk/engines/sword1/music.cpp
    scummvm/trunk/sound/flac.cpp
    scummvm/trunk/sound/flac.h
    scummvm/trunk/sound/mp3.cpp
    scummvm/trunk/sound/mp3.h
    scummvm/trunk/sound/vorbis.cpp
    scummvm/trunk/sound/vorbis.h

Modified: scummvm/trunk/engines/mohawk/sound.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/sound.cpp	2010-01-07 17:04:32 UTC (rev 47133)
+++ scummvm/trunk/engines/mohawk/sound.cpp	2010-01-07 17:14:44 UTC (rev 47134)
@@ -448,7 +448,7 @@
 	} 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

Modified: scummvm/trunk/engines/sword1/music.cpp
===================================================================
--- scummvm/trunk/engines/sword1/music.cpp	2010-01-07 17:04:32 UTC (rev 47133)
+++ scummvm/trunk/engines/sword1/music.cpp	2010-01-07 17:14:44 UTC (rev 47134)
@@ -177,7 +177,7 @@
 	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 @@
 	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 @@
 	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 @@
 	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();
 		}

Modified: scummvm/trunk/sound/flac.cpp
===================================================================
--- scummvm/trunk/sound/flac.cpp	2010-01-07 17:04:32 UTC (rev 47133)
+++ scummvm/trunk/sound/flac.cpp	2010-01-07 17:14:44 UTC (rev 47134)
@@ -724,30 +724,6 @@
 #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) {

Modified: scummvm/trunk/sound/flac.h
===================================================================
--- scummvm/trunk/sound/flac.h	2010-01-07 17:04:32 UTC (rev 47133)
+++ scummvm/trunk/sound/flac.h	2010-01-07 17:14:44 UTC (rev 47134)
@@ -55,29 +55,6 @@
 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).
  *

Modified: scummvm/trunk/sound/mp3.cpp
===================================================================
--- scummvm/trunk/sound/mp3.cpp	2010-01-07 17:04:32 UTC (rev 47133)
+++ scummvm/trunk/sound/mp3.cpp	2010-01-07 17:14:44 UTC (rev 47134)
@@ -338,29 +338,6 @@
 #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) {

Modified: scummvm/trunk/sound/mp3.h
===================================================================
--- scummvm/trunk/sound/mp3.h	2010-01-07 17:04:32 UTC (rev 47133)
+++ scummvm/trunk/sound/mp3.h	2010-01-07 17:14:44 UTC (rev 47134)
@@ -55,30 +55,7 @@
 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).
  *
  * @param stream			the SeekableReadStream from which to read the MP3 data

Modified: scummvm/trunk/sound/vorbis.cpp
===================================================================
--- scummvm/trunk/sound/vorbis.cpp	2010-01-07 17:04:32 UTC (rev 47133)
+++ scummvm/trunk/sound/vorbis.cpp	2010-01-07 17:14:44 UTC (rev 47134)
@@ -239,30 +239,6 @@
 #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) {

Modified: scummvm/trunk/sound/vorbis.h
===================================================================
--- scummvm/trunk/sound/vorbis.h	2010-01-07 17:04:32 UTC (rev 47133)
+++ scummvm/trunk/sound/vorbis.h	2010-01-07 17:14:44 UTC (rev 47134)
@@ -55,29 +55,6 @@
 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).
  *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list