| 182 | } |
| 183 | |
| 184 | int ModuleSaveData::LoadInt(std::string prop, const ofxJSONElement& moduleInfo, int defaultValue, int min, int max, bool isTextField) |
| 185 | { |
| 186 | int val = defaultValue; |
| 187 | try |
| 188 | { |
| 189 | if (!moduleInfo[prop].isNull()) |
| 190 | val = moduleInfo[prop].asInt(); |
| 191 | } |
| 192 | catch (Json::LogicError& e) |
| 193 | { |
| 194 | TheSynth->LogEvent(__PRETTY_FUNCTION__ + std::string(" json error: ") + e.what(), kLogEventType_Error); |
| 195 | } |
| 196 | SetInt(prop, val, min, max, isTextField); |
| 197 | return val; |
| 198 | } |
| 199 | |
| 200 | int ModuleSaveData::LoadInt(std::string prop, const ofxJSONElement& moduleInfo, int defaultValue, IntSlider* slider, bool isTextField) |
| 201 | { |