| 145 | } |
| 146 | |
| 147 | void NoteRouter::SetUpFromSaveData() |
| 148 | { |
| 149 | int numItems = mModuleSaveData.GetInt("num_items"); |
| 150 | int oldNumItems = (int)mDestinationCables.size(); |
| 151 | if (numItems > oldNumItems) |
| 152 | { |
| 153 | for (int i = oldNumItems; i < numItems; ++i) |
| 154 | { |
| 155 | mRouteSelector->AddLabel(" ", i); |
| 156 | auto* additionalCable = new AdditionalNoteCable(); |
| 157 | additionalCable->SetPatchCableSource(new PatchCableSource(this, kConnectionType_Note)); |
| 158 | AddPatchCableSource(additionalCable->GetPatchCableSource()); |
| 159 | mDestinationCables.push_back(additionalCable); |
| 160 | } |
| 161 | } |
| 162 | else if (numItems < oldNumItems) |
| 163 | { |
| 164 | for (int i = oldNumItems - 1; i >= numItems; --i) |
| 165 | { |
| 166 | mRouteSelector->RemoveLabel(i); |
| 167 | RemovePatchCableSource(mDestinationCables[i]->GetPatchCableSource()); |
| 168 | } |
| 169 | mDestinationCables.resize(numItems); |
| 170 | } |
| 171 | mRadioButtonMode = mModuleSaveData.GetBool("radiobuttonmode"); |
| 172 | mRouteSelector->SetMultiSelect(!mRadioButtonMode); |
| 173 | mOnlyShowActiveCables = mModuleSaveData.GetBool("only_show_active_cables"); |
| 174 | } |
| 175 | |
| 176 | void NoteRouter::SaveLayout(ofxJSONElement& moduleInfo) |
| 177 | { |
nothing calls this directly
no test coverage detected