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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Feb 28 13:55:01 CET 2007


Revision: 25906
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25906&view=rev
Author:   fingolfin
Date:     2007-02-28 04:54:59 -0800 (Wed, 28 Feb 2007)

Log Message:
-----------
cleanup

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

Modified: scummvm/trunk/sound/audiostream.cpp
===================================================================
--- scummvm/trunk/sound/audiostream.cpp	2007-02-28 10:44:52 UTC (rev 25905)
+++ scummvm/trunk/sound/audiostream.cpp	2007-02-28 12:54:59 UTC (rev 25906)
@@ -32,6 +32,15 @@
 #include "sound/flac.h"
 
 
+// This used to be an inline template function, but
+// buggy template function handling in MSVC6 forced
+// us to go with the macro approach. So far this is
+// the only template function that MSVC6 seemed to
+// compile incorrectly. Knock on wood.
+#define READ_ENDIAN_SAMPLE(is16Bit, isUnsigned, ptr, isLE) \
+	((is16Bit ? (isLE ? READ_LE_UINT16(ptr) : READ_BE_UINT16(ptr)) : (*ptr << 8)) ^ (isUnsigned ? 0x8000 : 0))
+
+
 namespace Audio {
 
 struct StreamFileFormat {
@@ -62,8 +71,7 @@
 	{ NULL, NULL, NULL } // Terminator
 };
 
-AudioStream* AudioStream::openStreamFile(const char *filename)
-{
+AudioStream* AudioStream::openStreamFile(const char *filename) {
 	char buffer[1024];
 	const uint len = strlen(filename);
 	assert(len+6 < sizeof(buffer)); // we need a bigger buffer if wrong

Modified: scummvm/trunk/sound/audiostream.h
===================================================================
--- scummvm/trunk/sound/audiostream.h	2007-02-28 10:44:52 UTC (rev 25905)
+++ scummvm/trunk/sound/audiostream.h	2007-02-28 12:54:59 UTC (rev 25906)
@@ -89,27 +89,6 @@
 	static AudioStream* openStreamFile(const char *filename);
 };
 
-/**
- * A simple AudioStream which represents a 'silent' stream,
- * containing the specified number of zero samples.
- */
-class ZeroInputStream : public AudioStream {
-private:
-	int _len;
-public:
-	ZeroInputStream(uint len) : _len(len) { }
-	int readBuffer(int16 *buffer, const int numSamples) {
-		int samples = MIN(_len, numSamples);
-		memset(buffer, 0, samples * 2);
-		_len -= samples;
-		return samples;
-	}
-	bool isStereo() const { return false; }
-	bool eos() const { return _len <= 0; }
-
-	int getRate() const { return -1; }
-};
-
 AudioStream *makeLinearInputStream(int rate, byte flags, const byte *ptr, uint32 len, uint loopOffset, uint loopLen);
 
 /**
@@ -125,15 +104,6 @@
 AppendableAudioStream *makeAppendableAudioStream(int rate, byte _flags, uint32 len);
 
 
-// This used to be an inline template function, but
-// buggy template function handling in MSVC6 forced
-// us to go with the macro approach. So far this is
-// the only template function that MSVC6 seemed to
-// compile incorrectly. Knock on wood.
-#define READ_ENDIAN_SAMPLE(is16Bit, isUnsigned, ptr, isLE) \
-	((is16Bit ? (isLE ? READ_LE_UINT16(ptr) : READ_BE_UINT16(ptr)) : (*ptr << 8)) ^ (isUnsigned ? 0x8000 : 0))
-
-
 } // End of namespace Audio
 
 #endif


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