aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2011-03-23 17:07:48 +0100
committerMax Horn2011-03-23 17:07:48 +0100
commit088bd7a70bc02aafab8d16385774efee55e270d2 (patch)
tree1db9ac591304e9b7a9f4fd646c0ed2681f969872
parente70fd59b3505619cccb6f3280a4cf0fb57aefa97 (diff)
downloadscummvm-rg350-088bd7a70bc02aafab8d16385774efee55e270d2.tar.gz
scummvm-rg350-088bd7a70bc02aafab8d16385774efee55e270d2.tar.bz2
scummvm-rg350-088bd7a70bc02aafab8d16385774efee55e270d2.zip
ENGINES: Remove unused MIDI pass-through code
-rw-r--r--engines/agi/sound_midi.cpp7
-rw-r--r--engines/agi/sound_midi.h8
-rw-r--r--engines/agos/midi.cpp13
-rw-r--r--engines/agos/midi.h7
-rw-r--r--engines/draci/music.cpp7
-rw-r--r--engines/draci/music.h8
-rw-r--r--engines/lure/sound.cpp7
-rw-r--r--engines/lure/sound.h13
-rw-r--r--engines/m4/midi.cpp7
-rw-r--r--engines/m4/midi.h8
-rw-r--r--engines/made/music.cpp7
-rw-r--r--engines/made/music.h6
12 files changed, 22 insertions, 76 deletions
diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp
index fe3d97b9c0..b58e1e50ab 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 dc6609c3e7..f70a20f24a 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 234aa8d815..a37c96a787 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 64ab14d4ee..ad69a3ddde 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 210e925389..cdea2d9fdd 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 e46901424d..0125a661c3 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 8ab0f5486c..da9e136ec3 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 fe7ec50add..dd5538085c 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 b5ae3b90ae..f4fe00319c 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 42948e5ff1..cc3f62621d 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 779b7d6fe9..a6cc2bb38f 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 b52a8116b5..43869cae12 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;