Vuo  2.1.2
VuoInputEditorOscOutputDevice.cc
Go to the documentation of this file.
1 
11 
12 extern "C"
13 {
14 #include "VuoOsc.h"
15 }
16 
20 static void __attribute__((constructor)) VuoInputEditorOscOutputDevice_init(void)
21 {
22  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
23  VuoOsc_use();
24  });
25 }
26 
31 {
32  return new VuoInputEditorOscOutputDevice();
33 }
34 
39 {
40  VuoInputEditorMenuItem *optionsTree = new VuoInputEditorMenuItem("root");
41 
42  optionsTree->addItem(new VuoInputEditorMenuItem("Auto", NULL));
43 
44  optionsTree->addSeparator();
45  optionsTree->addItem(new VuoInputEditorMenuItem("Specific device", NULL, NULL, false));
46 
48 
49  unsigned long deviceCount = VuoListGetCount_VuoOscOutputDevice(devices);
50  if (deviceCount)
51  for (unsigned long i = 1; i <= deviceCount; ++i)
52  {
54  optionsTree->addItem(new VuoInputEditorMenuItem(VuoText_format(" %s (%s:%lld)", device.name, device.ipAddress, device.port), VuoOscOutputDevice_getJson(device)));
55  }
56  else
57  optionsTree->addItem(new VuoInputEditorMenuItem(" (no devices found)", NULL, NULL, false));
58 
59  return optionsTree;
60 }