Vuo
2.4.4
Loading...
Searching...
No Matches
node
vuo.midi
VuoMidiOutputDevice.c
Go to the documentation of this file.
1
10
#include "
VuoMidiOutputDevice.h
"
11
13
#ifdef VUO_COMPILER
14
VuoModuleMetadata
({
15
"title"
:
"MIDI Output Device"
,
16
"description"
:
"A set of specifications for choosing a MIDI output device."
,
17
"keywords"
: [ ],
18
"version"
:
"1.0.0"
,
19
"dependencies"
: [
20
"VuoInteger"
,
21
"VuoText"
22
]
23
});
24
#endif
26
37
VuoMidiOutputDevice
VuoMidiOutputDevice_makeFromJson
(json_object * js)
38
{
39
return
(
VuoMidiOutputDevice
){
40
VuoJson_getObjectValue
(
VuoInteger
, js,
"id"
, -1),
41
VuoJson_getObjectValue
(
VuoText
, js,
"name"
, NULL),
42
};
43
}
44
48
json_object *
VuoMidiOutputDevice_getJson
(
const
VuoMidiOutputDevice
md)
49
{
50
json_object *js = json_object_new_object();
51
52
if
(md.
id
> 0)
53
{
54
json_object *idObject =
VuoInteger_getJson
(md.
id
);
55
json_object_object_add(js,
"id"
, idObject);
56
}
57
58
if
(md.
name
)
59
{
60
json_object *nameObject =
VuoText_getJson
(md.
name
);
61
json_object_object_add(js,
"name"
, nameObject);
62
}
63
64
return
js;
65
}
66
70
char
*
VuoMidiOutputDevice_getSummary
(
const
VuoMidiOutputDevice
md)
71
{
72
if
(md.
id
== -1 &&
VuoText_isEmpty
(md.
name
))
73
return
VuoText_format
(
"The first MIDI output device"
);
74
else
if
(md.
id
== -1)
75
return
VuoText_format
(
"The first MIDI output device whose name contains \"%s\""
, md.
name
);
76
else
if
(strlen(md.
name
) == 0)
77
return
VuoText_format
(
"MIDI output device #%lld"
, md.
id
);
78
else
79
return
VuoText_format
(
"MIDI output device #%lld (\"%s\")"
, md.
id
, md.
name
);
80
}
81
85
bool
VuoMidiOutputDevice_areEqual
(
const
VuoMidiOutputDevice
value1,
const
VuoMidiOutputDevice
value2)
86
{
87
return
value1.
id
== value2.
id
88
&&
VuoText_areEqual
(value1.
name
, value2.
name
);
89
}
90
94
bool
VuoMidiOutputDevice_isLessThan
(
const
VuoMidiOutputDevice
a,
const
VuoMidiOutputDevice
b)
95
{
96
return
a.
id
< b.
id
;
97
}
98
103
void
VuoMidiOutputDevice_retain
(
VuoMidiOutputDevice
value)
104
{
105
VuoRetain
(value.
name
);
106
}
107
112
void
VuoMidiOutputDevice_release
(
VuoMidiOutputDevice
value)
113
{
114
VuoRelease
(value.
name
);
115
}
Generated on Thu Nov 9 2023 16:59:30 for Vuo by
1.9.8