Vuo 2.4.4
Loading...
Searching...
No Matches
VuoMidiOutputDevice.c
Go to the documentation of this file.
1
10#include "VuoMidiOutputDevice.h"
11
13#ifdef VUO_COMPILER
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
38{
39 return (VuoMidiOutputDevice){
41 VuoJson_getObjectValue(VuoText, js, "name", NULL),
42 };
43}
44
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
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
86{
87 return value1.id == value2.id
88 && VuoText_areEqual(value1.name, value2.name);
89}
90
95{
96 return a.id < b.id;
97}
98
107