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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Jan 8 17:27:34 CET 2010


Revision: 47160
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47160&view=rev
Author:   lordhoto
Date:     2010-01-08 16:27:29 +0000 (Fri, 08 Jan 2010)

Log Message:
-----------
Since AudioStream looping is no longer handled by the Mixer, drop Mixer::playAudioStreamLooping. (There's Audio::makeLoopingAudioStream).

Modified Paths:
--------------
    scummvm/trunk/engines/agos/sound.cpp
    scummvm/trunk/engines/kyra/sound_digital.cpp
    scummvm/trunk/engines/saga/music.cpp
    scummvm/trunk/engines/sword2/sound.cpp
    scummvm/trunk/engines/tucker/resource.cpp
    scummvm/trunk/engines/tucker/sequences.cpp
    scummvm/trunk/sound/audiocd.cpp
    scummvm/trunk/sound/mixer.cpp
    scummvm/trunk/sound/mixer.h

Modified: scummvm/trunk/engines/agos/sound.cpp
===================================================================
--- scummvm/trunk/engines/agos/sound.cpp	2010-01-08 16:25:51 UTC (rev 47159)
+++ scummvm/trunk/engines/agos/sound.cpp	2010-01-08 16:27:29 UTC (rev 47160)
@@ -788,7 +788,7 @@
 	convertVolume(vol);
 	convertPan(pan);
 
-	_mixer->playInputStreamLooping(Audio::Mixer::kSFXSoundType, handle, sndStream, loop ? 0 : 1, -1, vol, pan);
+	_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, Audio::makeLoopingAudioStream(sndStream, loop ? 0 : 1), -1, vol, pan);
 }
 
 void Sound::stopSfx5() {

Modified: scummvm/trunk/engines/kyra/sound_digital.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_digital.cpp	2010-01-08 16:25:51 UTC (rev 47159)
+++ scummvm/trunk/engines/kyra/sound_digital.cpp	2010-01-08 16:27:29 UTC (rev 47160)
@@ -481,13 +481,7 @@
 	if (type == Audio::Mixer::kSpeechSoundType && _vm->heliumMode())
 		use->stream->setRate(32765);
 
-	if (loop) {
-		Audio::Timestamp zero(0, 1000);
-		_mixer->playInputStreamLooping(type, &use->handle, use->stream, 0, zero, zero, -1, volume);
-	} else {
-		_mixer->playInputStream(type, &use->handle, use->stream, -1, volume);
-	}
-
+	_mixer->playInputStream(type, &use->handle, makeLoopingAudioStream(use->stream, loop ? 0 : 1), -1, volume);
 	return use - _sounds;
 }
 

Modified: scummvm/trunk/engines/saga/music.cpp
===================================================================
--- scummvm/trunk/engines/saga/music.cpp	2010-01-08 16:25:51 UTC (rev 47159)
+++ scummvm/trunk/engines/saga/music.cpp	2010-01-08 16:27:29 UTC (rev 47160)
@@ -279,7 +279,8 @@
 	for (int i = 0; i < 2; ++i) {
 		stream = Audio::SeekableAudioStream::openStreamFile(trackName[i]);
 		if (stream) {
-			_mixer->playInputStreamLooping(Audio::Mixer::kMusicSoundType, &_musicHandle, stream, (flags == MUSIC_LOOP) ? 0 : 1);
+			_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle,
+			                        Audio::makeLoopingAudioStream(stream, (flags == MUSIC_LOOP) ? 0 : 1));
 			_digitalMusic = true;
 			return;
 		}
@@ -336,7 +337,8 @@
 
 	if (audioStream) {
 		debug(2, "Playing digitized music");
-		_mixer->playInputStreamLooping(Audio::Mixer::kMusicSoundType, &_musicHandle, audioStream, (flags == MUSIC_LOOP ? 0 : 1));
+		_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_musicHandle,
+		                        Audio::makeLoopingAudioStream(audioStream, (flags == MUSIC_LOOP ? 0 : 1)));
 		_digitalMusic = true;
 		return;
 	}

Modified: scummvm/trunk/engines/sword2/sound.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sound.cpp	2010-01-08 16:25:51 UTC (rev 47159)
+++ scummvm/trunk/engines/sword2/sound.cpp	2010-01-08 16:27:29 UTC (rev 47160)
@@ -340,7 +340,9 @@
 
 	assert(input);
 
