| 140 | } |
| 141 | |
| 142 | json_t* dataToJson() override { |
| 143 | json_t* rootJ = json_object(); |
| 144 | |
| 145 | json_t* notesJ = json_array(); |
| 146 | for (int id = 0; id < 16; id++) { |
| 147 | json_t* noteJ = json_integer(learnedNotes[id]); |
| 148 | json_array_append_new(notesJ, noteJ); |
| 149 | } |
| 150 | json_object_set_new(rootJ, "notes", notesJ); |
| 151 | |
| 152 | json_object_set_new(rootJ, "velocity", json_boolean(velocityMode)); |
| 153 | |
| 154 | json_object_set_new(rootJ, "midi", midiOutput.toJson()); |
| 155 | return rootJ; |
| 156 | } |
| 157 | |
| 158 | void dataFromJson(json_t* rootJ) override { |
| 159 | json_t* notesJ = json_object_get(rootJ, "notes"); |