Normalized all file paths

This commit is contained in:
2021-01-22 11:55:38 +00:00
parent b74f1aedb4
commit ead577521d
5 changed files with 18 additions and 12 deletions

2
dist/linux/stub vendored
View File

@@ -5,6 +5,6 @@ java=java
if test -n "$JAVA_HOME"; then
java="$JAVA_HOME/bin/java"
fi
java_args=-Xmx1g
java_args=-Xmx8g
exec "$java" $java_args -jar $MYSELF "$@"
exit 1

View File

@@ -2351,7 +2351,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
book.save();
// Add the book to the tree
loadXMLBookStructure(new File(book.getLocation(), "audiobook.abx"));
loadXMLBookStructure(book.getLocation("audiobook.abx"));
updateOpenBookList();
} catch (Exception ex) {
ex.printStackTrace();
@@ -3240,8 +3240,8 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
}
newSentence.writeAudioData(startSamples);
newSentence.setPostGapType("continuation");
newSentence.setPostGap(Options.getInteger("catenation.short-sentence"));
newSentence.setPostGapType("sentence");
newSentence.setPostGap(Options.getInteger("catenation.post-sentence"));
selectedSentence.writeAudioData(endSamples);
selectedSentence.autoTrimSample();

View File

@@ -502,6 +502,11 @@ public class Book extends BookTreeNode {
return location;
}
public File getLocation(String dir) {
Debug.trace();
return new File(location, dir);
}
public void setLocation(File l) {
Debug.trace();
location = l;

View File

@@ -172,12 +172,7 @@ public class Chapter extends BookTreeNode {
Book book = getBook();
File bookRoot = new File(Options.get("path.storage"), book.getName());
if (!bookRoot.exists()) {
bookRoot.mkdirs();
}
File export = new File(bookRoot, "export");
File export = book.getLocation("export");
if (!export.exists()) {
export.mkdirs();
}

View File

@@ -235,6 +235,11 @@ public class Sentence extends BookTreeNode implements Cacheable {
peak = Utils.s2d(Book.getTextNode(root, "peak", "-1.000"));
isDetected = Utils.s2b(Book.getTextNode(root, "detected"));
if (sampleSize == 0) {
loadFile();
autoTrimSample();
}
gainPoints = new TreeMap<Integer, Double>();
Element gp = Book.getNode(root, "gainpoints");
if (gp != null) {
@@ -580,7 +585,7 @@ public class Sentence extends BookTreeNode implements Cacheable {
Debug.d("Get file for", id);
Book book = getBook();
if (book == null) return null;
File b = new File(book.getLocation(), "files");
File b = book.getLocation("files");
if (!b.exists()) {
b.mkdirs();
}
@@ -589,7 +594,7 @@ public class Sentence extends BookTreeNode implements Cacheable {
public File getTempFile() {
Debug.trace();
File b = new File(getBook().getLocation(), "files");
File b = getBook().getLocation("files");
if (!b.exists()) {
b.mkdirs();
}
@@ -2027,6 +2032,7 @@ public class Sentence extends BookTreeNode implements Cacheable {
public double[] getWaveProfile() {
if (waveProfile != null) return waveProfile;
double[][] samples = getProcessedAudioData();
if (samples[LEFT].length == 0) return null;
waveProfile = new double[samples[LEFT].length];
double rt = 0;