-	_vm->_mixer->playInputStreamLooping(soundType, handle, input, loop ? 0 : 1, -1, vol, pan, true, false, isReverseStereo());
+	_vm->_mixer->playInputStream(soundType, handle,
+	                             Audio::makeLoopingAudioStream(input, loop ? 0 : 1),
+	                             -1, vol, pan, true, false, isReverseStereo());
 
 	return RD_OK;
 }

Modified: scummvm/trunk/engines/tucker/resource.cpp
===================================================================
--- scummvm/trunk/engines/tucker/resource.cpp	2010-01-08 16:25:51 UTC (rev 47159)
+++ scummvm/trunk/engines/tucker/resource.cpp	2010-01-08 16:27:29 UTC (rev 47160)
@@ -954,7 +954,8 @@
 
 	if (stream) {
 		_mixer->stopHandle(*handle);
-		_mixer->playInputStreamLooping(type, handle, stream, loop ? 0 : 1, -1, scaleMixerVolume(volume, kMaxSoundVolume));
+		_mixer->playInputStream(type, handle, Audio::makeLoopingAudioStream(stream, loop ? 0 : 1),
+		                        -1, scaleMixerVolume(volume, kMaxSoundVolume));
 	}
 }
 

Modified: scummvm/trunk/engines/tucker/sequences.cpp
===================================================================
--- scummvm/trunk/engines/tucker/sequences.cpp	2010-01-08 16:25:51 UTC (rev 47159)
+++ scummvm/trunk/engines/tucker/sequences.cpp	2010-01-08 16:27:29 UTC (rev 47160)
@@ -635,7 +635,8 @@
 			break;
 		case 1:
 			if ((s = loadSound(p->num, kAnimationSoundTypeWAV)) != 0) {
-				_mixer->playInputStreamLooping(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], s, 0, -1, scaleMixerVolume(p->volume));
+				_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundsHandle[p->index], Audio::makeLoopingAudioStream(s, 0),
+				                        -1, scaleMixerVolume(p->volume));
 			}
 			break;
 		case 2:

Modified: scummvm/trunk/sound/audiocd.cpp
===================================================================
--- scummvm/trunk/sound/audiocd.cpp	2010-01-08 16:25:51 UTC (rev 47159)
+++ scummvm/trunk/sound/audiocd.cpp	2010-01-08 16:27:29 UTC (rev 47160)
@@ -78,7 +78,8 @@
 			repetitions. Finally, -1 means infinitely many
 			*/
 			_emulating = true;
-			_mixer->playInputStreamLooping(Audio::Mixer::kMusicSoundType, &_handle, stream, (numLoops < 1) ? numLoops + 1 : numLoops, start, end);
+			_mixer->playInputStream(Mixer::kMusicSoundType, &_handle,
+			                        makeLoopingAudioStream(stream, start, end, (numLoops < 1) ? numLoops + 1 : numLoops));
 		} else {
 			_emulating = false;
 			if (!only_emulate)

Modified: scummvm/trunk/sound/mixer.cpp
===================================================================
--- scummvm/trunk/sound/mixer.cpp	2010-01-08 16:25:51 UTC (rev 47159)
+++ scummvm/trunk/sound/mixer.cpp	2010-01-08 16:27:29 UTC (rev 47160)
@@ -264,49 +264,6 @@
 	insertChannel(handle, chan);
 }
 
