Mercurial > hg > soniczoomios
diff presetManager.mm @ 38:0dfe9e0c01aa
Evnt trails fit with uploads. Smooth button.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Wed, 10 Apr 2013 18:57:05 +0100 |
parents | 8ed7522deaaa |
children | df7c08faf541 |
line wrap: on
line diff
--- a/presetManager.mm Tue Apr 09 17:14:31 2013 +0100 +++ b/presetManager.mm Wed Apr 10 18:57:05 2013 +0100 @@ -109,8 +109,11 @@ int i = 0; for(presetIter = thePresets.begin(); presetIter < thePresets.end(); presetIter++){ - root["presets"][i] = (*presetIter)->presetToJson(); - i++; + // only save the preset to file if it was ours... (other users and defaults saved elewhere) + if((*presetIter)->creatorDeviceID == eventLogger.deviceID){ + root["presets"][i] = (*presetIter)->presetToJson(); + i++; + } } return root; @@ -195,10 +198,13 @@ } */ // hmm shouldn't have to know about eventlogger and grid view... - // TODO get coord might be wrong if in interpolation mode - thePresets.push_back(new Preset(theGridView.getCoord(), name,nextID, eventLogger.userName, eventLogger.deviceID)); - eventLogger.logEvent(SAVE_PRESET, theGridView.getCoord()); + // get the preset coord from the grid + TwoVector coord = theGridView.getCoord(); + + + thePresets.push_back(new Preset(coord, name,nextID, eventLogger.userName, eventLogger.deviceID)); + eventLogger.logEvent(SAVE_PRESET, coord); // poke grid view to get it to show details theGridView.snapCheck(); // if ok