changeset 1665:813dadf7c086 osc-script

Debug output
author Chris Cannam
date Tue, 26 Mar 2019 14:28:58 +0000
parents f66ad018b729
children c7bf655955ae
files data/osc/OSCMessage.h data/osc/OSCQueue.cpp
diffstat 2 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/data/osc/OSCMessage.h	Mon Mar 25 15:48:16 2019 +0000
+++ b/data/osc/OSCMessage.h	Tue Mar 26 14:28:58 2019 +0000
@@ -50,6 +50,18 @@
     int getArgCount() const;
     const QVariant &getArg(int i) const;
 
+    // For debugging purposes, not for interchange
+    QString toString() const {
+        QString s = QString("[%1][%2] %3")
+            .arg(m_target)
+            .arg(m_targetData)
+            .arg(m_method);
+        for (auto a: m_args) {
+            s.push_back(" \"" + a.toString() + "\"");
+        }
+        return s;
+    }
+
 private:
     int m_target;
     int m_targetData;
--- a/data/osc/OSCQueue.cpp	Mon Mar 25 15:48:16 2019 +0000
+++ b/data/osc/OSCQueue.cpp	Tue Mar 26 14:28:58 2019 +0000
@@ -30,6 +30,8 @@
 
 #include <unistd.h>
 
+#include <QThread>
+
 void
 OSCQueue::oscError(int num, const char *msg, const char *path)
 {
@@ -155,6 +157,9 @@
     OSCMessage *message = m_buffer.readOne();
     OSCMessage rmessage = *message;
     delete message;
+    SVDEBUG << "OSCQueue::readMessage: In thread "
+            << QThread::currentThreadId() << ": message follows:\n"
+            << rmessage.toString() << endl;
     return rmessage;
 }