mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-04 15:51:42 +00:00
ENGINES: Remove unused MIDI pass-through code
This commit is contained in:
parent
e70fd59b35
commit
088bd7a70b
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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> {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user