mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-25 16:42:27 +00:00
commit
508ca524e8
@ -861,7 +861,19 @@ public class FolderInputSystem extends FileInputSystem implements PamSettings, D
|
|||||||
long[] allFileStarts = new long[allFiles.size()];
|
long[] allFileStarts = new long[allFiles.size()];
|
||||||
for (int i = 0; i < allFiles.size(); i++) {
|
for (int i = 0; i < allFiles.size(); i++) {
|
||||||
allFileStarts[i] = getFileStartTime(allFiles.get(i).getAbsoluteFile());
|
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);
|
storeInfo.setFileStartTimes(allFileStarts);
|
||||||
}
|
}
|
||||||
return storeInfo;
|
return storeInfo;
|
||||||
|
@ -76,6 +76,27 @@ public class InputStoreInfo {
|
|||||||
return fileStartTimes;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,8 @@ public class NIFilePlayback implements FilePlaybackDevice, PamSettings {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean preparePlayback(PlaybackParameters playbackParameters) {
|
public boolean preparePlayback(PlaybackParameters playbackParameters) {
|
||||||
if (niDeviceLUT == null || niDeviceLUT.length <= playbackParameters.deviceNumber) {
|
if (niDeviceLUT == null || niDeviceLUT.length <= playbackParameters.deviceNumber
|
||||||
|
|| playbackParameters.deviceNumber < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int bn = niDeviceLUT[playbackParameters.deviceNumber];
|
int bn = niDeviceLUT[playbackParameters.deviceNumber];
|
||||||
|
Loading…
Reference in New Issue
Block a user