Skip to content

Commit

Permalink
SCUMM: Remove unused iMuse MIDI 'passthrough' code
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Mar 23, 2011
1 parent 4172414 commit 756f592
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 27 deletions.
7 changes: 1 addition & 6 deletions engines/scumm/imuse/imuse.cpp
Expand Up @@ -57,7 +57,6 @@ _initialized(false),
_tempoFactor(0),
_player_limit(ARRAYSIZE(_players)),
_recycle_players(false),
_direct_passthrough(false),
_queue_end(0),
_queue_pos(0),
_queue_sound(0),
Expand Down Expand Up @@ -472,10 +471,6 @@ uint32 IMuseInternal::property(int prop, uint32 value) {
_recycle_players = (value != 0);
break;

case IMuse::PROP_DIRECT_PASSTHROUGH:
_direct_passthrough = (value != 0);
break;

case IMuse::PROP_GAME_ID:
_game_id = value;
break;
Expand Down Expand Up @@ -636,7 +631,7 @@ bool IMuseInternal::startSound_internal(int sound, int offset) {

player->clear();
player->setOffsetNote(offset);
return player->startSound(sound, driver, _direct_passthrough);
return player->startSound(sound, driver);
}

int IMuseInternal::stopSound_internal(int sound) {
Expand Down
1 change: 0 additions & 1 deletion engines/scumm/imuse/imuse.h
Expand Up @@ -58,7 +58,6 @@ class IMuse : public MusicEngine {
PROP_GS,
PROP_LIMIT_PLAYERS,
PROP_RECYCLE_PLAYERS,
PROP_DIRECT_PASSTHROUGH,
PROP_GAME_ID
};

Expand Down
4 changes: 1 addition & 3 deletions engines/scumm/imuse/imuse_internal.h
Expand Up @@ -174,7 +174,6 @@ class Player : public MidiDriver {
protected:
MidiDriver *_midi;
MidiParser *_parser;
bool _passThrough; // Only respond to EOT, all else direct to MidiDriver

Part *_parts;
bool _active;
Expand Down Expand Up @@ -278,7 +277,7 @@ class Player : public MidiDriver {
void setSpeed(byte speed);
int setTranspose(byte relative, int b);
int setVolume(byte vol);
bool startSound(int sound, MidiDriver *midi, bool passThrough);
bool startSound(int sound, MidiDriver *midi);
int getMusicTimer() const;

public:
Expand Down Expand Up @@ -425,7 +424,6 @@ class IMuseInternal : public IMuse {

int _player_limit; // Limits how many simultaneous music tracks are played
bool _recycle_players; // Can we stop a player in order to start another one?
bool _direct_passthrough; // Pass data direct to MidiDriver (no interactivity)

uint _queue_end, _queue_pos, _queue_sound;
byte _queue_adding;
Expand Down
14 changes: 1 addition & 13 deletions engines/scumm/imuse/imuse_player.cpp
Expand Up @@ -61,7 +61,6 @@ uint16 Player::_active_notes[128];
Player::Player() :
_midi(NULL),
_parser(NULL),
_passThrough(0),
_parts(NULL),
_active(false),
_scanning(false),
Expand Down Expand Up @@ -93,7 +92,7 @@ Player::~Player() {
}
}

bool Player::startSound(int sound, MidiDriver *midi, bool passThrough) {
bool Player::startSound(int sound, MidiDriver *midi) {
void *ptr;
int i;

Expand All @@ -119,7 +118,6 @@ bool Player::startSound(int sound, MidiDriver *midi, bool passThrough) {
_pan = 0;
_transpose = 0;
_detune = 0;
_passThrough = passThrough;

for (i = 0; i < ARRAYSIZE(_parameterFaders); ++i)
_parameterFaders[i].init();
Expand Down Expand Up @@ -227,11 +225,6 @@ void Player::setSpeed(byte speed) {
}

void Player::send(uint32 b) {
if (_passThrough) {
_midi->send(b);
return;
}

byte cmd = (byte)(b & 0xF0);
byte chan = (byte)(b & 0x0F);
byte param1 = (byte)((b >> 8) & 0xFF);
Expand Down Expand Up @@ -348,11 +341,6 @@ void Player::sysEx(const byte *p, uint16 len) {
byte buf[128];
Part *part;

if (_passThrough) {
_midi->sysEx(p, len);
return;
}

// Check SysEx manufacturer.
a = *p++;
--len;
Expand Down
6 changes: 2 additions & 4 deletions engines/scumm/scumm.cpp
Expand Up @@ -1858,17 +1858,15 @@ void ScummEngine::setupMusic(int midi) {
if (ConfMan.hasKey("tempo"))
_imuse->property(IMuse::PROP_TEMPO_BASE, ConfMan.getInt("tempo"));
// YM2162 driver can't handle midi->getPercussionChannel(), NULL shouldn't init MT-32/GM/GS
if (/*(midi != MDT_TOWNS) && (*/midi != MDT_NONE/*)*/) {
if (midi != MDT_NONE) {
_imuse->property(IMuse::PROP_NATIVE_MT32, _native_mt32);
if (MidiDriver::getMusicType(dev) != MT_MT32) // MT-32 Emulation shouldn't be GM/GS initialized
_imuse->property(IMuse::PROP_GS, _enable_gs);
}
if (_game.heversion >= 60 /*|| midi == MDT_TOWNS*/) {
if (_game.heversion >= 60) {
_imuse->property(IMuse::PROP_LIMIT_PLAYERS, 1);
_imuse->property(IMuse::PROP_RECYCLE_PLAYERS, 1);
}
/*if (midi == MDT_TOWNS)
_imuse->property(IMuse::PROP_DIRECT_PASSTHROUGH, 1);*/
}
}
}
Expand Down

0 comments on commit 756f592

Please sign in to comment.