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