Vuo
2.0.2
type
inputEditor
VuoInputEditorOscInputDevice
VuoInputEditorOscInputDevice.cc
Go to the documentation of this file.
1
10
#include "
VuoInputEditorOscInputDevice.hh
"
11
12
extern
"C"
13
{
14
#include "
VuoOsc.h
"
15
}
16
20
static
void
__attribute__
((constructor)) VuoInputEditorOscInputDevice_init(
void
)
21
{
22
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
23
VuoOsc_use
();
24
});
25
}
26
30
VuoInputEditor
*
VuoInputEditorOscInputDeviceFactory::newInputEditor
()
31
{
32
return
new
VuoInputEditorOscInputDevice
();
33
}
34
38
VuoInputEditorMenuItem
*
VuoInputEditorOscInputDevice::setUpMenuTree
()
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
47
VuoList_VuoOscInputDevice
devices =
VuoOsc_getInputDeviceList
();
48
49
unsigned
long
deviceCount =
VuoListGetCount_VuoOscInputDevice
(devices);
50
if
(deviceCount)
51
for
(
unsigned
long
i = 1; i <= deviceCount; ++i)
52
{
53
VuoOscInputDevice
device =
VuoListGetValue_VuoOscInputDevice
(devices, i);
54
optionsTree->
addItem
(
new
VuoInputEditorMenuItem
(
VuoText_format
(
" %s (%s:%lld)"
, device.name, device.ipAddress, device.port),
VuoOscInputDevice_getJson
(device)));
55
}
56
else
57
optionsTree->
addItem
(
new
VuoInputEditorMenuItem
(
" (no devices found)"
, NULL, NULL,
false
));
58
59
return
optionsTree;
60
}
Generated on Thu Mar 19 2020 23:16:03 for Vuo by
1.8.17