Clean up stdout noise
This commit is contained in:
@@ -760,7 +760,7 @@ public abstract class AbstractTheme extends MetalTheme {
|
|||||||
b = Integer.parseInt(colorProp.substring(p2 + 1));
|
b = Integer.parseInt(colorProp.substring(p2 + 1));
|
||||||
return new ColorUIResource(r, g, b);
|
return new ColorUIResource(r, g, b);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
System.out.println("Exception while parsing color: " + colorProp);
|
System.err.println("Exception while parsing color: " + colorProp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return color;
|
return color;
|
||||||
@@ -771,7 +771,7 @@ public abstract class AbstractTheme extends MetalTheme {
|
|||||||
try {
|
try {
|
||||||
val = Integer.parseInt(intProp);
|
val = Integer.parseInt(intProp);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
System.out.println("Exception while parsing color: " + intProp);
|
System.err.println("Exception while parsing color: " + intProp);
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class LazyImageIcon implements Icon {
|
|||||||
try {
|
try {
|
||||||
icon = new ImageIcon(LazyImageIcon.class.getResource(name));
|
icon = new ImageIcon(LazyImageIcon.class.getResource(name));
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
System.out.println("ERROR: loading image " + name + " failed!");
|
System.err.println("ERROR: loading image " + name + " failed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return icon;
|
return icon;
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class LazyMenuArrowImageIcon implements Icon {
|
|||||||
try {
|
try {
|
||||||
leftToRightIcon = new ImageIcon(LazyMenuArrowImageIcon.class.getResource(leftToRightName));
|
leftToRightIcon = new ImageIcon(LazyMenuArrowImageIcon.class.getResource(leftToRightName));
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
System.out.println("ERROR: loading image " + leftToRightName + " failed!");
|
System.err.println("ERROR: loading image " + leftToRightName + " failed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return leftToRightIcon;
|
return leftToRightIcon;
|
||||||
@@ -59,7 +59,7 @@ public class LazyMenuArrowImageIcon implements Icon {
|
|||||||
try {
|
try {
|
||||||
rightToLeftIcon = new ImageIcon(LazyMenuArrowImageIcon.class.getResource(rightToLefttName));
|
rightToLeftIcon = new ImageIcon(LazyMenuArrowImageIcon.class.getResource(rightToLefttName));
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
System.out.println("ERROR: loading image " + rightToLefttName + " failed!");
|
System.err.println("ERROR: loading image " + rightToLefttName + " failed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rightToLeftIcon;
|
return rightToLeftIcon;
|
||||||
|
|||||||
@@ -63,11 +63,6 @@ public class AGC implements Effect {
|
|||||||
gain = 1d;
|
gain = 1d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
Debug.trace();
|
|
||||||
System.out.println(toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public ArrayList<Effect> getChildEffects() {
|
public ArrayList<Effect> getChildEffects() {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -46,11 +46,6 @@ public class Amplifier implements Effect {
|
|||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
Debug.trace();
|
|
||||||
System.out.println(toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(double sf) {
|
public void init(double sf) {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1104,10 +1104,10 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
newbook.setComment(info.getComment().trim());
|
newbook.setComment(info.getComment().trim());
|
||||||
newbook.setACX(info.getACX().trim());
|
newbook.setACX(info.getACX().trim());
|
||||||
|
|
||||||
Chapter caud = new Chapter("audition", "Audition");
|
Chapter caud = new Chapter(newbook, "audition", "Audition");
|
||||||
Chapter copen = new Chapter("open", "Opening Credits");
|
Chapter copen = new Chapter(newbook, "open", "Opening Credits");
|
||||||
Chapter cclose = new Chapter("close", "Closing Credits");
|
Chapter cclose = new Chapter(newbook, "close", "Closing Credits");
|
||||||
Chapter cone = new Chapter(UUID.randomUUID().toString(), "Chapter 1");
|
Chapter cone = new Chapter(newbook, UUID.randomUUID().toString(), "Chapter 1");
|
||||||
|
|
||||||
newbook.add(caud);
|
newbook.add(caud);
|
||||||
newbook.add(copen);
|
newbook.add(copen);
|
||||||
@@ -1345,7 +1345,8 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
JMenuObject o = (JMenuObject)e.getSource();
|
JMenuObject o = (JMenuObject)e.getSource();
|
||||||
Sentence s = (Sentence)o.getObject();
|
Sentence s = (Sentence)o.getObject();
|
||||||
Chapter c = (Chapter)s.getParent();
|
Chapter c = (Chapter)s.getParent();
|
||||||
Sentence newSentence = new Sentence();
|
Book b = c.getBook();
|
||||||
|
Sentence newSentence = new Sentence(b);
|
||||||
int where = bookTreeModel.getIndexOfChild(c, s);
|
int where = bookTreeModel.getIndexOfChild(c, s);
|
||||||
bookTreeModel.insertNodeInto(newSentence, c, where);
|
bookTreeModel.insertNodeInto(newSentence, c, where);
|
||||||
bookTreeModel.reload(newSentence);
|
bookTreeModel.reload(newSentence);
|
||||||
@@ -1358,7 +1359,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
JMenuObject o = (JMenuObject)e.getSource();
|
JMenuObject o = (JMenuObject)e.getSource();
|
||||||
Sentence s = (Sentence)o.getObject();
|
Sentence s = (Sentence)o.getObject();
|
||||||
Chapter c = (Chapter)s.getParent();
|
Chapter c = (Chapter)s.getParent();
|
||||||
Sentence newSentence = new Sentence();
|
Sentence newSentence = new Sentence(c.getBook());
|
||||||
int where = bookTreeModel.getIndexOfChild(c, s);
|
int where = bookTreeModel.getIndexOfChild(c, s);
|
||||||
bookTreeModel.insertNodeInto(newSentence, c, where + 1);
|
bookTreeModel.insertNodeInto(newSentence, c, where + 1);
|
||||||
bookTreeModel.reload(newSentence);
|
bookTreeModel.reload(newSentence);
|
||||||
@@ -2001,8 +2002,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
lastSentence.setPostGapType("continuation");
|
lastSentence.setPostGapType("continuation");
|
||||||
}
|
}
|
||||||
|
|
||||||
Sentence s = new Sentence();
|
Sentence s = new Sentence(getBook());
|
||||||
s.setParentBook(getBook());
|
|
||||||
bookTreeModel.insertNodeInto(s, c, c.getChildCount());
|
bookTreeModel.insertNodeInto(s, c, c.getChildCount());
|
||||||
|
|
||||||
bookTree.expandPath(new TreePath(c.getPath()));
|
bookTree.expandPath(new TreePath(c.getPath()));
|
||||||
@@ -2053,8 +2053,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
lastSentence.setPostGapType("paragraph");
|
lastSentence.setPostGapType("paragraph");
|
||||||
}
|
}
|
||||||
|
|
||||||
Sentence s = new Sentence();
|
Sentence s = new Sentence(getBook());
|
||||||
s.setParentBook(getBook());
|
|
||||||
bookTreeModel.insertNodeInto(s, c, c.getChildCount());
|
bookTreeModel.insertNodeInto(s, c, c.getChildCount());
|
||||||
|
|
||||||
bookTree.expandPath(new TreePath(c.getPath()));
|
bookTree.expandPath(new TreePath(c.getPath()));
|
||||||
@@ -2104,8 +2103,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
lastSentence.setPostGapType("section");
|
lastSentence.setPostGapType("section");
|
||||||
}
|
}
|
||||||
|
|
||||||
Sentence s = new Sentence();
|
Sentence s = new Sentence(getBook());
|
||||||
s.setParentBook(getBook());
|
|
||||||
bookTreeModel.insertNodeInto(s, c, c.getChildCount());
|
bookTreeModel.insertNodeInto(s, c, c.getChildCount());
|
||||||
|
|
||||||
bookTree.expandPath(new TreePath(c.getPath()));
|
bookTree.expandPath(new TreePath(c.getPath()));
|
||||||
@@ -2155,8 +2153,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
lastSentence.setPostGapType("sentence");
|
lastSentence.setPostGapType("sentence");
|
||||||
}
|
}
|
||||||
|
|
||||||
Sentence s = new Sentence();
|
Sentence s = new Sentence(getBook());
|
||||||
s.setParentBook(getBook());
|
|
||||||
bookTreeModel.insertNodeInto(s, c, c.getChildCount());
|
bookTreeModel.insertNodeInto(s, c, c.getChildCount());
|
||||||
|
|
||||||
bookTree.expandPath(new TreePath(c.getPath()));
|
bookTree.expandPath(new TreePath(c.getPath()));
|
||||||
@@ -2284,14 +2281,14 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Chapter convertChapter(String name, String id, Properties data) {
|
public Chapter convertChapter(String name, String id, Properties data) {
|
||||||
Chapter c = new Chapter(id, data.getProperty("chapter." + name + ".name"));
|
Chapter c = new Chapter(getBook(), id, data.getProperty("chapter." + name + ".name"));
|
||||||
|
|
||||||
for (int i = 0; i < 100000000; i++) {
|
for (int i = 0; i < 100000000; i++) {
|
||||||
String sid = data.getProperty(String.format("chapter." + name + ".sentence.%08d.id", i));
|
String sid = data.getProperty(String.format("chapter." + name + ".sentence.%08d.id", i));
|
||||||
String text = data.getProperty(String.format("chapter." + name + ".sentence.%08d.text", i));
|
String text = data.getProperty(String.format("chapter." + name + ".sentence.%08d.text", i));
|
||||||
int gap = Utils.s2i(data.getProperty(String.format("chapter." + name + ".sentence.%08d.post-gap", i)));
|
int gap = Utils.s2i(data.getProperty(String.format("chapter." + name + ".sentence.%08d.post-gap", i)));
|
||||||
if (sid == null) break;
|
if (sid == null) break;
|
||||||
Sentence s = new Sentence(sid, text);
|
Sentence s = new Sentence(c.getBook(), sid, text);
|
||||||
s.setPostGap(gap);
|
s.setPostGap(gap);
|
||||||
s.setStartOffset(Utils.s2i(data.getProperty(String.format("chapter." + name + ".sentence.%08d.start-offset", i))));
|
s.setStartOffset(Utils.s2i(data.getProperty(String.format("chapter." + name + ".sentence.%08d.start-offset", i))));
|
||||||
s.setEndOffset(Utils.s2i(data.getProperty(String.format("chapter. " + name + ".sentence.%08d.end-offset", i))));
|
s.setEndOffset(Utils.s2i(data.getProperty(String.format("chapter. " + name + ".sentence.%08d.end-offset", i))));
|
||||||
@@ -2435,15 +2432,12 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
sampleWaveform.setPlayMarker(pos / format.getFrameSize());
|
sampleWaveform.setPlayMarker(pos / format.getFrameSize());
|
||||||
int l = data.length - pos;
|
int l = data.length - pos;
|
||||||
if (l > blockSize) l = blockSize;
|
if (l > blockSize) l = blockSize;
|
||||||
System.out.println(play.write(data, pos, l));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("Closing...");
|
|
||||||
play.drain();
|
play.drain();
|
||||||
play.stop();
|
play.stop();
|
||||||
play.close();
|
play.close();
|
||||||
play = null;
|
play = null;
|
||||||
System.out.println("Closed");
|
|
||||||
playing = null;
|
playing = null;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -2691,10 +2685,8 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
public void stopPlaying() {
|
public void stopPlaying() {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
if (play != null) {
|
if (play != null) {
|
||||||
System.out.println("Forcing close");
|
|
||||||
play.close();
|
play.close();
|
||||||
play = null;
|
play = null;
|
||||||
System.out.println("Closed!!!");
|
|
||||||
}
|
}
|
||||||
playing = null;
|
playing = null;
|
||||||
}
|
}
|
||||||
@@ -2785,8 +2777,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
Chapter fc = (Chapter)from.getFirstChild();
|
Chapter fc = (Chapter)from.getFirstChild();
|
||||||
Chapter tc = findChapter(to, fc.getId(), fc.getName());
|
Chapter tc = findChapter(to, fc.getId(), fc.getName());
|
||||||
if (tc == null) {
|
if (tc == null) {
|
||||||
tc = new Chapter(fc.getId(), fc.getName());
|
tc = new Chapter(to, fc.getId(), fc.getName());
|
||||||
tc.setParentBook(to);
|
|
||||||
to.add(tc);
|
to.add(tc);
|
||||||
}
|
}
|
||||||
moveSentences(fc, tc);
|
moveSentences(fc, tc);
|
||||||
@@ -3434,7 +3425,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
public void findOrphans(Book book) {
|
public void findOrphans(Book book) {
|
||||||
Chapter orphans = book.getChapterById("orphans");
|
Chapter orphans = book.getChapterById("orphans");
|
||||||
if (orphans == null) {
|
if (orphans == null) {
|
||||||
orphans = new Chapter("orphans", "Orphan Files");
|
orphans = new Chapter(book, "orphans", "Orphan Files");
|
||||||
orphans.setParentBook(book);
|
orphans.setParentBook(book);
|
||||||
book.add(orphans);
|
book.add(orphans);
|
||||||
}
|
}
|
||||||
@@ -3449,7 +3440,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
String id = filename.substring(0, filename.length() - 4);
|
String id = filename.substring(0, filename.length() - 4);
|
||||||
Debug.d("Testing orphanicity of", id);
|
Debug.d("Testing orphanicity of", id);
|
||||||
if (!sentenceIdExists(book, id)) {
|
if (!sentenceIdExists(book, id)) {
|
||||||
Sentence newSentence = new Sentence(id, id);
|
Sentence newSentence = new Sentence(book, id, id);
|
||||||
newSentence.setParentBook(book);
|
newSentence.setParentBook(book);
|
||||||
orphans.add(newSentence);
|
orphans.add(newSentence);
|
||||||
}
|
}
|
||||||
@@ -3644,7 +3635,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
Book book = c.getBook();
|
Book book = c.getBook();
|
||||||
AudioFormat targetFormat = book.getAudioFormat();
|
AudioFormat targetFormat = book.getAudioFormat();
|
||||||
|
|
||||||
Sentence newSentence = new Sentence();
|
Sentence newSentence = new Sentence(book);
|
||||||
newSentence.setText(f.getName());
|
newSentence.setText(f.getName());
|
||||||
newSentence.setParentBook(book);
|
newSentence.setParentBook(book);
|
||||||
c.add(newSentence);
|
c.add(newSentence);
|
||||||
|
|||||||
@@ -259,8 +259,4 @@ public class Biquad implements Effect {
|
|||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
Debug.trace();
|
|
||||||
System.out.println(toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class Book extends BookTreeNode {
|
|||||||
location = new File(Options.get("path.storage"), sanitize(name));
|
location = new File(Options.get("path.storage"), sanitize(name));
|
||||||
AudiobookRecorder.window.setTitle("AudioBook Recorder :: " + name); // This should be in the load routine!!!!
|
AudiobookRecorder.window.setTitle("AudioBook Recorder :: " + name); // This should be in the load routine!!!!
|
||||||
setIcon(Icons.book);
|
setIcon(Icons.book);
|
||||||
roomNoise = new Sentence("room-noise", "Room Noise");
|
roomNoise = new Sentence(this, "room-noise", "Room Noise");
|
||||||
roomNoise.setParentBook(this);
|
roomNoise.setParentBook(this);
|
||||||
loadEffects();
|
loadEffects();
|
||||||
}
|
}
|
||||||
@@ -118,14 +118,14 @@ public class Book extends BookTreeNode {
|
|||||||
setIcon(Icons.book);
|
setIcon(Icons.book);
|
||||||
}
|
}
|
||||||
|
|
||||||
roomNoise = new Sentence("room-noise", "Room Noise");
|
roomNoise = new Sentence(this, "room-noise", "Room Noise");
|
||||||
roomNoise.setParentBook(this);
|
roomNoise.setParentBook(this);
|
||||||
|
|
||||||
Element chapters = getNode(root, "chapters");
|
Element chapters = getNode(root, "chapters");
|
||||||
NodeList chapterList = chapters.getElementsByTagName("chapter");
|
NodeList chapterList = chapters.getElementsByTagName("chapter");
|
||||||
for (int i = 0; i < chapterList.getLength(); i++) {
|
for (int i = 0; i < chapterList.getLength(); i++) {
|
||||||
Element chapterElement = (Element)chapterList.item(i);
|
Element chapterElement = (Element)chapterList.item(i);
|
||||||
Chapter newChapter = new Chapter(chapterElement);
|
Chapter newChapter = new Chapter(this, chapterElement);
|
||||||
newChapter.setParentBook(this);
|
newChapter.setParentBook(this);
|
||||||
add(newChapter);
|
add(newChapter);
|
||||||
}
|
}
|
||||||
@@ -160,12 +160,12 @@ public class Book extends BookTreeNode {
|
|||||||
|
|
||||||
NodeList chapterList = chapters.getElementsByTagName("chapter");
|
NodeList chapterList = chapters.getElementsByTagName("chapter");
|
||||||
|
|
||||||
roomNoise = new Sentence("room-noise", "Room Noise");
|
roomNoise = new Sentence(this, "room-noise", "Room Noise");
|
||||||
roomNoise.setParentBook(this);
|
roomNoise.setParentBook(this);
|
||||||
|
|
||||||
for (int i = 0; i < chapterList.getLength(); i++) {
|
for (int i = 0; i < chapterList.getLength(); i++) {
|
||||||
Element chapterElement = (Element)chapterList.item(i);
|
Element chapterElement = (Element)chapterList.item(i);
|
||||||
Chapter newChapter = new Chapter(chapterElement, model);
|
Chapter newChapter = new Chapter(this, chapterElement, model);
|
||||||
model.insertNodeInto(newChapter, this, getChildCount());
|
model.insertNodeInto(newChapter, this, getChildCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -259,7 +259,7 @@ public class Book extends BookTreeNode {
|
|||||||
public Chapter addChapter() {
|
public Chapter addChapter() {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
Chapter c = new Chapter(uuid, uuid);
|
Chapter c = new Chapter(this, uuid, uuid);
|
||||||
add(c);
|
add(c);
|
||||||
c.setParentBook(this);
|
c.setParentBook(this);
|
||||||
return c;
|
return c;
|
||||||
@@ -268,7 +268,7 @@ public class Book extends BookTreeNode {
|
|||||||
public Chapter addChapter(String name) {
|
public Chapter addChapter(String name) {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
Chapter c = new Chapter(uuid, name);
|
Chapter c = new Chapter(this, uuid, name);
|
||||||
add(c);
|
add(c);
|
||||||
c.setParentBook(this);
|
c.setParentBook(this);
|
||||||
return c;
|
return c;
|
||||||
@@ -276,7 +276,7 @@ public class Book extends BookTreeNode {
|
|||||||
|
|
||||||
public Chapter addChapter(String id, String name) {
|
public Chapter addChapter(String id, String name) {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
Chapter c = new Chapter(id, name);
|
Chapter c = new Chapter(this, id, name);
|
||||||
add(c);
|
add(c);
|
||||||
c.setParentBook(this);
|
c.setParentBook(this);
|
||||||
return c;
|
return c;
|
||||||
|
|||||||
@@ -34,10 +34,6 @@ public class Chain implements Effect {
|
|||||||
return "Chain to " + target;
|
return "Chain to " + target;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
System.out.println(toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(double sf) {
|
public void init(double sf) {
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
Effect t = AudiobookRecorder.window.getBook().effects.get(target);
|
Effect t = AudiobookRecorder.window.getBook().effects.get(target);
|
||||||
|
|||||||
@@ -54,15 +54,17 @@ public class Chapter extends BookTreeNode {
|
|||||||
String notes;
|
String notes;
|
||||||
Book parentBook = null;
|
Book parentBook = null;
|
||||||
|
|
||||||
public Chapter(String i, String chaptername) {
|
public Chapter(Book p, String i, String chaptername) {
|
||||||
super(chaptername);
|
super(chaptername);
|
||||||
|
parentBook = p;
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
id = i;
|
id = i;
|
||||||
name = chaptername;
|
name = chaptername;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Chapter(Element root, DefaultTreeModel model) {
|
public Chapter(Book p, Element root, DefaultTreeModel model) {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
|
parentBook = p;
|
||||||
name = Book.getTextNode(root, "name");
|
name = Book.getTextNode(root, "name");
|
||||||
id = root.getAttribute("id");
|
id = root.getAttribute("id");
|
||||||
|
|
||||||
@@ -73,13 +75,14 @@ public class Chapter extends BookTreeNode {
|
|||||||
|
|
||||||
for (int i = 0; i < sentences.getLength(); i++) {
|
for (int i = 0; i < sentences.getLength(); i++) {
|
||||||
Element sentenceElement = (Element)sentences.item(i);
|
Element sentenceElement = (Element)sentences.item(i);
|
||||||
Sentence newSentence = new Sentence(sentenceElement);
|
Sentence newSentence = new Sentence(parentBook, sentenceElement);
|
||||||
model.insertNodeInto(newSentence, this, getChildCount());
|
model.insertNodeInto(newSentence, this, getChildCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Chapter(Element root) {
|
public Chapter(Book p, Element root) {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
|
parentBook = p;
|
||||||
name = Book.getTextNode(root, "name");
|
name = Book.getTextNode(root, "name");
|
||||||
id = root.getAttribute("id");
|
id = root.getAttribute("id");
|
||||||
|
|
||||||
@@ -90,7 +93,7 @@ public class Chapter extends BookTreeNode {
|
|||||||
|
|
||||||
for (int i = 0; i < sentences.getLength(); i++) {
|
for (int i = 0; i < sentences.getLength(); i++) {
|
||||||
Element sentenceElement = (Element)sentences.item(i);
|
Element sentenceElement = (Element)sentences.item(i);
|
||||||
Sentence newSentence = new Sentence(sentenceElement);
|
Sentence newSentence = new Sentence(parentBook, sentenceElement);
|
||||||
add(newSentence);
|
add(newSentence);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,6 @@ public class Clipping implements Effect {
|
|||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
System.out.println(toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(double sf) {
|
public void init(double sf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,13 +72,6 @@ public class DelayLine implements Effect {
|
|||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
System.out.println(toString());
|
|
||||||
for (DelayLineStore s : delayLines) {
|
|
||||||
s.dump();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(double sf) {
|
public void init(double sf) {
|
||||||
for (DelayLineStore s : delayLines) {
|
for (DelayLineStore s : delayLines) {
|
||||||
s.init(sf);
|
s.init(sf);
|
||||||
|
|||||||
@@ -68,11 +68,4 @@ public class DelayLineStore {
|
|||||||
e.init(sf);
|
e.init(sf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
System.out.println(" Samples: " + numSamples + ", gain: " + gain);
|
|
||||||
for (Effect e : effects) {
|
|
||||||
e.dump();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ public interface Effect {
|
|||||||
public void process(double[][] samples);
|
public void process(double[][] samples);
|
||||||
public String getName();
|
public String getName();
|
||||||
public ArrayList<Effect> getChildEffects();
|
public ArrayList<Effect> getChildEffects();
|
||||||
public void dump();
|
|
||||||
public void init(double sr);
|
public void init(double sr);
|
||||||
public String toString();
|
public String toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,13 +58,6 @@ public class EffectGroup implements Effect {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
System.out.println(toString() + " >> ");
|
|
||||||
for (Effect e : effects) {
|
|
||||||
e.dump();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(double sf) {
|
public void init(double sf) {
|
||||||
for (Effect e : effects) {
|
for (Effect e : effects) {
|
||||||
e.init(sf);
|
e.init(sf);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public class FFT {
|
|||||||
double ld = Math.log(n) / Math.log(2.0);
|
double ld = Math.log(n) / Math.log(2.0);
|
||||||
|
|
||||||
if (((int) ld) - ld != 0) {
|
if (((int) ld) - ld != 0) {
|
||||||
System.out.println("The number of elements is not a power of 2.");
|
System.err.println("The number of elements is not a power of 2.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,10 +83,6 @@ public class LFO implements Effect {
|
|||||||
|
|
||||||
public ArrayList<Effect> getChildEffects() { return null; }
|
public ArrayList<Effect> getChildEffects() { return null; }
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
System.out.println(getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(double sr) {
|
public void init(double sr) {
|
||||||
sampleRate = sr;
|
sampleRate = sr;
|
||||||
|
|
||||||
|
|||||||
@@ -54,19 +54,8 @@ public class Options extends JDialog {
|
|||||||
JComboBox<KVPair> playbackBlockSize;
|
JComboBox<KVPair> playbackBlockSize;
|
||||||
JTextField storageFolder;
|
JTextField storageFolder;
|
||||||
JTextField archiveFolder;
|
JTextField archiveFolder;
|
||||||
JSpinner preChapterGap;
|
|
||||||
JSpinner postChapterGap;
|
|
||||||
JSpinner postSentenceGap;
|
|
||||||
JSpinner shortSentenceGap;
|
|
||||||
JSpinner postParagraphGap;
|
|
||||||
JSpinner postSectionGap;
|
|
||||||
JSpinner rmsLow;
|
|
||||||
JSpinner rmsHigh;
|
|
||||||
JCheckBox autoNormalize;
|
JCheckBox autoNormalize;
|
||||||
JTextField ffmpegLocation;
|
JTextField ffmpegLocation;
|
||||||
JComboBox<KVPair> bitRate;
|
|
||||||
JComboBox<KVPair> channels;
|
|
||||||
JComboBox<KVPair> exportRate;
|
|
||||||
JCheckBox enableParsing;
|
JCheckBox enableParsing;
|
||||||
JSpinner cacheSize;
|
JSpinner cacheSize;
|
||||||
|
|
||||||
@@ -363,8 +352,6 @@ public class Options extends JDialog {
|
|||||||
trimMethod = addDropdown(optionsPanel, "Auto-trim method:", getTrimMethods(), get("audio.recording.trim"), "None: don't auto-trim. FFT: Compare the FFT profile of blocks to the room noise profile and trim silent blocks, Peak: Look for the start and end rise and fall points");
|
trimMethod = addDropdown(optionsPanel, "Auto-trim method:", getTrimMethods(), get("audio.recording.trim"), "None: don't auto-trim. FFT: Compare the FFT profile of blocks to the room noise profile and trim silent blocks, Peak: Look for the start and end rise and fall points");
|
||||||
fftThreshold = addSpinner(optionsPanel, "FFT threshold:", 0, 100, 1, getInteger("audio.recording.trim.fft"), "", "This specifies the difference (in hundredths) between the power of FFT buckets in a sample block compared to the overall power of the same FFT bucket in the room noise. Raising this number makes the FFT trimming less sensitive.");
|
fftThreshold = addSpinner(optionsPanel, "FFT threshold:", 0, 100, 1, getInteger("audio.recording.trim.fft"), "", "This specifies the difference (in hundredths) between the power of FFT buckets in a sample block compared to the overall power of the same FFT bucket in the room noise. Raising this number makes the FFT trimming less sensitive.");
|
||||||
fftBlockSize = addDropdown(optionsPanel, "FFT Block size:", getFFTBlockSizes(), get("audio.recording.trim.blocksize"), "How large an FFT block should be when processing. Larger values increase sensitivity but at the epxense of resolution.");
|
fftBlockSize = addDropdown(optionsPanel, "FFT Block size:", getFFTBlockSizes(), get("audio.recording.trim.blocksize"), "How large an FFT block should be when processing. Larger values increase sensitivity but at the epxense of resolution.");
|
||||||
rmsLow = addSpinner(optionsPanel, "Target RMS (low):", -100, 0, 1, getInteger("audio.recording.rms.low"), "", "When normalizing this is the lowest target average RMS to aim for");
|
|
||||||
rmsHigh = addSpinner(optionsPanel, "Target RMS (high):", -100, 0, 1, getInteger("audio.recording.rms.high"), "", "When normalizing this is the highest target average RMS to aim for");
|
|
||||||
autoNormalize = addCheckBox(optionsPanel, "Enable automatic normalization", getBoolean("process.normalize"), "This will automatically normalize each phrase after recording");
|
autoNormalize = addCheckBox(optionsPanel, "Enable automatic normalization", getBoolean("process.normalize"), "This will automatically normalize each phrase after recording");
|
||||||
|
|
||||||
addSeparator(optionsPanel);
|
addSeparator(optionsPanel);
|
||||||
@@ -591,16 +578,7 @@ public class Options extends JDialog {
|
|||||||
defaultPrefs.put("audio.recording.trim.blocksize", "4096");
|
defaultPrefs.put("audio.recording.trim.blocksize", "4096");
|
||||||
defaultPrefs.put("audio.playback.blocksize", "4096");
|
defaultPrefs.put("audio.playback.blocksize", "4096");
|
||||||
|
|
||||||
defaultPrefs.put("catenation.pre-chapter", "1000");
|
|
||||||
defaultPrefs.put("catenation.post-chapter", "1500");
|
|
||||||
defaultPrefs.put("catenation.post-sentence", "1000");
|
|
||||||
defaultPrefs.put("catenation.short-sentence", "100");
|
|
||||||
defaultPrefs.put("catenation.post-paragraph", "2000");
|
|
||||||
defaultPrefs.put("catenation.post-section", "3000");
|
|
||||||
|
|
||||||
defaultPrefs.put("audio.recording.trim.fft", "10");
|
defaultPrefs.put("audio.recording.trim.fft", "10");
|
||||||
defaultPrefs.put("audio.recording.rms.low", "-22");
|
|
||||||
defaultPrefs.put("audio.recording.rms.high", "-20");
|
|
||||||
defaultPrefs.put("process.normalize", "true");
|
defaultPrefs.put("process.normalize", "true");
|
||||||
|
|
||||||
defaultPrefs.put("path.storage", (new File(System.getProperty("user.home"), "Recordings")).toString());
|
defaultPrefs.put("path.storage", (new File(System.getProperty("user.home"), "Recordings")).toString());
|
||||||
@@ -723,15 +701,6 @@ public class Options extends JDialog {
|
|||||||
set("path.storage", storageFolder.getText());
|
set("path.storage", storageFolder.getText());
|
||||||
set("path.archive", archiveFolder.getText());
|
set("path.archive", archiveFolder.getText());
|
||||||
set("path.ffmpeg", ffmpegLocation.getText());
|
set("path.ffmpeg", ffmpegLocation.getText());
|
||||||
set("catenation.pre-chapter", preChapterGap.getValue());
|
|
||||||
set("catenation.post-chapter", postChapterGap.getValue());
|
|
||||||
set("catenation.post-sentence", postSentenceGap.getValue());
|
|
||||||
set("catenation.short-sentence", shortSentenceGap.getValue());
|
|
||||||
set("catenation.post-paragraph", postParagraphGap.getValue());
|
|
||||||
set("catenation.post-section", postSectionGap.getValue());
|
|
||||||
if (bitRate.getSelectedItem() != null) set("audio.export.bitrate", ((KVPair)bitRate.getSelectedItem()).key);
|
|
||||||
if (channels.getSelectedItem() != null) set("audio.export.channels", ((KVPair)channels.getSelectedItem()).key);
|
|
||||||
if (exportRate.getSelectedItem() != null) set("audio.export.samplerate", ((KVPair)exportRate.getSelectedItem()).key);
|
|
||||||
set("narrator.name", narratorName.getText());
|
set("narrator.name", narratorName.getText());
|
||||||
set("narrator.initials", narratorInitials.getText());
|
set("narrator.initials", narratorInitials.getText());
|
||||||
set("process.sphinx", enableParsing.isSelected());
|
set("process.sphinx", enableParsing.isSelected());
|
||||||
@@ -740,8 +709,6 @@ public class Options extends JDialog {
|
|||||||
set("editor.external", externalEditor.getText());
|
set("editor.external", externalEditor.getText());
|
||||||
set("cache.size", cacheSize.getValue());
|
set("cache.size", cacheSize.getValue());
|
||||||
set("audio.recording.trim.fft", fftThreshold.getValue());
|
set("audio.recording.trim.fft", fftThreshold.getValue());
|
||||||
set("audio.recording.rms.low", rmsLow.getValue());
|
|
||||||
set("audio.recording.rms.high", rmsHigh.getValue());
|
|
||||||
set("process.normalize", autoNormalize.isSelected());
|
set("process.normalize", autoNormalize.isSelected());
|
||||||
if (fftBlockSize.getSelectedItem() != null) set("audio.recording.trim.blocksize", ((KVPair)fftBlockSize.getSelectedItem()).key);
|
if (fftBlockSize.getSelectedItem() != null) set("audio.recording.trim.blocksize", ((KVPair)fftBlockSize.getSelectedItem()).key);
|
||||||
if (playbackBlockSize.getSelectedItem() != null) set("audio.playback.blocksize", ((KVPair)playbackBlockSize.getSelectedItem()).key);
|
if (playbackBlockSize.getSelectedItem() != null) set("audio.playback.blocksize", ((KVPair)playbackBlockSize.getSelectedItem()).key);
|
||||||
|
|||||||
@@ -43,10 +43,6 @@ public class Pan implements Effect {
|
|||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump() {
|
|
||||||
System.out.println(toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(double sf) {
|
public void init(double sf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,25 +192,28 @@ public class Sentence extends BookTreeNode implements Cacheable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sentence() {
|
public Sentence(Book p) {
|
||||||
super("");
|
super("");
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
|
parentBook = p;
|
||||||
id = UUID.randomUUID().toString();
|
id = UUID.randomUUID().toString();
|
||||||
text = id;
|
text = id;
|
||||||
setUserObject(text);
|
setUserObject(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sentence(String i, String t) {
|
public Sentence(Book p, String i, String t) {
|
||||||
super("");
|
super("");
|
||||||
|
parentBook = p;
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
id = i;
|
id = i;
|
||||||
text = t;
|
text = t;
|
||||||
setUserObject(text);
|
setUserObject(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sentence(Element root) {
|
public Sentence(Book p, Element root) {
|
||||||
super("");
|
super("");
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
|
parentBook = p;
|
||||||
id = root.getAttribute("id");
|
id = root.getAttribute("id");
|
||||||
text = Book.getTextNode(root, "text");
|
text = Book.getTextNode(root, "text");
|
||||||
notes = Book.getTextNode(root, "notes");
|
notes = Book.getTextNode(root, "notes");
|
||||||
@@ -896,7 +899,7 @@ public class Sentence extends BookTreeNode implements Cacheable {
|
|||||||
|
|
||||||
public Sentence cloneSentence() throws IOException {
|
public Sentence cloneSentence() throws IOException {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
Sentence sentence = new Sentence();
|
Sentence sentence = new Sentence(getBook());
|
||||||
sentence.setParentBook(getBook());
|
sentence.setParentBook(getBook());
|
||||||
sentence.setPostGap(getPostGap());
|
sentence.setPostGap(getPostGap());
|
||||||
if (!id.equals(text)) {
|
if (!id.equals(text)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user