[Scummvm-cvs-logs] CVS: scummvm/sound mididrv.cpp,1.37,1.38

Jamieson Christian jamieson630 at users.sourceforge.net
Tue Dec 17 23:38:05 CET 2002


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv29071/scummvm/sound

Modified Files:
	mididrv.cpp 
Log Message:
Experimental SysEx implementation for the -eseq driver.

Index: mididrv.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- mididrv.cpp	11 Dec 2002 16:09:56 -0000	1.37
+++ mididrv.cpp	18 Dec 2002 07:37:47 -0000	1.38
@@ -142,6 +142,7 @@
 	int open();
 	void close();
 	void send(uint32 b);
+	void sysEx (byte *msg, uint16 length);
 
 private:
 	bool _isOpen;
@@ -231,6 +232,28 @@
 		break;
 	}
 	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()





More information about the Scummvm-git-logs mailing list