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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Apr 29 23:54:40 CEST 2010


Revision: 48869
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48869&view=rev
Author:   fingolfin
Date:     2010-04-29 21:54:39 +0000 (Thu, 29 Apr 2010)

Log Message:
-----------
Rename input -> stream

Modified Paths:
--------------
    scummvm/trunk/sound/mixer.cpp
    scummvm/trunk/sound/mixer.h

Modified: scummvm/trunk/sound/mixer.cpp
===================================================================
--- scummvm/trunk/sound/mixer.cpp	2010-04-29 21:44:53 UTC (rev 48868)
+++ scummvm/trunk/sound/mixer.cpp	2010-04-29 21:54:39 UTC (rev 48869)
@@ -44,7 +44,7 @@
  */
 class Channel {
 public:
-	Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *input, DisposeAfterUse::Flag autofreeStream, bool reverseStereo, int id, bool permanent);
+	Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *stream, DisposeAfterUse::Flag autofreeStream, bool reverseStereo, int id, bool permanent);
 	~Channel();
 
 	/**
@@ -60,7 +60,7 @@
 	/**
 	 * Queries whether the channel is still playing or not.
 	 */
-	bool isFinished() const { return _input->endOfStream(); }
+	bool isFinished() const { return _stream->endOfStream(); }
 
 	/**
 	 * Queries whether the channel is a permanent channel.
@@ -152,7 +152,7 @@
 
 	DisposeAfterUse::Flag _autofreeStream;
 	RateConverter *_converter;
-	AudioStream *_input;
+	AudioStream *_stream;
 };
 
 #pragma mark -
@@ -215,15 +215,15 @@
 void MixerImpl::playStream(
 			SoundType type,
 			SoundHandle *handle,
-			AudioStream *input,
+			AudioStream *stream,
 			int id, byte volume, int8 balance,
 			DisposeAfterUse::Flag autofreeStream,
 			bool permanent,
 			bool reverseStereo) {
 	Common::StackLock lock(_mutex);
 
-	if (input == 0) {
-		warning("input stream is 0");
+	if (stream == 0) {
+		warning("stream is 0");
 		return;
 	}
 
@@ -241,13 +241,13 @@
 				// Thus, as a quick rule of thumb, you should never, ever,
 				// try to play QueuingAudioStreams with a sound id.
 				if (autofreeStream == DisposeAfterUse::YES)
-					delete input;
+					delete stream;
 				return;
 			}
 	}
 
 	// Create the channel
-	Channel *chan = new Channel(this, type, input, autofreeStream, reverseStereo, id, permanent);
+	Channel *chan = new Channel(this, type, stream, autofreeStream, reverseStereo, id, permanent);
 	chan->setVolume(volume);
 	chan->setBalance(balance);
 	insertChannel(handle, chan);
@@ -436,23 +436,23 @@
 #pragma mark --- Channel implementations ---
 #pragma mark -
 
-Channel::Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *input,
+Channel::Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *stream,
                  DisposeAfterUse::Flag autofreeStream, bool reverseStereo, int id, bool permanent)
     : _type(type), _mixer(mixer), _id(id), _permanent(permanent), _volume(Mixer::kMaxChannelVolume),
       _balance(0), _pauseLevel(0), _samplesConsumed(0), _samplesDecoded(0), _mixerTimeStamp(0),
       _pauseStartTime(0), _pauseTime(0), _autofreeStream(autofreeStream), _converter(0),
-      _input(input) {
+      _stream(stream) {
 	assert(mixer);
-	assert(input);
+	assert(stream);
 
 	// Get a rate converter instance
-	_converter = makeRateConverter(_input->getRate(), mixer->getOutputRate(), _input->isStereo(), reverseStereo);
+	_converter = makeRateConverter(_stream->getRate(), mixer->getOutputRate(), _stream->isStereo(), reverseStereo);
 }
 
 Channel::~Channel() {
 	delete _converter;
 	if (_autofreeStream == DisposeAfterUse::YES)
-		delete _input;
+		delete _stream;
 }
 
 void Channel::setVolume(const byte volume) {
@@ -535,9 +535,9 @@
 }
 
 void Channel::mix(int16 *data, uint len) {
-	assert(_input);
+	assert(_stream);
 
-	if (_input->endOfData()) {
+	if (_stream->endOfData()) {
 		// TODO: call drain method
 	} else {
 		assert(_converter);
@@ -545,7 +545,7 @@
 		_samplesConsumed = _samplesDecoded;
 		_mixerTimeStamp = g_system->getMillis();
 		_pauseTime = 0;
-		_samplesDecoded += _converter->flow(*_input, data, len, _volL, _volR);
+		_samplesDecoded += _converter->flow(*_stream, data, len, _volL, _volR);
 	}
 }
 

Modified: scummvm/trunk/sound/mixer.h
===================================================================
--- scummvm/trunk/sound/mixer.h	2010-04-29 21:44:53 UTC (rev 48868)
+++ scummvm/trunk/sound/mixer.h	2010-04-29 21:54:39 UTC (rev 48869)
@@ -59,7 +59,7 @@
 
 /**
  * The main audio mixer handles mixing of an arbitrary number of
- * input audio streams (in the form of AudioStream instances).
+ * audio streams (in the form of AudioStream instances).
  */
 class Mixer {
 public:
@@ -96,7 +96,7 @@
 
 
 	/**
-	 * Start playing the given audio input stream.
+	 * Start playing the given audio stream.
 	 *
 	 * 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
@@ -105,7 +105,7 @@
 	 * @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 AudioStream to be played
+	 * @param stream	the actual AudioStream to be played
 	 * @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
@@ -118,7 +118,7 @@
 	virtual void playStream(
 		SoundType type,
 		SoundHandle *handle,
-		AudioStream *input,
+		AudioStream *stream,
 		int id = -1,
 		byte volume = kMaxChannelVolume,
 		int8 balance = 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