Vuo  2.0.0
VuoMidiController.c
Go to the documentation of this file.
1 
10 #include "type.h"
11 #include "VuoMidiController.h"
12 
14 #ifdef VUO_COMPILER
16  "title" : "MIDI Controller",
17  "description" : "A music controller event sent via MIDI.",
18  "keywords" : [ "CC", "custom controller" ],
19  "version" : "1.0.0",
20  "dependencies" : [
21  "VuoBoolean",
22  "VuoInteger",
23  "VuoText"
24  ]
25  });
26 #endif
27 
42 {
43  return (VuoMidiController){
44  VuoJson_getObjectValue(VuoInteger, js, "channel", 1),
45  VuoJson_getObjectValue(VuoInteger, js, "controllerNumber", 1),
46  VuoJson_getObjectValue(VuoInteger, js, "value", 127),
47  ""};
48 }
49 
55 {
56  json_object *js = json_object_new_object();
57 
58  json_object *channelObject = VuoInteger_getJson(mn.channel);
59  json_object_object_add(js, "channel", channelObject);
60 
61  json_object *controllerNumberObject = VuoInteger_getJson(mn.controllerNumber);
62  json_object_object_add(js, "controllerNumber", controllerNumberObject);
63 
64  json_object *valueObject = VuoInteger_getJson(mn.value);
65  json_object_object_add(js, "value", valueObject);
66 
67  return js;
68 }
69 
75 {
76  return VuoText_format("Channel %d, controller %d (0x%02x): value %d",
78 }
79 
84 {
85  return (value1.channel == value2.channel
86  && value1.controllerNumber == value2.controllerNumber
87  && value1.value == value2.value);
88 }
89 
95 {
99  return false;
100 }