Vuo
2.4.4
Loading...
Searching...
No Matches
node
vuo.noise
VuoNoise.c
Go to the documentation of this file.
1
10
#include "
VuoNoise.h
"
11
13
#ifdef VUO_COMPILER
14
VuoModuleMetadata
({
15
"title"
:
"Noise"
,
16
"description"
:
"Type of noise."
,
17
"keywords"
: [ ],
18
"version"
:
"1.0.0"
,
19
"dependencies"
: [
20
"VuoList_VuoNoise"
21
]
22
});
23
#endif
25
30
VuoNoise
VuoNoise_makeFromJson
(json_object *js)
31
{
32
const
char
*valueAsString =
""
;
33
if
(json_object_get_type(js) == json_type_string)
34
valueAsString = json_object_get_string(js);
35
36
VuoNoise
noise = VuoNoise_White;
37
38
if
(strcmp(valueAsString,
"white"
) == 0) {
39
noise = VuoNoise_White;
40
}
else
if
(strcmp(valueAsString,
"grey"
) == 0) {
41
noise = VuoNoise_Grey;
42
}
else
if
(strcmp(valueAsString,
"pink"
) == 0) {
43
noise = VuoNoise_Pink;
44
}
else
if
(strcmp(valueAsString,
"brown"
) == 0) {
45
noise = VuoNoise_Brown;
46
}
else
if
(strcmp(valueAsString,
"blue"
) == 0) {
47
noise = VuoNoise_Blue;
48
}
else
if
(strcmp(valueAsString,
"violet"
) == 0) {
49
noise = VuoNoise_Violet;
50
}
51
52
return
noise;
53
}
54
59
json_object *
VuoNoise_getJson
(
const
VuoNoise
value)
60
{
61
char
* valueAsString =
""
;
62
63
switch
(value) {
64
case
VuoNoise_White:
65
valueAsString =
"white"
;
66
break
;
67
case
VuoNoise_Grey:
68
valueAsString =
"grey"
;
69
break
;
70
case
VuoNoise_Pink:
71
valueAsString =
"pink"
;
72
break
;
73
case
VuoNoise_Brown:
74
valueAsString =
"brown"
;
75
break
;
76
case
VuoNoise_Blue:
77
valueAsString =
"blue"
;
78
break
;
79
case
VuoNoise_Violet:
80
valueAsString =
"violet"
;
81
break
;
82
}
83
84
return
json_object_new_string(valueAsString);
85
}
86
90
VuoList_VuoNoise
VuoNoise_getAllowedValues
(
void
)
91
{
92
VuoList_VuoNoise
l =
VuoListCreate_VuoNoise
();
93
VuoListAppendValue_VuoNoise
(l, VuoNoise_White);
94
VuoListAppendValue_VuoNoise
(l, VuoNoise_Grey);
95
VuoListAppendValue_VuoNoise
(l, VuoNoise_Pink);
96
VuoListAppendValue_VuoNoise
(l, VuoNoise_Brown);
97
VuoListAppendValue_VuoNoise
(l, VuoNoise_Blue);
98
VuoListAppendValue_VuoNoise
(l, VuoNoise_Violet);
99
return
l;
100
}
101
106
char
*
VuoNoise_getSummary
(
const
VuoNoise
value)
107
{
108
return
VuoNoise_getString
(value);
109
}
Generated on Thu Nov 9 2023 16:59:30 for Vuo by
1.9.8