Fixed bug preventing parsing of unbundled TUIO messages

Unbundled TUIO messages were being ignored. TUIO protocol
defaults to bundled but states it should work with any
Open Sound Control (OSC) implementation. Unbundled handling
was already in place, just fixed the logic to make it work.

Change-Id: I6d91449bd2069ac891e493fb7f50c010bcc3e8be
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
This commit is contained in:
Ariel Molina 2016-02-10 14:44:53 -06:00 committed by Ariel Molina R
parent 5d8354e63a
commit 3fa7035b53

View File

@ -129,10 +129,6 @@ void QTuioHandler::processPackets()
if (size != datagram.size())
datagram.resize(size);
QOscBundle bundle(datagram);
if (!bundle.isValid())
continue;
// "A typical TUIO bundle will contain an initial ALIVE message,
// followed by an arbitrary number of SET messages that can fit into the
// actual bundle capacity and a concluding FSEQ message. A minimal TUIO
@ -140,7 +136,19 @@ void QTuioHandler::processPackets()
// messages. The FSEQ frame ID is incremented for each delivered bundle,
// while redundant bundles can be marked using the frame sequence ID
// -1."
QList<QOscMessage> messages = bundle.messages();
QList<QOscMessage> messages;
QOscBundle bundle(datagram);
if (bundle.isValid()) {
messages = bundle.messages();
} else {
QOscMessage msg(datagram);
if (!msg.isValid()) {
qCWarning(lcTuioSet) << "Got invalid datagram.";
continue;
}
messages.push_back(msg);
}
foreach (const QOscMessage &message, messages) {
if (message.addressPattern() != "/tuio/2Dcur") {