Ticket #8064: pitchbend3.diff

File pitchbend3.diff, 4.5 KB (added by SF/jamieson630, 22 years ago)

Patch against October 21 snapshot

  • scummvm/scumm/imuse.cpp

    RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
    retrieving revision 1.65
    diff -u -r1.65 imuse.cpp
     
    45504550void IMuseGM::midiPitchBendFactor (byte chan, byte factor) {
    45514551        if (_midi_pitchbend_factor_last[chan] != factor) {
    45524552                _midi_pitchbend_factor_last[chan] = factor;
    4553                 _md->setPitchBendRange (factor); // For high-level semantic drivers (such as QTMA)
     4553                _md->setPitchBendRange (chan, factor); // For high-level semantic drivers (such as QTMA)
    45544554                _md->send((   0   << 16) | (101 << 8) | (0xB0 | chan));
    45554555                _md->send((   0   << 16) | (100 << 8) | (0xB0 | chan));
    45564556                _md->send((factor << 16) | (  6 << 8) | (0xB0 | chan));
  • scummvm/sound/mididrv.cpp

    RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.cpp,v
    retrieving revision 1.14
    diff -u -r1.14 mididrv.cpp
     
    4545        void send(uint32 b);
    4646        void pause(bool pause);
    4747        void set_stream_callback(void *param, StreamCallback *sc);
    48         void setPitchBendRange (uint range) { }
     48        void setPitchBendRange (byte channel, uint range) { }
    4949
    5050private:
    5151        struct MyMidiHdr {
     
    305305        void send(uint32 b);
    306306        void pause(bool pause);
    307307        void set_stream_callback(void *param, StreamCallback *sc);
    308         void setPitchBendRange (uint range) { }
     308        void setPitchBendRange (byte channel, uint range) { }
    309309
    310310private:
    311311        enum {
     
    517517        void send(uint32 b);
    518518        void pause(bool pause);
    519519        void set_stream_callback(void *param, StreamCallback *sc);
    520         void setPitchBendRange (uint range) { }
     520        void setPitchBendRange (byte channel, uint range) { }
    521521
    522522private:
    523523        StreamCallback *_stream_proc;
     
    655655        void send(uint32 b);
    656656        void pause(bool pause) { }
    657657        void set_stream_callback(void *param, StreamCallback *sc);
    658         void setPitchBendRange (uint range);
     658        void setPitchBendRange (byte channel, uint range);
    659659
    660660private:
    661661        NoteAllocator qtNoteAllocator;
     
    817817                        // multiply it by a factor. If all was right, the factor would be 3/8, but for
    818818                        // mysterious reasons the actual factor we have to use is more like 1/32 or 3/64.
    819819                        // Maybe the QT docs are right, and
    820                         long theBend = ((long)midiCmd[1] | (long)(midiCmd[2] << 7));
    821                         _pitchbend[chanID] = theBend;
    822                         theBend = (theBend - 0x2000) * _pitchbend_range[channel] / 32;
     820                        _pitchbend[chanID] = ((uint16) midiCmd[1] | (uint16) (midiCmd[2] << 7));
     821                        theBend = ((long) _pitchbend[chanID] - 0x2000) * _pitchbend_range[chanID] / 32;
    823822
    824823                        NASetController(qtNoteAllocator, qtNoteChannel[chanID], kControllerPitchBend, theBend);
    825824                }
     
    832831        }
    833832}
    834833
    835 void MidiDriver_QT::setPitchBendRange (channel, range)
     834void MidiDriver_QT::setPitchBendRange (byte channel, uint range)
    836835{
    837836        if (_pitchbend_range[channel] == range)
    838837                return;
     
    865864        void send(uint32 b);
    866865        void pause(bool pause);
    867866        void set_stream_callback(void *param, StreamCallback *sc);
    868         void setPitchBendRange (uint range) { }
     867        void setPitchBendRange (byte channel, uint range) { }
    869868
    870869private:
    871870        AudioUnit au_MusicDevice;
     
    988987        void send(uint32 b) { }
    989988        void pause(bool pause) { }
    990989        void set_stream_callback(void *param, StreamCallback *sc) { }
    991         void setPitchBendRange (uint range) { }
     990        void setPitchBendRange (byte channel, uint range) { }
    992991private:
    993992};
    994993
     
    10611060        void send(uint32 b);
    10621061        void pause(bool pause);
    10631062        void set_stream_callback(void *param, StreamCallback *sc);
    1064         void setPitchBendRange (uint range) { }
     1063        void setPitchBendRange (byte channel, uint range) { }
    10651064
    10661065private:
    10671066        void send_event(int do_flush);
  • scummvm/sound/mididrv.h

    RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.h,v
    retrieving revision 1.4
    diff -u -r1.4 mididrv.h
     
    9999        static const char *get_error_name(int error_code);
    100100
    101101        // HIGH-LEVEL SEMANTIC METHODS
    102         virtual void setPitchBendRange (uint range) = 0;
     102        virtual void setPitchBendRange (byte channel, uint range) = 0;
    103103};
    104104
    105105