Vuo
2.0.1
type
inputEditor
VuoInputEditorVideoInputDevice
VuoInputEditorVideoInputDevice.cc
Go to the documentation of this file.
1
10
#include "
VuoInputEditorVideoInputDevice.hh
"
11
12
extern
"C"
13
{
14
#include "
VuoVideoInputDevice.h
"
15
#include "
VuoVideoCapture.h
"
16
}
17
22
void
__attribute__
((constructor)) VuoInputEditorVideoInputDevice_init()
23
{
24
VuoVideoCapture_getInputDevices
();
25
}
26
30
VuoInputEditor
*
VuoInputEditorVideoInputDeviceFactory::newInputEditor
()
31
{
32
return
new
VuoInputEditorVideoInputDevice
();
33
}
34
38
VuoInputEditorMenuItem
*
VuoInputEditorVideoInputDevice::setUpMenuTree
()
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
46
VuoList_VuoVideoInputDevice
devices =
VuoVideoCapture_getInputDevices
();
47
unsigned
long
deviceCount =
VuoListGetCount_VuoVideoInputDevice
(devices);
48
49
if
(deviceCount)
50
for
(
unsigned
long
i = 1; i <= deviceCount; ++i)
51
{
52
VuoVideoInputDevice
device =
VuoListGetValue_VuoVideoInputDevice
(devices, i);
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
}
Generated on Sat Mar 14 2020 13:04:38 for Vuo by
1.8.17