Vuo 2.4.4
Loading...
Searching...
No Matches
VuoLeapPointableType.c
Go to the documentation of this file.
1
11
13#ifdef VUO_COMPILER
15 "title" : "Leap Pointable Type",
16 "description" : "Whether a pointable is a finger or a tool.",
17 "keywords" : [ "leap", "pointable" ],
18 "version" : "1.0.0",
19 "dependencies" : [
20 "VuoList_VuoLeapPointableType"
21 ]
22 });
23#endif
25
31{
32 const char *valueAsString = "";
33 if (json_object_get_type(js) == json_type_string)
34 valueAsString = json_object_get_string(js);
35
36 VuoLeapPointableType value = VuoLeapPointableType_Finger;
37
38 if( !strcmp(valueAsString, "tool") )
39 value = VuoLeapPointableType_Tool;
40 else
41 value = VuoLeapPointableType_Finger;
42
43 return value;
44}
45
51{
52 char *valueAsString = "";
53
54 switch (value)
55 {
56 case VuoLeapPointableType_Finger:
57 valueAsString = "finger";
58 break;
59
60 case VuoLeapPointableType_Tool:
61 valueAsString = "tool";
62 break;
63 }
64 return json_object_new_string(valueAsString);
65}
66
77
83{
84 char *valueAsString = "";
85
86 switch (value)
87 {
88 case VuoLeapPointableType_Finger:
89 valueAsString = "Finger";
90 break;
91 case VuoLeapPointableType_Tool:
92 valueAsString = "Tool";
93 break;
94 }
95 return strdup(valueAsString);
96}