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

Method dataToJson

src/core/MIDI_Gate.cpp:183–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181 }
182
183 json_t* dataToJson() override {
184 json_t* rootJ = json_object();
185
186 json_t* notesJ = json_array();
187 for (int i = 0; i < 16; i++) {
188 json_array_append_new(notesJ, json_integer(learnedNotes[i]));
189 }
190 json_object_set_new(rootJ, "notes", notesJ);
191
192 json_object_set_new(rootJ, "velocity", json_integer(velocityMode));
193
194 json_object_set_new(rootJ, "mpeMode", json_boolean(mpeMode));
195
196 json_object_set_new(rootJ, "trigMode", json_boolean(trigMode));
197
198 json_object_set_new(rootJ, "midi", midiInput.toJson());
199
200 return rootJ;
201 }
202
203 void dataFromJson(json_t* rootJ) override {
204 json_t* notesJ = json_object_get(rootJ, "notes");

Callers

nothing calls this directly

Calls 1

toJsonMethod · 0.45

Tested by

no test coverage detected