Vuo 2.4.4
Loading...
Searching...
No Matches
VuoNotePriority.c
Go to the documentation of this file.
1
10#include "VuoNotePriority.h"
11
13#ifdef VUO_COMPILER
15 "title" : "Note Priority",
16 "description" : "Specifies the algorithm for collapsing multiple simultaneously-pressed notes into a single note.",
17 "keywords" : [ ],
18 "version" : "1.0.0",
19 "dependencies" : [
20 "VuoList_VuoNotePriority"
21 ]
22 });
23#endif
25
34{
35 const char *valueAsString = "";
36 if (json_object_get_type(js) == json_type_string)
37 valueAsString = json_object_get_string(js);
38
39 VuoNotePriority value = VuoNotePriority_First;
40
41 if (strcmp(valueAsString, "last") == 0)
42 value = VuoNotePriority_Last;
43 else if (strcmp(valueAsString, "lowest") == 0)
44 value = VuoNotePriority_Lowest;
45 else if (strcmp(valueAsString, "highest") == 0)
46 value = VuoNotePriority_Highest;
47
48 return value;
49}
50
54json_object * VuoNotePriority_getJson(const VuoNotePriority value)
55{
56 char *valueAsString = "first";
57
58 if (value == VuoNotePriority_Last)
59 valueAsString = "last";
60 else if (value == VuoNotePriority_Lowest)
61 valueAsString = "lowest";
62 else if (value == VuoNotePriority_Highest)
63 valueAsString = "highest";
64
65 return json_object_new_string(valueAsString);
66}
67
72{
74 VuoListAppendValue_VuoNotePriority(l, VuoNotePriority_First);
75 VuoListAppendValue_VuoNotePriority(l, VuoNotePriority_Last);
76 VuoListAppendValue_VuoNotePriority(l, VuoNotePriority_Lowest);
77 VuoListAppendValue_VuoNotePriority(l, VuoNotePriority_Highest);
78 return l;
79}
80
85{
86 char *valueAsString = "First Note";
87
88 if (value == VuoNotePriority_Last)
89 valueAsString = "Last Note";
90 else if (value == VuoNotePriority_Lowest)
91 valueAsString = "Lowest Note";
92 else if (value == VuoNotePriority_Highest)
93 valueAsString = "Highest Note";
94
95 return strdup(valueAsString);
96}