--- /dev/null
+package tim.prune.undo;\r
+\r
+import tim.prune.I18nManager;\r
+import tim.prune.data.TrackInfo;\r
+\r
+/**\r
+ * Operation to undo a load audios operation\r
+ */\r
+public class UndoLoadAudios implements UndoOperation\r
+{\r
+ /** Number of audio clips added */\r
+ private int _numAudios = -1;\r
+\r
+\r
+ /**\r
+ * Constructor\r
+ * @param inNumAudios number of audios loaded\r
+ */\r
+ public UndoLoadAudios(int inNumAudios)\r
+ {\r
+ _numAudios = inNumAudios;\r
+ }\r
+\r
+\r
+ /**\r
+ * @return description of operation including number of audios loaded\r
+ */\r
+ public String getDescription()\r
+ {\r
+ String desc = I18nManager.getText("undo.loadaudios");\r
+ if (_numAudios > 0)\r
+ desc = desc + " (" + _numAudios + ")";\r
+ return desc;\r
+ }\r
+\r
+\r
+ /**\r
+ * Perform the undo operation on the given Track\r
+ * @param inTrackInfo TrackInfo object on which to perform the operation\r
+ */\r
+ public void performUndo(TrackInfo inTrackInfo) throws UndoException\r
+ {\r
+ // crop audio list to previous size\r
+ int cropIndex = inTrackInfo.getAudioList().getNumAudios() - _numAudios;\r
+ inTrackInfo.getAudioList().cropTo(cropIndex);\r
+ // clear selection\r
+ inTrackInfo.getSelection().clearAll();\r
+ }\r
+}\r