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