~foura/midifs

midifs/midi.c -rw-r--r-- 428 bytes
2db95d1fjames palmer start overhaul of midi parsing a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <u.h>
#include <libc.h>

#include "midi.h"

void
parsespecial(Midi *md, Msg *m, uchar byte)
{
	USED(md);
	USED(m);
	USED(byte);
}

int
parsemessage(Midi *md, Msg *m, uchar *buf, usize len)
{
	usize i;
	uchar byte;
	
	for(i=0;i<len;i++) {
		byte = buf[i];
	
		switch(byte & 0xf) {
		case 0xf:
			parsespecial(md, m, byte);
			break;
		default:
			/* FIXME write the rest of this parser */
			break;
		}
	}

	return 0;
}