Vuo  2.0.1
VuoInputEditorVideoInputDevice.cc
Go to the documentation of this file.
1 
11 
12 extern "C"
13 {
14  #include "VuoVideoInputDevice.h"
15  #include "VuoVideoCapture.h"
16 }
17 
22 void __attribute__((constructor)) VuoInputEditorVideoInputDevice_init()
23 {
25 }
26 
31 {
32  return new VuoInputEditorVideoInputDevice();
33 }
34 
39 {
40  VuoInputEditorMenuItem *optionsTree = new VuoInputEditorMenuItem("root");
41 
42  optionsTree->addItem(new VuoInputEditorMenuItem("Default device", NULL));
43  optionsTree->addSeparator();
44  optionsTree->addItem(new VuoInputEditorMenuItem("Specific device", NULL, NULL, false));
45 
47  unsigned long deviceCount = VuoListGetCount_VuoVideoInputDevice(devices);
48 
49  if (deviceCount)
50  for (unsigned long i = 1; i <= deviceCount; ++i)
51  {
53 
54  // https://b33p.net/kosada/node/9583
55  // When selecting a device via the input editor, only match by ID,
56  // since one device's name ("Logitech Camera") might be a substring of another device's name ("Logitech Camera #2").
57  device.matchType = VuoVideoInputDevice_MatchId;
58 
59  optionsTree->addItem(new VuoInputEditorMenuItem(VuoText_format(" %s", device.name), VuoVideoInputDevice_getJson(device)));
60  }
61  else
62  optionsTree->addItem(new VuoInputEditorMenuItem(" (no devices found)", NULL, NULL, false));
63 
64  return optionsTree;
65 }