Ticket #9100: fbear-dos-piano2.diff
File fbear-dos-piano2.diff, 4.2 KB (added by , 15 years ago) |
---|
-
engines/scumm/imuse/imuse_player.cpp
72 72 _pan(0), 73 73 _transpose(0), 74 74 _detune(0), 75 _offset_note(0), 75 76 _vol_eff(0), 76 77 _track_index(0), 77 78 _loop_to_beat(0), … … 165 166 _active = false; 166 167 _midi = NULL; 167 168 _id = 0; 169 _offset_note = 0; 168 170 } 169 171 170 172 void Player::hook_clear() { … … 252 254 break; 253 255 254 256 case 0x9: // Key On 257 param1 += _offset_note; 255 258 if (!_scanning) { 256 259 if (_isMT32 && !_se->isNativeMT32()) 257 260 param2 = (((param2 * 3) >> 2) + 32) & 0x7F; … … 666 669 } 667 670 } 668 671 672 void Player::setOffsetNote(int offset) { 673 _offset_note = offset; 674 } 675 669 676 int Player::scan(uint totrack, uint tobeat, uint totick) { 670 677 if (!_active || !_parser) 671 678 return -1; -
engines/scumm/imuse/imuse.cpp
491 491 _sysex = handler; 492 492 } 493 493 494 void IMuseInternal::startHESound(int sound, int offset) { 495 Common::StackLock lock(_mutex, "IMuseInternal::startSound()"); 496 startSound_internal(sound, offset); 497 } 494 498 495 496 499 //////////////////////////////////////// 497 500 // 498 501 // MusicEngine interface methods … … 559 562 // 560 563 //////////////////////////////////////// 561 564 562 bool IMuseInternal::startSound_internal(int sound ) {565 bool IMuseInternal::startSound_internal(int sound, int offset) { 563 566 // Do not start a sound if it is already set to start on an ImTrigger 564 567 // event. This fixes carnival music problems where a sound has been set 565 568 // to trigger at the right time, but then is started up immediately … … 632 635 ImClearTrigger(81, 1); 633 636 634 637 player->clear(); 638 player->setOffsetNote(offset); 635 639 return player->startSound(sound, driver, _direct_passthrough); 636 640 } 637 641 -
engines/scumm/imuse/imuse_internal.h
185 185 int8 _pan; 186 186 int8 _transpose; 187 187 int8 _detune; 188 int _offset_note; 188 189 byte _vol_eff; 189 190 190 191 uint _track_index; … … 270 271 void saveLoadWithSerializer(Serializer *ser); 271 272 int setHook(byte cls, byte value, byte chan) { return _hook.set(cls, value, chan); } 272 273 void setDetune(int detune); 274 void setOffsetNote(int offset); 273 275 bool setLoop(uint count, uint tobeat, uint totick, uint frombeat, uint fromtick); 274 276 void setPan(int pan); 275 277 void setPriority(int pri); … … 507 509 508 510 protected: 509 511 // Internal mutex-free versions of the IMuse and MusicEngine methods. 510 bool startSound_internal(int sound );512 bool startSound_internal(int sound, int offset = 0); 511 513 int stopSound_internal(int sound); 512 514 int stopAllSounds_internal(); 513 515 int getSoundStatus_internal(int sound, bool ignoreFadeouts) const; … … 525 527 virtual void addSysexHandler(byte mfgID, sysexfunc handler); 526 528 527 529 public: 530 void startHESound(int sound, int offset); 531 528 532 // MusicEngine interface 529 533 void setMusicVolume(int vol); 530 534 void startSound(int sound); -
engines/scumm/imuse/imuse.h
74 74 virtual void addSysexHandler (byte mfgID, sysexfunc handler) = 0; 75 75 76 76 public: 77 virtual void startHESound(int sound, int offset) = 0; 78 77 79 // MusicEngine base class methods. 78 80 // Not actually redefined here because none are implemented. 79 81 -
engines/scumm/he/sound_he.cpp
741 741 } 742 742 else if (READ_BE_UINT32(ptr) == MKID_BE('MIDI')) { 743 743 if (_vm->_imuse) { 744 // This is used in the DOS version of Fatty Bear's 745 // Birthday Surprise to change the note on the piano 746 // when not using a digitized instrument. 744 747 _vm->_imuse->stopSound(_currentMusic); 745 748 _currentMusic = soundID; 746 _vm->_imuse->start Sound(soundID);749 _vm->_imuse->startHESound(soundID, heOffset); 747 750 } 748 751 } 749 752 }