Vuo
2.4.0
type
inputEditor
VuoInputEditorAudioInputDevice
VuoInputEditorAudioInputDevice.cc
Go to the documentation of this file.
1
10
#include "
VuoInputEditorAudioInputDevice.hh
"
11
12
extern
"C"
13
{
14
#include "
VuoAudio.h
"
15
}
16
20
VuoInputEditor
*
VuoInputEditorAudioInputDeviceFactory::newInputEditor
()
21
{
22
return
new
VuoInputEditorAudioInputDevice
();
23
}
24
28
VuoInputEditorMenuItem
*
VuoInputEditorAudioInputDevice::setUpMenuTree
()
29
{
30
VuoInputEditorMenuItem
*optionsTree =
new
VuoInputEditorMenuItem
(
"root"
);
31
32
optionsTree->
addItem
(
new
VuoInputEditorMenuItem
(
"Default device"
, NULL));
33
34
optionsTree->
addSeparator
();
35
optionsTree->
addItem
(
new
VuoInputEditorMenuItem
(
"Specific device (by model and name)"
, NULL, NULL,
false
));
36
37
VuoList_VuoAudioInputDevice
devices =
VuoAudio_getInputDevices
();
38
39
unsigned
long
deviceCount =
VuoListGetCount_VuoAudioInputDevice
(devices);
40
if
(deviceCount)
41
for
(
unsigned
long
i = 1; i <= deviceCount; ++i)
42
{
43
VuoAudioInputDevice
device =
VuoListGetValue_VuoAudioInputDevice
(devices, i);
44
45
json_object
*deviceJson = json_object_new_object();
46
json_object_object_add(deviceJson,
"modelUid"
,
VuoText_getJson
(device.
modelUid
));
47
json_object_object_add(deviceJson,
"name"
,
VuoText_getJson
(device.
name
));
48
49
optionsTree->
addItem
(
new
VuoInputEditorMenuItem
(
VuoText_format
(
" %s (%lld input channels)"
, device.
name
, device.
channelCount
), deviceJson));
50
}
51
else
52
optionsTree->
addItem
(
new
VuoInputEditorMenuItem
(
" (no devices found)"
, NULL, NULL,
false
));
53
54
return
optionsTree;
55
}
Generated on Wed Nov 24 2021 15:28:18 for Vuo by
1.9.2