[Scummvm-cvs-logs] scummvm master -> 088bd7a70bc02aafab8d16385774efee55e270d2

fingolfin max at quendi.de
Wed Mar 23 17:09:18 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
088bd7a70b ENGINES: Remove unused MIDI pass-through code


Commit: 088bd7a70bc02aafab8d16385774efee55e270d2
    https://github.com/scummvm/scummvm/commit/088bd7a70bc02aafab8d16385774efee55e270d2
Author: Max Horn (max at quendi.de)
Date: 2011-03-23T09:07:48-07:00

Commit Message:
ENGINES: Remove unused MIDI pass-through code

Changed paths:
    engines/agi/sound_midi.cpp
    engines/agi/sound_midi.h
    engines/agos/midi.cpp
    engines/agos/midi.h
    engines/draci/music.cpp
    engines/draci/music.h
    engines/lure/sound.cpp
    engines/lure/sound.h
    engines/m4/midi.cpp
    engines/m4/midi.h
    engines/made/music.cpp
    engines/made/music.h



diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp
index fe3d97b..b58e1e5 100644
--- a/engines/agi/sound_midi.cpp
+++ b/engines/agi/sound_midi.cpp
@@ -71,7 +71,7 @@ MIDISound::MIDISound(uint8 *data, uint32 len, int resnum, SoundMgr &manager) : A
 		warning("Error creating MIDI sound from resource %d (Type %d, length %d)", resnum, _type, len);
 }
 
