private DataPoint[] _contents = null;\r
private PhotoList _photoList = null;\r
private FileInfo _oldFileInfo = null;\r
+ // Numbers of each media before operation\r
+ private int _numPhotos = -1, _numAudios = -1;\r
\r
\r
/**\r
return desc;\r
}\r
\r
+ /**\r
+ * Set the number of photos and audios before the load operation\r
+ * @param inNumPhotos number of photos\r
+ * @param inNumAudios number of audios\r
+ */\r
+ public void setNumPhotosAudios(int inNumPhotos, int inNumAudios)\r
+ {\r
+ _numPhotos = inNumPhotos;\r
+ _numAudios = inNumAudios;\r
+ }\r
\r
/**\r
* Perform the undo operation on the given Track\r
else\r
{\r
// replace photos how they were\r
- if (_photoList != null)\r
- {\r
+ if (_photoList != null) {\r
inTrackInfo.getPhotoList().restore(_photoList);\r
}\r
+ // Crop media lists to previous size (if specified)\r
+ if (_numPhotos > -1) {inTrackInfo.getPhotoList().cropTo(_numPhotos);}\r
+ if (_numAudios > -1) {inTrackInfo.getAudioList().cropTo(_numAudios);}\r
// replace track contents with old\r
if (!inTrackInfo.getTrack().replaceContents(_contents))\r
{\r
// clear selection\r
inTrackInfo.getSelection().clearAll();\r
}\r
-}
\ No newline at end of file
+}\r