/** * @ingroup VuoSyphonServerDescription * Decodes the JSON object @c js to create a new value. * * @eg{ * { * "serverUUID" : "Vuo" * } * } */ VuoSyphonServerDescription VuoSyphonServerDescription_makeFromJson(json_object * js) { VuoSyphonServerDescription server; json_object *o = NULL; if (json_object_object_get_ex(js, "serverUUID", &o)) server.serverUUID = VuoText_makeFromJson(o); else server.serverUUID = VuoText_make(""); if (json_object_object_get_ex(js, "serverName", &o)) server.serverName = VuoText_makeFromJson(o); else server.serverName = VuoText_make(""); if (json_object_object_get_ex(js, "applicationName", &o)) server.applicationName = VuoText_makeFromJson(o); else server.applicationName = VuoText_make(""); return server; }
/** * Decodes the JSON object @c js to create a new value. * * @eg{ * { * "id" : -1, * "name" : "" * } * } */ VuoMidiInputDevice VuoMidiInputDevice_makeFromJson(json_object * js) { VuoMidiInputDevice md = {-1,""}; json_object *o = NULL; if (json_object_object_get_ex(js, "id", &o)) md.id = VuoInteger_makeFromJson(o); if (json_object_object_get_ex(js, "name", &o)) md.name = VuoText_makeFromJson(o); else md.name = VuoText_make(""); return md; }
/** * Decodes the JSON object @c js to create a new value. * * @eg{ * { * "id" : -1, * "name" : "" * } * } */ VuoAudioOutputDevice VuoAudioOutputDevice_makeFromJson(json_object *js) { VuoAudioOutputDevice value = {-1,"",0}; json_object *o = NULL; if (json_object_object_get_ex(js, "id", &o)) value.id = VuoInteger_makeFromJson(o); if (json_object_object_get_ex(js, "name", &o)) value.name = VuoText_makeFromJson(o); else value.name = VuoText_make(""); if (json_object_object_get_ex(js, "channelCount", &o)) value.channelCount = VuoInteger_makeFromJson(o); return value; }
/** * @ingroup VuoMathExpression * Decodes the JSON object to create a new value. * * @eg{ * { * "expression" : "y = x + 4" * } * } */ VuoMathExpression VuoMathExpression_makeFromJson(json_object *js) { VuoMathExpression me; json_object *o = NULL; if (json_object_object_get_ex(js, "expression", &o)) { me.expression = VuoText_makeFromJson(o); VuoMathExpressionError error = NULL; me.parser = VuoMathExpressionParser_makeFromSingleExpression(me.expression, &error); free(error); } else { me.expression = VuoText_make(""); me.parser = NULL; } return me; }