[midisnoop] push by surfacep...@gmail.com - Pad bytes in messages with extra 0 if they're between 0x0 and 0xf. on 2012-12-31 03:30 GMT

1 view
Skip to first unread message

midi...@googlecode.com

unread,
Dec 30, 2012, 10:30:39 PM12/30/12
to midisnoop-...@googlegroups.com
Revision: f8ff5d35eea1
Author: Devin Anderson <surface...@gmail.com>
Date: Sun Dec 30 19:30:26 2012
Log: Pad bytes in messages with extra 0 if they're between 0x0 and 0xf.

http://code.google.com/p/midisnoop/source/detail?r=f8ff5d35eea1

Modified:
/src/controller.cpp

=======================================
--- /src/controller.cpp Sun Dec 30 01:18:51 2012
+++ /src/controller.cpp Sun Dec 30 19:30:26 2012
@@ -166,7 +166,8 @@

QStringList dataParts;
for (int i = 1; i <= lastIndex; i++) {
- dataParts += QString("%1").arg(static_cast<uint>(message[i]), 2,
16);
+ dataParts += QString("%1").
+ arg(static_cast<uint>(message[i]), 2, 16, QChar('0'));
}
return dataParts.join(" ");
}
@@ -235,7 +236,7 @@
if (status < 0x80) {
dataDescription = getGenericDataDescription(message);
statusDescription = tr("%1 (invalid status)").
- arg(static_cast<uint>(status), 2, 16);
+ arg(static_cast<uint>(status), 2, 16, QChar('0'));
valid = false;
return;
}
@@ -249,7 +250,7 @@
case -1:
dataDescription = getGenericDataDescription(message);
statusDescription = tr("%1 (undefined status)").
- arg(static_cast<uint>(status), 2, 16);
+ arg(static_cast<uint>(status), 2, 16, QChar('0'));
valid = false;
return;

@@ -273,7 +274,7 @@
if (length != expectedLength) {
dataDescription = getGenericDataDescription(message);
statusDescription = tr("%1 (incorrect length)").
- arg(static_cast<uint>(status), 2, 16);
+ arg(static_cast<uint>(status), 2, 16, QChar('0'));
valid = false;
return;
}
@@ -285,7 +286,7 @@
if (static_cast<quint8>(message[i]) >= 0x80) {
dataDescription = getGenericDataDescription(message);
statusDescription = tr("%1 (invalid data)").
- arg(static_cast<uint>(status), 2, 16);
+ arg(static_cast<uint>(status), 2, 16, QChar('0'));
valid = false;
return;
}
Reply all
Reply to author
Forward
0 new messages