-void Mixer::playInputStreamLooping(
-			SoundType type,
-			SoundHandle *handle,
-			RewindableAudioStream *input,
-			uint loopCount,
-			int id, byte volume, int8 balance,
-			bool autofreeStream,
-			bool permanent,
-			bool reverseStereo) {
-
-	// Just in case the user wants the stream just looped once, we will take care of that with the normal
-	// playInputStream method
-	if (loopCount == 1) {
-		playInputStream(type, handle, input, id, volume, balance, autofreeStream, permanent, reverseStereo);
-		return;
-	}
-
-	LoopingAudioStream *loopingStream = new LoopingAudioStream(input, loopCount, autofreeStream);
-	assert(loopingStream);
-
-	playInputStream(type, handle, loopingStream, id, volume, balance, true, permanent, reverseStereo);
-}
-
-void Mixer::playInputStreamLooping(
-			SoundType type,
-			SoundHandle *handle,
-			SeekableAudioStream *input,
-			uint loopCount,
-			Timestamp loopStart, Timestamp loopEnd,
-			int id, byte volume, int8 balance,
-			bool autofreeStream,
-			bool permanent,
-			bool reverseStereo) {
-
-	if (loopStart >= loopEnd)
-		return;
-
-	input = new SubSeekableAudioStream(input, loopStart, loopEnd, autofreeStream);
-	assert(input);
-
-	playInputStreamLooping(type, handle, input, loopCount, id, volume, balance, true, permanent, reverseStereo);
-}
-
 void MixerImpl::mixCallback(byte *samples, uint len) {
 	assert(samples);
 

Modified: scummvm/trunk/sound/mixer.h
===================================================================
--- scummvm/trunk/sound/mixer.h	2010-01-08 16:25:51 UTC (rev 47159)
+++ scummvm/trunk/sound/mixer.h	2010-01-08 16:27:29 UTC (rev 47160)
@@ -171,71 +171,6 @@
 		bool reverseStereo = false) = 0;
 
 	/**
-	 * Start playing the given audio input stream with looping.
-	 *
-	 * Note that the sound id assigned below is unique. At most one stream
-	 * with a given id can play at any given time. Trying to play a sound
-	 * with an id that is already in use causes the new sound to be not played.
-	 *
-	 * @param type	the type (voice/sfx/music) of the stream
-	 * @param handle	a SoundHandle which can be used to reference and control
-	 *                  the stream via suitable mixer methods
-	 * @param input	the actual RewindableAudioStream to be played
-	 * @param loopCount			how often the data shall be looped (0 = infinite)
-	 * @param id	a unique id assigned to this stream
-	 * @param volume	the volume with which to play the sound, ranging from 0 to 255
-	 * @param balance	the balance with which to play the sound, ranging from -128 to 127
-	 * @param autofreeStream	a flag indicating whether the stream should be
-	 *                          freed after playback finished
-	 * @param permanent	a flag indicating whether a plain stopAll call should
-	 *                  not stop this particular stream
-	 * @param reverseStereo	a flag indicating whether left and right channels shall be swapped
-	 */
-	void playInputStreamLooping(
-		SoundType type,
-		SoundHandle *handle,
-		RewindableAudioStream *input,
-		uint loopCount,
-		int id = -1, byte volume = kMaxChannelVolume, int8 balance = 0,
-		bool autofreeStream = true,
-		bool permanent = false,
-		bool reverseStereo = false);
-
-	/**
-	 * Start playing the given audio input stream with looping.
-	 *
-	 * Note that the sound id assigned below is unique. At most one stream
-	 * with a given id can play at any given time. Trying to play a sound
-	 * with an id that is already in use causes the new sound to be not played.
-	 *
-	 * @param type	the type (voice/sfx/music) of the stream
-	 * @param handle	a SoundHandle which can be used to reference and control
-	 *                  the stream via suitable mixer methods
-	 * @param input	the actual SeekableAudioStream to be played
-	 * @param loopCount			how often the data shall be looped (0 = infinite)
-	 * @param loopStart			the time offset from which to start playback
-	 * @param loopEnd			the time offset where the loop should end
-	 * @param id	a unique id assigned to this stream
-	 * @param volume	the volume with which to play the sound, ranging from 0 to 255
-	 * @param balance	the balance with which to play the sound, ranging from -128 to 127
-	 * @param autofreeStream	a flag indicating whether the stream should be
-	 *                          freed after playback finished
-	 * @param permanent	a flag indicating whether a plain stopAll call should
-	 *                  not stop this particular stream
-	 * @param reverseStereo	a flag indicating whether left and right channels shall be swapped
-	 */
-	void playInputStreamLooping(
-		SoundType type,
-		SoundHandle *handle,
-		SeekableAudioStream *input,
-		uint loopCount,
-		Timestamp loopStart, Timestamp loopEnd,
-		int id = -1, byte volume = kMaxChannelVolume, int8 balance = 0,
-		bool autofreeStream = true,
-		bool permanent = false,
-		bool reverseStereo = false);
-
-	/**
 	 * Stop all currently playing sounds.
 	 */
 	virtual void stopAll() = 0;


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