diff --git a/src/Acquisition/FolderInputSystem.java b/src/Acquisition/FolderInputSystem.java index 731c3439..3eed96ec 100644 --- a/src/Acquisition/FolderInputSystem.java +++ b/src/Acquisition/FolderInputSystem.java @@ -861,7 +861,19 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D long[] allFileStarts = new long[allFiles.size()]; for (int i = 0; i < allFiles.size(); i++) { allFileStarts[i] = getFileStartTime(allFiles.get(i).getAbsoluteFile()); + if (allFileStarts[i] < firstFileStart) { +// System.out.printf("Swap first file from %s to %s\n", firstFile.getName(), allFiles.get(i).getName()); + firstFile = allFiles.get(i); + firstFileStart = allFileStarts[i]; + } + if (allFileStarts[i] > lastFileEnd) { +// System.out.printf("Swap last file from %s to %s\n", lastFile.getName(), allFiles.get(i).getName()); + lastFile = allFiles.get(i); + lastFileEnd = allFileStarts[i] + (long) (lastFile.getDurationInSeconds()*1000.); + } } + storeInfo.setFirstFileStart(firstFileStart); // just incase changed. + storeInfo.setLastFileEnd(lastFileEnd); // just incase changed storeInfo.setFileStartTimes(allFileStarts); } return storeInfo; diff --git a/src/PamController/InputStoreInfo.java b/src/PamController/InputStoreInfo.java index 265ed9d2..cde04c8c 100644 --- a/src/PamController/InputStoreInfo.java +++ b/src/PamController/InputStoreInfo.java @@ -75,6 +75,27 @@ public class InputStoreInfo { public long[] getFileStartTimes() { return fileStartTimes; } + + /** + * @param firstFileStart the firstFileStart to set + */ + public void setFirstFileStart(long firstFileStart) { + this.firstFileStart = firstFileStart; + } + + /** + * @param lastFileStart the lastFileStart to set + */ + public void setLastFileStart(long lastFileStart) { + this.lastFileStart = lastFileStart; + } + + /** + * @param lastFileEnd the lastFileEnd to set + */ + public void setLastFileEnd(long lastFileEnd) { + this.lastFileEnd = lastFileEnd; + }