aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound/midiparser_sci.h
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-14 01:32:37 +0200
committerWillem Jan Palenstijn2013-12-31 13:52:15 +0100
commit857d2e7beff46fcd5d26e8590c9891a4959b8d1f (patch)
tree489e46f9222f91d7d59da1a64779d0aaa5a27a6a /engines/sci/sound/midiparser_sci.h
parentf777e54df291d1f39aefdc40d1d966e50d261efb (diff)
downloadscummvm-rg350-857d2e7beff46fcd5d26e8590c9891a4959b8d1f.tar.gz
scummvm-rg350-857d2e7beff46fcd5d26e8590c9891a4959b8d1f.tar.bz2
scummvm-rg350-857d2e7beff46fcd5d26e8590c9891a4959b8d1f.zip
SCI: Rewrite MIDI channel remapping
This adds MIDI state tracking to allow channels to be temporarily unmapped and later re-mapped when there are free device channels available again.
Diffstat (limited to 'engines/sci/sound/midiparser_sci.h')
-rw-r--r--engines/sci/sound/midiparser_sci.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h
index 5784dca1ab..7e24c34144 100644
--- a/engines/sci/sound/midiparser_sci.h
+++ b/engines/sci/sound/midiparser_sci.h
@@ -79,20 +79,23 @@ public:
const byte *getMixedData() const { return _mixedData; }
byte getSongReverb();
- void tryToOwnChannels();
- void lostChannels();
void sendFromScriptToDriver(uint32 midi);
void sendToDriver(uint32 midi);
void sendToDriver(byte status, byte firstOp, byte secondOp) {
sendToDriver(status | ((uint32)firstOp << 8) | ((uint32)secondOp << 16));
}
+ void remapChannel(int channel, int devChannel);
+
protected:
void parseNextEvent(EventInfo &info);
void processEvent(const EventInfo &info, bool fireEvents = true);
byte *midiMixChannels();
byte *midiFilterChannels(int channelMask);
byte midiGetNextChannel(long ticker);
+ void resetStateTracking();
+ void trackState(uint32 midi);
+ void sendToDriver_raw(uint32 midi);
SciMusic *_music;
@@ -113,6 +116,19 @@ protected:
int16 _channelRemap[16];
bool _channelMuted[16];
byte _channelVolume[16];
+
+ struct ChannelState {
+ int8 _modWheel;
+ int8 _pan;
+ int8 _patch;
+ int8 _note;
+ bool _sustain;
+ int16 _pitchWheel;
+ int8 _voices;
+ };
+
+ ChannelState _channelState[16];
+
};
} // End of namespace Sci