diff options
Diffstat (limited to 'sound')
| -rw-r--r-- | sound/adpcm.cpp | 2 | ||||
| -rw-r--r-- | sound/audiocd.cpp | 1 | ||||
| -rw-r--r-- | sound/flac.cpp | 9 | ||||
| -rw-r--r-- | sound/flac.h | 1 | ||||
| -rw-r--r-- | sound/mididrv.cpp | 11 | ||||
| -rw-r--r-- | sound/mididrv.h | 4 | ||||
| -rw-r--r-- | sound/mixer.cpp | 1 | ||||
| -rw-r--r-- | sound/mods/infogrames.cpp | 25 | ||||
| -rw-r--r-- | sound/mods/infogrames.h | 17 | ||||
| -rw-r--r-- | sound/mp3.cpp | 2 | ||||
| -rw-r--r-- | sound/mp3.h | 1 | ||||
| -rw-r--r-- | sound/softsynth/mt32.cpp | 7 | ||||
| -rw-r--r-- | sound/softsynth/mt32/mt32_file.cpp | 4 | ||||
| -rw-r--r-- | sound/softsynth/mt32/mt32_file.h | 2 | ||||
| -rw-r--r-- | sound/softsynth/mt32/partial.cpp | 2 | ||||
| -rw-r--r-- | sound/softsynth/mt32/synth.cpp | 2 | ||||
| -rw-r--r-- | sound/softsynth/mt32/tables.cpp | 2 | ||||
| -rw-r--r-- | sound/vorbis.cpp | 2 | ||||
| -rw-r--r-- | sound/vorbis.h | 1 | ||||
| -rw-r--r-- | sound/wave.cpp | 4 | 
20 files changed, 49 insertions, 51 deletions
diff --git a/sound/adpcm.cpp b/sound/adpcm.cpp index ad072af360..a30cf9c61e 100644 --- a/sound/adpcm.cpp +++ b/sound/adpcm.cpp @@ -38,7 +38,7 @@ class ADPCMInputStream : public AudioStream {  private:  	Common::SeekableReadStream *_stream;  	bool _disposeAfterUse; -	uint32 _endpos; +	int32 _endpos;  	int _channels;  	typesADPCM _type;  	uint32 _blockAlign; diff --git a/sound/audiocd.cpp b/sound/audiocd.cpp index 343d5bc440..8fc9100926 100644 --- a/sound/audiocd.cpp +++ b/sound/audiocd.cpp @@ -29,7 +29,6 @@  #include "sound/vorbis.h"  #include "sound/flac.h"  #include "engines/engine.h" -#include "common/file.h"  #include "common/util.h"  #include "common/system.h" diff --git a/sound/flac.cpp b/sound/flac.cpp index f058d2dc6f..7b46f0660f 100644 --- a/sound/flac.cpp +++ b/sound/flac.cpp @@ -27,7 +27,7 @@  #ifdef USE_FLAC -#include "common/file.h" +#include "common/stream.h"  #include "common/util.h"  #include "sound/audiostream.h" @@ -72,9 +72,6 @@ typedef FLAC__StreamDecoder FLAC__SeekableStreamDecoder;  #endif -using Common::File; - -  namespace Audio {  #pragma mark - @@ -149,7 +146,7 @@ public:  	bool isStreamDecoderReady() const { return getStreamDecoderState() == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC ; }  protected: -	uint getChannels() const { return MIN(_streaminfo.channels, MAX_OUTPUT_CHANNELS); } +	uint getChannels() const { return MIN<uint>(_streaminfo.channels, MAX_OUTPUT_CHANNELS); }  	bool allocateBuffer(uint minSamples); @@ -659,7 +656,7 @@ inline ::FLAC__StreamDecoderWriteStatus FlacInputStream::callbackWrite(const ::F  inline ::FLAC__SeekableStreamDecoderSeekStatus FlacInputStream::callbackSeek(FLAC__uint64 absoluteByteOffset) {  	_inStream->seek(absoluteByteOffset, SEEK_SET); -	const bool result = (absoluteByteOffset == _inStream->pos()); +	const bool result = (absoluteByteOffset == (FLAC__uint64)_inStream->pos());  #ifdef LEGACY_FLAC  	return result ? FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK : FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR; diff --git a/sound/flac.h b/sound/flac.h index 5c825847b6..8a51441afd 100644 --- a/sound/flac.h +++ b/sound/flac.h @@ -31,7 +31,6 @@  #ifdef USE_FLAC  namespace Common { -	class File;  	class SeekableReadStream;  } diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index 358d42d751..473612f6bc 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -46,7 +46,11 @@ static const MidiDriverDescription s_musicDrivers[] = {  	{"alsa", "ALSA", MD_ALSA, MDT_MIDI},  #endif -#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) +#if defined(__MINT__) +       {"stmidi", "Atari ST MIDI", MD_STMIDI, MDT_MIDI}, +#endif + +#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) && !defined(__MINT__)  	{"seq", "SEQ", MD_SEQ, MDT_MIDI},  #endif @@ -247,7 +251,10 @@ MidiDriver *MidiDriver::createMidi(int midiDriver) {  #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)  	case MD_WINDOWS:   return MidiDriver_WIN_create(g_system->getMixer());  #endif -#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) +#if defined(__MINT__) +       case MD_STMIDI:    return MidiDriver_STMIDI_create(g_system->getMixer()); +#endif +#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__) && !defined(__MINT__)  	case MD_SEQ:       return MidiDriver_SEQ_create(g_system->getMixer());  #endif  #if defined(UNIX) diff --git a/sound/mididrv.h b/sound/mididrv.h index 12513268a8..9d5a7d4407 100644 --- a/sound/mididrv.h +++ b/sound/mididrv.h @@ -51,6 +51,9 @@ enum MidiDriverType {  	// Windows  	MD_WINDOWS, +	// Atari ST +	MD_STMIDI, +  	// Linux  	MD_ALSA,  	MD_SEQ, @@ -271,6 +274,7 @@ public:  extern MidiDriver *MidiDriver_NULL_create(Audio::Mixer *mixer);  extern MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer);  extern MidiDriver *MidiDriver_WIN_create(Audio::Mixer *mixer); +extern MidiDriver *MidiDriver_STMIDI_create(Audio::Mixer *mixer);  extern MidiDriver *MidiDriver_SEQ_create(Audio::Mixer *mixer);  extern MidiDriver *MidiDriver_TIMIDITY_create(Audio::Mixer *mixer);  extern MidiDriver *MidiDriver_QT_create(Audio::Mixer *mixer); diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 27e031f108..824143d829 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -23,7 +23,6 @@   *   */ -#include "common/file.h"  #include "common/util.h"  #include "common/system.h" diff --git a/sound/mods/infogrames.cpp b/sound/mods/infogrames.cpp index 97987b037a..a5b3ea1f35 100644 --- a/sound/mods/infogrames.cpp +++ b/sound/mods/infogrames.cpp @@ -25,6 +25,7 @@  #include "sound/mods/infogrames.h"  #include "common/endian.h" +#include "common/file.h"  namespace Audio { @@ -50,12 +51,20 @@ void Infogrames::Instruments::init() {  	_sampleData = 0;  } +bool Infogrames::Instruments::load(const char *ins) { +	Common::File f; + +	if (f.open(ins)) +		return load(f); +	return false; +} +  bool Infogrames::Instruments::load(Common::SeekableReadStream &ins) {  	int i; -	uint32 fsize; -	uint32 offset[32]; -	uint32 offsetRepeat[32]; -	uint32 dataOffset; +	int32 fsize; +	int32 offset[32]; +	int32 offsetRepeat[32]; +	int32 dataOffset;  	unload(); @@ -191,6 +200,14 @@ void Infogrames::reset() {  		_chn[i].cmdBlockIndices = 0;  } +bool Infogrames::load(const char *dum) { +	Common::File f; + +	if (f.open(dum)) +		return load(f); +	return false; +} +  bool Infogrames::load(Common::SeekableReadStream &dum) {  	int subSong = 0;  	int i; diff --git a/sound/mods/infogrames.h b/sound/mods/infogrames.h index 572c5a6426..d44ea0475c 100644 --- a/sound/mods/infogrames.h +++ b/sound/mods/infogrames.h @@ -28,7 +28,6 @@  #include "sound/mods/paula.h"  #include "common/stream.h" -#include "common/file.h"  namespace Audio { @@ -46,13 +45,7 @@ public:  		~Instruments();  		bool load(Common::SeekableReadStream &ins); -		bool load(const char *ins) { -			Common::File f; - -			if (f.open(ins)) -				return load(f); -			return false; -		} +		bool load(const char *ins);  		void unload(void);  		uint8 getCount(void) const { return _count; } @@ -82,13 +75,7 @@ public:  	void setRepeating (int32 repCount) { _repCount = repCount; }  	bool load(Common::SeekableReadStream &dum); -	bool load(const char *dum) { -		Common::File f; - -		if (f.open(dum)) -			return load(f); -		return false; -	} +	bool load(const char *dum);  	void unload(void);  	void restart(void) {  		if (_data) { diff --git a/sound/mp3.cpp b/sound/mp3.cpp index 70467bdb39..0249032e2f 100644 --- a/sound/mp3.cpp +++ b/sound/mp3.cpp @@ -27,7 +27,7 @@  #ifdef USE_MAD -#include "common/file.h" +#include "common/stream.h"  #include "common/util.h"  #include "sound/audiocd.h" diff --git a/sound/mp3.h b/sound/mp3.h index d544e60e0e..a27fc9dec5 100644 --- a/sound/mp3.h +++ b/sound/mp3.h @@ -31,7 +31,6 @@  #ifdef USE_MAD  namespace Common { -	class File;  	class SeekableReadStream;  } diff --git a/sound/softsynth/mt32.cpp b/sound/softsynth/mt32.cpp index 360ef4539d..3e3f9d91ff 100644 --- a/sound/softsynth/mt32.cpp +++ b/sound/softsynth/mt32.cpp @@ -96,12 +96,9 @@ public:  	size_t read(void *in, size_t size) {  		return _in.read(in, size);  	} -	bool readLine(char *in, size_t size) { -		return _in.readLine(in, size) != NULL; -	}  	bool readBit8u(MT32Emu::Bit8u *in) {  		byte b = _in.readByte(); -		if (_in.eof()) +		if (_in.eos())  			return false;  		*in = b;  		return true; @@ -114,7 +111,7 @@ public:  		return !_out.ioFailed();  	}  	bool isEOF() { -		return _in.isOpen() ? _in.eof() : _out.eof(); +		return _in.isOpen() && _in.eos();  	}  }; diff --git a/sound/softsynth/mt32/mt32_file.cpp b/sound/softsynth/mt32/mt32_file.cpp index 86cb29fd49..f4eba73d33 100644 --- a/sound/softsynth/mt32/mt32_file.cpp +++ b/sound/softsynth/mt32/mt32_file.cpp @@ -44,10 +44,6 @@ namespace MT32Emu {  		return fread(in, 1, size, fp);  	} -	bool ANSIFile::readLine(char *in, size_t size) { -		return fgets(in, (int)size, fp) != NULL; -	} -  	bool ANSIFile::readBit8u(Bit8u *in) {  		int c = fgetc(fp);  		if (c == EOF) diff --git a/sound/softsynth/mt32/mt32_file.h b/sound/softsynth/mt32/mt32_file.h index 5f05c9e9ae..27c8ccbe46 100644 --- a/sound/softsynth/mt32/mt32_file.h +++ b/sound/softsynth/mt32/mt32_file.h @@ -35,7 +35,6 @@ public:  	virtual ~File() {}  	virtual void close() = 0;  	virtual size_t read(void *in, size_t size) = 0; -	virtual bool readLine(char *in, size_t size) = 0;  	virtual bool readBit8u(Bit8u *in) = 0;  	virtual bool readBit16u(Bit16u *in);  	virtual bool readBit32u(Bit32u *in); @@ -55,7 +54,6 @@ public:  	bool open(const char *filename, OpenMode mode);  	void close();  	size_t read(void *in, size_t size); -	bool readLine(char *in, size_t size);  	bool readBit8u(Bit8u *in);  	size_t write(const void *out, size_t size);  	bool writeBit8u(Bit8u out); diff --git a/sound/softsynth/mt32/partial.cpp b/sound/softsynth/mt32/partial.cpp index 1aab2a8de7..2866c7757d 100644 --- a/sound/softsynth/mt32/partial.cpp +++ b/sound/softsynth/mt32/partial.cpp @@ -25,7 +25,7 @@  #include "mt32emu.h" -#if defined(MACOSX) || defined(__solaris__) +#if defined(MACOSX) || defined(SOLARIS)  // Older versions of Mac OS X didn't supply a powf function, so using it  // will cause a binary incompatibility when trying to run a binary built  // on a newer OS X release on an olderr one. And Solaris 8 doesn't provide diff --git a/sound/softsynth/mt32/synth.cpp b/sound/softsynth/mt32/synth.cpp index 785e8098c7..366da50d01 100644 --- a/sound/softsynth/mt32/synth.cpp +++ b/sound/softsynth/mt32/synth.cpp @@ -25,7 +25,7 @@  #include "mt32emu.h" -#if defined(MACOSX) || defined(__solaris__) +#if defined(MACOSX) || defined(SOLARIS)  // Older versions of Mac OS X didn't supply a powf function, so using it  // will cause a binary incompatibility when trying to run a binary built  // on a newer OS X release on an olderr one. And Solaris 8 doesn't provide diff --git a/sound/softsynth/mt32/tables.cpp b/sound/softsynth/mt32/tables.cpp index 20b7cf289a..5865ba2950 100644 --- a/sound/softsynth/mt32/tables.cpp +++ b/sound/softsynth/mt32/tables.cpp @@ -25,7 +25,7 @@  #include "mt32emu.h" -#if defined(MACOSX) || defined(__solaris__) +#if defined(MACOSX) || defined(SOLARIS)  // Older versions of Mac OS X didn't supply a powf function, so using it  // will cause a binary incompatibility when trying to run a binary built  // on a newer OS X release on an olderr one. And Solaris 8 doesn't provide diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index 64f67d2a13..da29b1b454 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -27,7 +27,7 @@  #ifdef USE_VORBIS -#include "common/file.h" +#include "common/stream.h"  #include "common/util.h"  #include "sound/audiostream.h" diff --git a/sound/vorbis.h b/sound/vorbis.h index 758bfd9487..012c33e310 100644 --- a/sound/vorbis.h +++ b/sound/vorbis.h @@ -31,7 +31,6 @@  #ifdef USE_VORBIS  namespace Common { -	class File;  	class SeekableReadStream;  } diff --git a/sound/wave.cpp b/sound/wave.cpp index 249518aafc..72a3992401 100644 --- a/sound/wave.cpp +++ b/sound/wave.cpp @@ -34,7 +34,7 @@  namespace Audio {  bool loadWAVFromStream(Common::SeekableReadStream &stream, int &size, int &rate, byte &flags, uint16 *wavType, int *blockAlign_) { -	const uint32 initialPos = stream.pos(); +	const int32 initialPos = stream.pos();  	byte buf[4+1];  	buf[4] = 0; @@ -45,7 +45,7 @@ bool loadWAVFromStream(Common::SeekableReadStream &stream, int &size, int &rate,  		return false;  	} -	uint32 wavLength = stream.readUint32LE(); +	int32 wavLength = stream.readUint32LE();  	stream.read(buf, 4);  	if (memcmp(buf, "WAVE", 4) != 0) {  | 
