comparison data/osc/OSCQueue.cpp @ 1429:48e9f538e6e9

Untabify
author Chris Cannam
date Thu, 01 Mar 2018 18:02:22 +0000
parents 6b847a59d908
children 70e172e6cc59
comparison
equal deleted inserted replaced
1428:87ae75da6527 1429:48e9f538e6e9
32 32
33 void 33 void
34 OSCQueue::oscError(int num, const char *msg, const char *path) 34 OSCQueue::oscError(int num, const char *msg, const char *path)
35 { 35 {
36 cerr << "ERROR: OSCQueue::oscError: liblo server error " << num 36 cerr << "ERROR: OSCQueue::oscError: liblo server error " << num
37 << " in path " << path << ": " << msg << endl; 37 << " in path " << path << ": " << msg << endl;
38 } 38 }
39 39
40 int 40 int
41 OSCQueue::oscMessageHandler(const char *path, const char *types, lo_arg **argv, 41 OSCQueue::oscMessageHandler(const char *path, const char *types, lo_arg **argv,
42 int argc, lo_message, void *user_data) 42 int argc, lo_message, void *user_data)
46 int target; 46 int target;
47 int targetData; 47 int targetData;
48 QString method; 48 QString method;
49 49
50 if (!queue->parseOSCPath(path, target, targetData, method)) { 50 if (!queue->parseOSCPath(path, target, targetData, method)) {
51 return 1; 51 return 1;
52 } 52 }
53 53
54 OSCMessage message; 54 OSCMessage message;
55 message.setTarget(target); 55 message.setTarget(target);
56 message.setTargetData(targetData); 56 message.setTargetData(targetData);
78 << "Unsupported OSC type '" << type << "'" 78 << "Unsupported OSC type '" << type << "'"
79 << endl; 79 << endl;
80 break; 80 break;
81 } 81 }
82 82
83 ++i; 83 ++i;
84 } 84 }
85 85
86 queue->postMessage(message); 86 queue->postMessage(message);
87 return 0; 87 return 0;
88 } 88 }
188 bool 188 bool
189 OSCQueue::parseOSCPath(QString path, int &target, int &targetData, 189 OSCQueue::parseOSCPath(QString path, int &target, int &targetData,
190 QString &method) 190 QString &method)
191 { 191 {
192 while (path.startsWith("/")) { 192 while (path.startsWith("/")) {
193 path = path.right(path.length()-1); 193 path = path.right(path.length()-1);
194 } 194 }
195 195
196 int i = 0; 196 int i = 0;
197 197
198 bool ok = false; 198 bool ok = false;