| 126 | } |
| 127 | |
| 128 | void PulseRouter::SetUpFromSaveData() |
| 129 | { |
| 130 | int numItems = mModuleSaveData.GetInt("num_items"); |
| 131 | int oldNumItems = (int)mDestinationCables.size(); |
| 132 | if (numItems > oldNumItems) |
| 133 | { |
| 134 | for (int i = oldNumItems; i < numItems; ++i) |
| 135 | { |
| 136 | mDestinationCables.push_back(new PatchCableSource(this, kConnectionType_Pulse)); |
| 137 | mRouteSelector->AddLabel(" ", i); |
| 138 | AddPatchCableSource(mDestinationCables[i]); |
| 139 | mDestinationCables[i]->SetOverrideCableDir(ofVec2f(1, 0), PatchCableSource::Side::kRight); |
| 140 | ofRectangle rect = GetRect(true); |
| 141 | mDestinationCables[i]->SetManualPosition(rect.getMaxX() + 10, rect.y + rect.height / 2); |
| 142 | } |
| 143 | } |
| 144 | else if (numItems < oldNumItems) |
| 145 | { |
| 146 | for (int i = oldNumItems - 1; i >= numItems; --i) |
| 147 | { |
| 148 | mRouteSelector->RemoveLabel(i); |
| 149 | RemovePatchCableSource(mDestinationCables[i]); |
| 150 | } |
| 151 | mDestinationCables.resize(numItems); |
| 152 | } |
| 153 | mRadioButtonMode = mModuleSaveData.GetBool("radiobuttonmode"); |
| 154 | mRouteSelector->SetMultiSelect(!mRadioButtonMode); |
| 155 | mOnlyShowActiveCables = mModuleSaveData.GetBool("only_show_active_cables"); |
| 156 | } |
| 157 | |
| 158 | void PulseRouter::SaveLayout(ofxJSONElement& moduleInfo) |
| 159 | { |
nothing calls this directly
no test coverage detected