-SoundGenMIDI::SoundGenMIDI(AgiEngine *vm, Audio::Mixer *pMixer) : SoundGen(vm, pMixer), _parser(0), _isPlaying(false), _passThrough(false), _isGM(false) {
+SoundGenMIDI::SoundGenMIDI(AgiEngine *vm, Audio::Mixer *pMixer) : SoundGen(vm, pMixer), _parser(0), _isPlaying(false), _isGM(false) {
 	MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB);
 	_driver = MidiDriver::createMidi(dev);
 	assert(_driver);
@@ -135,11 +135,6 @@ void SoundGenMIDI::setVolume(int volume) {
 }
 
 void SoundGenMIDI::send(uint32 b) {
-	if (_passThrough) {
-		_driver->send(b);
-		return;
-	}
-
 	byte channel = (byte)(b & 0x0F);
 	if ((b & 0xFFF0) == 0x07B0) {
 		// Adjust volume changes by master volume
diff --git a/engines/agi/sound_midi.h b/engines/agi/sound_midi.h
index dc6609c..f70a20f 100644
--- a/engines/agi/sound_midi.h
+++ b/engines/agi/sound_midi.h
@@ -54,19 +54,18 @@ public:
 	void play(int resnum);
 	void stop();
 
-	bool isPlaying() { return _isPlaying; }
+	bool isPlaying() const { return _isPlaying; }
 	void setPlaying(bool playing) { _isPlaying = playing; }
 
 	void setVolume(int volume);
-	int getVolume() { return _masterVolume; }
+	int getVolume() const { return _masterVolume; }
 	void syncVolume();
 
 	void setNativeMT32(bool b) { _nativeMT32 = b; }
-	bool hasNativeMT32() { return _nativeMT32; }
+	bool hasNativeMT32() const { return _nativeMT32; }
 	void pause();
 	void resume();
 	void setLoop(bool loop) { _looping = loop; }
-	void setPassThrough(bool b) { _passThrough = b; }
 
 	void setGM(bool isGM) { _isGM = isGM; }
 
@@ -88,7 +87,6 @@ private:
 	byte _channelVolume[16];
 	bool _nativeMT32;
 	bool _isGM;
-	bool _passThrough;
 
 	bool _isPlaying;
 	bool _looping;
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index 234aa8d..a37c96a 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -45,7 +45,6 @@ MidiPlayer::MidiPlayer() {
 	// between songs.
 	_driver = 0;
 	_map_mt32_to_gm = false;
-	_passThrough = false;
 
 	_enable_sfx = true;
 	_current = 0;
@@ -108,11 +107,6 @@ void MidiPlayer::send(uint32 b) {
 	if (!_current)
 		return;
 
-	if (_passThrough) {
-		_driver->send(b);
-		return;
-	}
-
 	byte channel = (byte)(b & 0x0F);
 	if ((b & 0xFFF0) == 0x07B0) {
 		// Adjust volume changes by master music and master sfx volume.
@@ -306,13 +300,6 @@ void MidiPlayer::setVolume(int musicVol, int sfxVol) {
 	}
 }
 
-void MidiPlayer::setDriver(MidiDriver *md) {
-	// Don't try to set this more than once.
-	if (_driver)
-		return;
-	_driver = md;
-}
-
 void MidiPlayer::setLoop(bool loop) {
 	Common::StackLock lock(_mutex);
 
diff --git a/engines/agos/midi.h b/engines/agos/midi.h
index 64ab14d..ad69a3d 100644
--- a/engines/agos/midi.h
+++ b/engines/agos/midi.h
@@ -60,7 +60,6 @@ protected:
 	Common::Mutex _mutex;
 	MidiDriver *_driver;
 	bool _map_mt32_to_gm;
-	bool _passThrough;
 	bool _nativeMT32;
 
 	MusicInfo _music;
@@ -106,14 +105,12 @@ public:
 	void stop();
 	void pause(bool b);
 
-	int  getMusicVolume() { return _musicVolume; }
-	int  getSFXVolume() { return _sfxVolume; }
+	int  getMusicVolume() const { return _musicVolume; }
+	int  getSFXVolume() const { return _sfxVolume; }
 	void setVolume(int musicVol, int sfxVol);
-	void setDriver(MidiDriver *md);
 
 public:
 	int open(int gameType);
-	void setPassThrough(bool b)		{ _passThrough = b; }
 
 	// MidiDriver_BASE interface implementation
 	virtual void send(uint32 b);
diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp
index 210e925..cdea2d9 100644
--- a/engines/draci/music.cpp
+++ b/engines/draci/music.cpp
@@ -36,7 +36,7 @@
 
 namespace Draci {
 
-MusicPlayer::MusicPlayer(const char *pathMask) : _parser(0), _driver(0), _pathMask(pathMask), _looping(false), _isPlaying(false), _passThrough(false), _isGM(false), _track(-1) {
+MusicPlayer::MusicPlayer(const char *pathMask) : _parser(0), _driver(0), _pathMask(pathMask), _looping(false), _isPlaying(false), _isGM(false), _track(-1) {
 
 	MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM);
 	_nativeMT32 = ((MidiDriver::getMusicType(dev) == MT_MT32) || ConfMan.getBool("native_mt32"));
@@ -104,11 +104,6 @@ void MusicPlayer::setVolume(int volume) {
 }
 
 void MusicPlayer::send(uint32 b) {
-	if (_passThrough) {
-		_driver->send(b);
-		return;
-	}
-
 	byte channel = (byte)(b & 0x0F);
 	if ((b & 0xFFF0) == 0x07B0) {
 		// Adjust volume changes by master volume
diff --git a/engines/draci/music.h b/engines/draci/music.h
index e469014..0125a66 100644
--- a/engines/draci/music.h
+++ b/engines/draci/music.h
@@ -41,20 +41,19 @@ public:
 	MusicPlayer(const char *pathMask);
 	~MusicPlayer();
 
-	bool isPlaying() { return _isPlaying; }
+	bool isPlaying() const { return _isPlaying; }
 	void setPlaying(bool playing) { _isPlaying = playing; }
 
 	void setVolume(int volume);
-	int getVolume() { return _masterVolume; }
+	int getVolume() const { return _masterVolume; }
 	void syncVolume();
 
-	bool hasNativeMT32() { return _nativeMT32; }
+	bool hasNativeMT32() const { return _nativeMT32; }
 	void playSMF(int track, bool loop);
 	void stop();
 	void pause();
 	void resume();
 	void setLoop(bool loop) { _looping = loop; }
-	void setPassThrough(bool b) { _passThrough = b; }
 
 	void setGM(bool isGM) { _isGM = isGM; }
 
@@ -77,7 +76,6 @@ protected:
 	byte _channelVolume[16];
 	bool _nativeMT32;
 	bool _isGM;
-	bool _passThrough;
 
 	bool _isPlaying;
 	bool _looping;
diff --git a/engines/lure/sound.cpp b/engines/lure/sound.cpp
index 8ab0f54..da9e136 100644
--- a/engines/lure/sound.cpp
+++ b/engines/lure/sound.cpp
@@ -615,8 +615,6 @@ MidiMusic::MidiMusic(MidiDriver *driver, ChannelEntry channels[NUM_CHANNELS],
 	else
 		setVolume(Sound.sfxVolume());
 
-	_passThrough = false;
-
 	_parser = MidiParser::createParser_SMF();
 	_parser->setMidiDriver(this);
 	_parser->setTimerRate(_driver->getBaseTempo());
@@ -685,11 +683,6 @@ void MidiMusic::playMusic() {
 }
 
 void MidiMusic::send(uint32 b) {
-	if (_passThrough) {
-		_driver->send(b);
-		return;
-	}
-
 #ifdef SOUND_CROP_CHANNELS
 	if ((b & 0xF) >= _numChannels) return;
 	byte channel = _channelNumber + (byte)(b & 0x0F);
diff --git a/engines/lure/sound.h b/engines/lure/sound.h
index fe7ec50..dd55380 100644
--- a/engines/lure/sound.h
+++ b/engines/lure/sound.h
@@ -66,14 +66,12 @@ private:
 	uint32 songOffset(uint16 songNum) const;
 	uint32 songLength(uint16 songNum) const;
 
-	bool _passThrough;
-
 public:
 	MidiMusic(MidiDriver *driver, ChannelEntry channels[NUM_CHANNELS],
 		 uint8 channelNum, uint8 soundNum, bool isMus, uint8 numChannels, void *soundData, uint32 size);
 	~MidiMusic();
 	void setVolume(int volume);
-	int getVolume() { return _volume; }
+	int getVolume() const { return _volume; }
 
 	void playSong(uint16 songNum);
 	void stopSong() { stopMusic(); }
@@ -81,7 +79,6 @@ public:
 	void stopMusic();
 	void queueTuneList(int16 tuneList);
 	bool queueSong(uint16 songNum);
-	void setPassThrough(bool b) { _passThrough = b; }
 	void toggleVChange();
 
 	// MidiDriver_BASE interface implementation
@@ -90,10 +87,10 @@ public:
 
 	void onTimer();
 
-	uint8 channelNumber() { return _channelNumber; }
-	uint8 soundNumber() { return _soundNumber; }
-	bool isPlaying() { return _isPlaying; }
-	bool isMusic() {return _isMusic; }
+	uint8 channelNumber() const { return _channelNumber; }
+	uint8 soundNumber() const { return _soundNumber; }
+	bool isPlaying() const { return _isPlaying; }
+	bool isMusic() const { return _isMusic; }
 };
 
 class SoundManager : public Common::Singleton<SoundManager> {
diff --git a/engines/m4/midi.cpp b/engines/m4/midi.cpp
index b5ae3b9..f4fe003 100644
--- a/engines/m4/midi.cpp
+++ b/engines/m4/midi.cpp
@@ -32,7 +32,7 @@
 
 namespace M4 {
 
-MidiPlayer::MidiPlayer(MadsM4Engine *vm, MidiDriver *driver) : _vm(vm), _midiData(NULL), _driver(driver), _isPlaying(false), _passThrough(false), _isGM(false) {
+MidiPlayer::MidiPlayer(MadsM4Engine *vm, MidiDriver *driver) : _vm(vm), _midiData(NULL), _driver(driver), _isPlaying(false), _isGM(false) {
 	assert(_driver);
 	memset(_channel, 0, sizeof(_channel));
 	_masterVolume = 0;
@@ -79,11 +79,6 @@ void MidiPlayer::setVolume(int volume) {
 }
 
 void MidiPlayer::send(uint32 b) {
-	if (_passThrough) {
-		_driver->send(b);
-		return;
-	}
-
 	byte channel = (byte)(b & 0x0F);
 	if ((b & 0xFFF0) == 0x07B0) {
 		// Adjust volume changes by master volume
diff --git a/engines/m4/midi.h b/engines/m4/midi.h
index 42948e5..cc3f626 100644
--- a/engines/m4/midi.h
+++ b/engines/m4/midi.h
@@ -39,16 +39,15 @@ public:
 	MidiPlayer(MadsM4Engine *vm, MidiDriver *driver);
 	~MidiPlayer();
 
-	bool isPlaying() { return _isPlaying; }
+	bool isPlaying() const { return _isPlaying; }
 
 	void setVolume(int volume);
-	int getVolume() { return _masterVolume; }
+	int getVolume() const { return _masterVolume; }
 
 	void setNativeMT32(bool b) { _nativeMT32 = b; }
-	bool hasNativeMT32() { return _nativeMT32; }
+	bool hasNativeMT32()  const{ return _nativeMT32; }
 	void playMusic(const char *name, int32 vol, bool loop, int32 trigger, int32 scene);
 	void stopMusic();
-	void setPassThrough(bool b) { _passThrough = b; }
 
 	void setGM(bool isGM) { _isGM = isGM; }
 
@@ -68,7 +67,6 @@ protected:
 	byte _channelVolume[16];
 	bool _nativeMT32;
 	bool _isGM;
-	bool _passThrough;
 
 	bool _isPlaying;
 	bool _randomLoop;
diff --git a/engines/made/music.cpp b/engines/made/music.cpp
index 779b7d6..a6cc2bb 100644
--- a/engines/made/music.cpp
+++ b/engines/made/music.cpp
@@ -37,7 +37,7 @@
 
 namespace Made {
 
-MusicPlayer::MusicPlayer() : _parser(0), _driver(0), _looping(false), _isPlaying(false), _passThrough(false), _isGM(false) {
+MusicPlayer::MusicPlayer() : _parser(0), _driver(0), _looping(false), _isPlaying(false), _isGM(false) {
 	MidiDriver::DeviceHandle dev = MidiDriver::detectDevice(MDT_MIDI | MDT_ADLIB | MDT_PREFER_GM);
 	_nativeMT32 = ((MidiDriver::getMusicType(dev) == MT_MT32) || ConfMan.getBool("native_mt32"));
 	//bool adlib = (MidiDriver::getMusicType(dev) == MT_ADLIB);
@@ -95,11 +95,6 @@ void MusicPlayer::setVolume(int volume) {
 }
 
 void MusicPlayer::send(uint32 b) {
-	if (_passThrough) {
-		_driver->send(b);
-		return;
-	}
-
 	byte channel = (byte)(b & 0x0F);
 	if ((b & 0xFFF0) == 0x07B0) {
 		// Adjust volume changes by master volume
diff --git a/engines/made/music.h b/engines/made/music.h
index b52a811..43869ca 100644
--- a/engines/made/music.h
+++ b/engines/made/music.h
@@ -46,11 +46,11 @@ public:
 	MusicPlayer();
 	~MusicPlayer();
 
-	bool isPlaying() { return _isPlaying; }
+	bool isPlaying() const { return _isPlaying; }
 	void setPlaying(bool playing) { _isPlaying = playing; }
 
 	void setVolume(int volume);
-	int getVolume() { return _masterVolume; }
+	int getVolume() const { return _masterVolume; }
 
 	bool hasNativeMT32() const { return _nativeMT32; }
 	void playXMIDI(GenericResource *midiResource, MusicFlags flags = MUSIC_NORMAL);
@@ -59,7 +59,6 @@ public:
 	void pause();
 	void resume();
 	void setLoop(bool loop) { _looping = loop; }
-	void setPassThrough(bool b) { _passThrough = b; }
 
 	void setGM(bool isGM) { _isGM = isGM; }
 
@@ -80,7 +79,6 @@ protected:
 	byte _channelVolume[16];
 	bool _nativeMT32;
 	bool _isGM;
-	bool _passThrough;
 
 	bool _isPlaying;
 	bool _looping;






More information about the Scummvm-git-logs mailing list