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