Vuo  2.1.2
VuoInputEditorHidDevice.cc
Go to the documentation of this file.
1 
11 
12 extern "C"
13 {
14  #include "VuoHid.h"
15 }
16 
21 {
22  return new VuoInputEditorHidDevice();
23 }
24 
29 {
30  VuoInputEditorMenuItem *optionsTree = new VuoInputEditorMenuItem("root");
31 
32  optionsTree->addItem(new VuoInputEditorMenuItem("None", NULL));
33 
34  optionsTree->addSeparator();
35  optionsTree->addItem(new VuoInputEditorMenuItem("Specific device", NULL, NULL, false));
36 
38 
39  unsigned long deviceCount = VuoListGetCount_VuoHidDevice(devices);
40  if (deviceCount)
41  for (unsigned long i = 1; i <= deviceCount; ++i)
42  {
43  VuoHidDevice device = VuoListGetValue_VuoHidDevice(devices, i);
44  optionsTree->addItem(new VuoInputEditorMenuItem(VuoText_format(" %s", device.name), VuoHidDevice_getJson(device)));
45  }
46  else
47  optionsTree->addItem(new VuoInputEditorMenuItem(" (no devices found)", NULL, NULL, false));
48 
49  return optionsTree;
50 }