aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJamieson Christian2002-12-18 07:37:47 +0000
committerJamieson Christian2002-12-18 07:37:47 +0000
commit70783268093f00a61d3673f729a3aa113b5ad43a (patch)
treec6382ece6a3779d33c90b86ad460bb6066a87161 /sound
parentb327bd178b8d7b61c084b4d4e1032d95678b04de (diff)
downloadscummvm-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.cpp23
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();