| 202 | } |
| 203 | |
| 204 | void NoteHocket::SetUpFromSaveData() |
| 205 | { |
| 206 | mNumDestinations = mModuleSaveData.GetInt("num_outputs"); |
| 207 | int oldNumItems = (int)mDestinationCables.size(); |
| 208 | if (mNumDestinations > oldNumItems) |
| 209 | { |
| 210 | for (int i = oldNumItems; i < mNumDestinations; ++i) |
| 211 | { |
| 212 | mDestinationCables.push_back(new AdditionalNoteCable()); |
| 213 | mDestinationCables[i]->SetPatchCableSource(new PatchCableSource(this, kConnectionType_Note)); |
| 214 | mDestinationCables[i]->GetPatchCableSource()->SetOverrideCableDir(ofVec2f(1, 0), PatchCableSource::Side::kRight); |
| 215 | AddPatchCableSource(mDestinationCables[i]->GetPatchCableSource()); |
| 216 | ofRectangle rect = mWeightSlider[i]->GetRect(true); |
| 217 | mDestinationCables[i]->GetPatchCableSource()->SetManualPosition(rect.getMaxX() + 10, rect.y + rect.height / 2); |
| 218 | } |
| 219 | } |
| 220 | else if (mNumDestinations < oldNumItems) |
| 221 | { |
| 222 | for (int i = oldNumItems - 1; i >= mNumDestinations; --i) |
| 223 | { |
| 224 | RemovePatchCableSource(mDestinationCables[i]->GetPatchCableSource()); |
| 225 | } |
| 226 | mDestinationCables.resize(mNumDestinations); |
| 227 | } |
| 228 | |
| 229 | mDeterministic = mModuleSaveData.GetBool("deterministic"); |
| 230 | |
| 231 | AdjustHeight(); |
| 232 | } |
| 233 | |
| 234 | void NoteHocket::SaveLayout(ofxJSONElement& moduleInfo) |
| 235 | { |
nothing calls this directly
no test coverage detected