13
0

More detail when tracing MMC.

git-svn-id: svn://localhost/ardour2/branches/3.0@7322 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-06-29 13:46:18 +00:00
parent 7eb91510aa
commit d7733cf2d7

View File

@ -198,18 +198,50 @@ MidiTracer::tracer (Parser&, byte* msg, size_t len)
} else {
s += snprintf (&buf[s], bufsize, "%16s (%d) = [", "Sysex", (int) len);
bufsize -= s;
for (unsigned int i = 0; i < len && bufsize > 3; ++i) {
if (i > 0) {
s += snprintf (&buf[s], bufsize, " %02x", msg[i]);
if (len > 5 && msg[0] == 0xf0 && msg[1] == 0x7f && msg[3] == 0x06) {
/* MMC */
int cmd = msg[4];
if (cmd == 0x44 && msg[5] == 0x06 && msg[6] == 0x01) {
s += snprintf (
&buf[s], bufsize, " MMC locate to %d:%d:%d:%d.%d\n",
msg[7], msg[8], msg[9], msg[10], msg[11]
);
} else {
s += snprintf (&buf[s], bufsize, "%02x", msg[i]);
std::string name;
if (cmd == 0x1) {
name = "STOP";
} else if (cmd == 0x3) {
name = "DEFERRED PLAY";
} else if (cmd == 0x6) {
name = "RECORD STROBE";
} else if (cmd == 0x7) {
name = "RECORD EXIT";
} else if (cmd == 0x8) {
name = "RECORD PAUSE";
}
if (!name.empty()) {
s += snprintf (&buf[s], bufsize, " MMC command %s\n", name.c_str());
} else {
s += snprintf (&buf[s], bufsize, " MMC command %02x\n", cmd);
}
}
} else {
/* other sys-ex */
s += snprintf (&buf[s], bufsize, "%16s (%d) = [", "Sysex", (int) len);
bufsize -= s;
for (unsigned int i = 0; i < len && bufsize > 3; ++i) {
if (i > 0) {
s += snprintf (&buf[s], bufsize, " %02x", msg[i]);
} else {
s += snprintf (&buf[s], bufsize, "%02x", msg[i]);
}
bufsize -= s;
}
s += snprintf (&buf[s], bufsize, "]\n");
}
s += snprintf (&buf[s], bufsize, "]\n");
}
break;