diff options
author | Jamieson Christian | 2002-12-18 07:37:47 +0000 |
---|---|---|
committer | Jamieson Christian | 2002-12-18 07:37:47 +0000 |
commit | 70783268093f00a61d3673f729a3aa113b5ad43a (patch) | |
tree | c6382ece6a3779d33c90b86ad460bb6066a87161 /sound | |
parent | b327bd178b8d7b61c084b4d4e1032d95678b04de (diff) | |
download | scummvm-rg350-70783268093f00a61d3673f729a3aa113b5ad43a.tar.gz scummvm-rg350-70783268093f00a61d3673f729a3aa113b5ad43a.tar.bz2 scummvm-rg350-70783268093f00a61d3673f729a3aa113b5ad43a.zip |
Experimental SysEx implementation for the -eseq driver.
svn-id: r6011
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mididrv.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp index d8d0db83ac..e5947acffb 100644 --- a/sound/mididrv.cpp +++ b/sound/mididrv.cpp @@ -142,6 +142,7 @@ public: int open(); void close(); void send(uint32 b); + void sysEx (byte *msg, uint16 length); private: bool _isOpen; @@ -233,6 +234,28 @@ void MidiDriver_SEQ::send(uint32 b) write(device, buf, position); } +void MidiDriver_SEQ::sysEx (byte *msg, uint16 length) +{ + if (length > 256) { + warning ("Cannot send SysEx block - data too large"); + return; + } + + unsigned char buf [1024]; + int position = 0; + byte *chr = msg; + + // Should be we using EV_SYSEX instead of SEQ_MIDIPUTC? + // I'm not sure how to send EV_SYSEX. + for (; length; --length) { + buf[position++] = SEQ_MIDIPUTC; + buf[position++] = (unsigned char) *chr; + buf[position++] = _device_num; + buf[position++] = 0; + } + write (device, buf, position); +} + MidiDriver *MidiDriver_SEQ_create() { return new MidiDriver_SEQ(); |