MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / LoadFromSaveData

Method LoadFromSaveData

Source/LocationZoomer.cpp:190–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void LocationZoomer::LoadFromSaveData(const ofxJSONElement& saveData)
191{
192 mLocations.clear();
193 for (int i = 0; i < saveData.size(); ++i)
194 {
195 try
196 {
197 int shortcut = saveData[i]["shortcut"].asInt();
198 mLocations[shortcut].mZoomLevel = saveData[i]["zoomlevel"].asDouble();
199 mLocations[shortcut].mOffset.set(saveData[i]["offset_x"].asDouble(),
200 saveData[i]["offset_y"].asDouble());
201 }
202 catch (Json::LogicError& e)
203 {
204 TheSynth->LogEvent(__PRETTY_FUNCTION__ + std::string(" json error: ") + e.what(), kLogEventType_Error);
205 }
206 }
207 MoveToLocation(-1);
208 mCurrentProgress = .999f;
209}

Callers 1

LoadLayoutMethod · 0.80

Calls 3

sizeMethod · 0.80
LogEventMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected