Vuo  2.1.2
VuoInputEditorAudioInputDevice.cc
Go to the documentation of this file.
1 
11 
12 extern "C"
13 {
14 #include "VuoAudio.h"
15 }
16 
21 {
22  return new VuoInputEditorAudioInputDevice();
23 }
24 
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 
38 
39  unsigned long deviceCount = VuoListGetCount_VuoAudioInputDevice(devices);
40  if (deviceCount)
41  for (unsigned long i = 1; i <= deviceCount; ++i)
42  {
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 }