MCPcopy Create free account
hub / github.com/VCVRack/Rack / fromJson

Method fromJson

src/app/CableWidget.cpp:256–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254
255
256void CableWidget::fromJson(json_t* rootJ) {
257 json_t* colorJ = json_object_get(rootJ, "color");
258 if (colorJ && json_is_string(colorJ)) {
259 color = color::fromHexString(json_string_value(colorJ));
260 }
261 else {
262 // In <v0.6.0, cables used JSON objects instead of hex strings. Just ignore them if so and use the existing cable color.
263 // In <=v1, cable colors were not serialized.
264 color = APP->scene->rack->getNextCableColor();
265 }
266}
267
268
269static math::Vec getSlumpPos(math::Vec pos1, math::Vec pos2) {

Callers

nothing calls this directly

Calls 2

fromHexStringFunction · 0.85
getNextCableColorMethod · 0.80

Tested by

no test coverage detected