Vuo
2.0.0
node
vuo.midi
VuoMidiOutputDevice.c
Go to the documentation of this file.
1
10
#include "
type.h
"
11
#include "
VuoMidiOutputDevice.h
"
12
14
#ifdef VUO_COMPILER
15
VuoModuleMetadata
({
16
"title"
:
"MIDI Output Device"
,
17
"description"
:
"A set of specifications for choosing a MIDI output device."
,
18
"keywords"
: [ ],
19
"version"
:
"1.0.0"
,
20
"dependencies"
: [
21
"VuoInteger"
,
22
"VuoText"
23
]
24
});
25
#endif
26
38
VuoMidiOutputDevice
VuoMidiOutputDevice_makeFromJson
(
json_object
* js)
39
{
40
return
(
VuoMidiOutputDevice
){
41
VuoJson_getObjectValue
(
VuoInteger
, js,
"id"
, -1),
42
VuoJson_getObjectValue
(
VuoText
, js,
"name"
, NULL),
43
""
};
44
}
45
49
json_object
*
VuoMidiOutputDevice_getJson
(
const
VuoMidiOutputDevice
md)
50
{
51
json_object
*js = json_object_new_object();
52
53
json_object
*idObject =
VuoInteger_getJson
(md.
id
);
54
json_object_object_add(js,
"id"
, idObject);
55
56
json_object
*nameObject =
VuoText_getJson
(md.
name
);
57
json_object_object_add(js,
"name"
, nameObject);
58
59
return
js;
60
}
61
65
char
*
VuoMidiOutputDevice_getSummary
(
const
VuoMidiOutputDevice
md)
66
{
67
if
(md.
id
== -1 &&
VuoText_isEmpty
(md.
name
))
68
return
VuoText_format
(
"The first MIDI output device"
);
69
else
if
(md.
id
== -1)
70
return
VuoText_format
(
"The first MIDI output device whose name contains \"%s\""
, md.
name
);
71
else
if
(strlen(md.
name
) == 0)
72
return
VuoText_format
(
"MIDI output device #%lld"
, md.
id
);
73
else
74
return
VuoText_format
(
"MIDI output device #%lld (\"%s\")"
, md.
id
, md.
name
);
75
}
76
80
bool
VuoMidiOutputDevice_areEqual
(
const
VuoMidiOutputDevice
value1,
const
VuoMidiOutputDevice
value2)
81
{
82
return
value1.
id
== value2.
id
83
&&
VuoText_areEqual
(value1.
name
, value2.
name
);
84
}
85
89
bool
VuoMidiOutputDevice_isLessThan
(
const
VuoMidiOutputDevice
a,
const
VuoMidiOutputDevice
b)
90
{
91
return
a.
id
< b.
id
;
92
}
Generated on Thu Aug 29 2019 16:20:52 for Vuo by
1.8.16