From 3e84798d88cccaaeacfa4c596e61b098e5ac75ba Mon Sep 17 00:00:00 2001 From: Matt Jenkins Date: Sun, 7 Apr 2024 13:04:16 +0100 Subject: [PATCH] Clean up stdout noise --- src/com/jtattoo/plaf/AbstractTheme.java | 4 +- src/com/jtattoo/plaf/LazyImageIcon.java | 2 +- .../jtattoo/plaf/LazyMenuArrowImageIcon.java | 4 +- src/uk/co/majenko/audiobookrecorder/AGC.java | 5 --- .../majenko/audiobookrecorder/Amplifier.java | 5 --- .../audiobookrecorder/AudiobookRecorder.java | 43 ++++++++----------- .../co/majenko/audiobookrecorder/Biquad.java | 4 -- src/uk/co/majenko/audiobookrecorder/Book.java | 16 +++---- .../co/majenko/audiobookrecorder/Chain.java | 4 -- .../co/majenko/audiobookrecorder/Chapter.java | 13 +++--- .../majenko/audiobookrecorder/Clipping.java | 4 -- .../majenko/audiobookrecorder/DelayLine.java | 7 --- .../audiobookrecorder/DelayLineStore.java | 7 --- .../co/majenko/audiobookrecorder/Effect.java | 1 - .../audiobookrecorder/EffectGroup.java | 7 --- src/uk/co/majenko/audiobookrecorder/FFT.java | 2 +- src/uk/co/majenko/audiobookrecorder/LFO.java | 4 -- .../co/majenko/audiobookrecorder/Options.java | 33 -------------- src/uk/co/majenko/audiobookrecorder/Pan.java | 4 -- .../majenko/audiobookrecorder/Sentence.java | 11 +++-- 20 files changed, 46 insertions(+), 134 deletions(-) diff --git a/src/com/jtattoo/plaf/AbstractTheme.java b/src/com/jtattoo/plaf/AbstractTheme.java index bb2b990..9fc5734 100644 --- a/src/com/jtattoo/plaf/AbstractTheme.java +++ b/src/com/jtattoo/plaf/AbstractTheme.java @@ -760,7 +760,7 @@ public abstract class AbstractTheme extends MetalTheme { b = Integer.parseInt(colorProp.substring(p2 + 1)); return new ColorUIResource(r, g, b); } catch (Exception ex) { - System.out.println("Exception while parsing color: " + colorProp); + System.err.println("Exception while parsing color: " + colorProp); } } return color; @@ -771,7 +771,7 @@ public abstract class AbstractTheme extends MetalTheme { try { val = Integer.parseInt(intProp); } catch (Exception ex) { - System.out.println("Exception while parsing color: " + intProp); + System.err.println("Exception while parsing color: " + intProp); } return val; } diff --git a/src/com/jtattoo/plaf/LazyImageIcon.java b/src/com/jtattoo/plaf/LazyImageIcon.java index fd20a79..3ec4425 100644 --- a/src/com/jtattoo/plaf/LazyImageIcon.java +++ b/src/com/jtattoo/plaf/LazyImageIcon.java @@ -45,7 +45,7 @@ public class LazyImageIcon implements Icon { try { icon = new ImageIcon(LazyImageIcon.class.getResource(name)); } catch (Throwable t) { - System.out.println("ERROR: loading image " + name + " failed!"); + System.err.println("ERROR: loading image " + name + " failed!"); } } return icon; diff --git a/src/com/jtattoo/plaf/LazyMenuArrowImageIcon.java b/src/com/jtattoo/plaf/LazyMenuArrowImageIcon.java index ec5bd0d..d948d8d 100644 --- a/src/com/jtattoo/plaf/LazyMenuArrowImageIcon.java +++ b/src/com/jtattoo/plaf/LazyMenuArrowImageIcon.java @@ -48,7 +48,7 @@ public class LazyMenuArrowImageIcon implements Icon { try { leftToRightIcon = new ImageIcon(LazyMenuArrowImageIcon.class.getResource(leftToRightName)); } catch (Throwable t) { - System.out.println("ERROR: loading image " + leftToRightName + " failed!"); + System.err.println("ERROR: loading image " + leftToRightName + " failed!"); } } return leftToRightIcon; @@ -59,7 +59,7 @@ public class LazyMenuArrowImageIcon implements Icon { try { rightToLeftIcon = new ImageIcon(LazyMenuArrowImageIcon.class.getResource(rightToLefttName)); } catch (Throwable t) { - System.out.println("ERROR: loading image " + rightToLefttName + " failed!"); + System.err.println("ERROR: loading image " + rightToLefttName + " failed!"); } } return rightToLeftIcon; diff --git a/src/uk/co/majenko/audiobookrecorder/AGC.java b/src/uk/co/majenko/audiobookrecorder/AGC.java index e2081ac..b1532ed 100644 --- a/src/uk/co/majenko/audiobookrecorder/AGC.java +++ b/src/uk/co/majenko/audiobookrecorder/AGC.java @@ -63,11 +63,6 @@ public class AGC implements Effect { gain = 1d; } - public void dump() { - Debug.trace(); - System.out.println(toString()); - } - public ArrayList getChildEffects() { Debug.trace(); return null; diff --git a/src/uk/co/majenko/audiobookrecorder/Amplifier.java b/src/uk/co/majenko/audiobookrecorder/Amplifier.java index 47b2e74..5f3059c 100644 --- a/src/uk/co/majenko/audiobookrecorder/Amplifier.java +++ b/src/uk/co/majenko/audiobookrecorder/Amplifier.java @@ -46,11 +46,6 @@ public class Amplifier implements Effect { return getName(); } - public void dump() { - Debug.trace(); - System.out.println(toString()); - } - public void init(double sf) { Debug.trace(); } diff --git a/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java b/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java index 2ad2751..1ea0ff6 100644 --- a/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java +++ b/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java @@ -1104,10 +1104,10 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { newbook.setComment(info.getComment().trim()); newbook.setACX(info.getACX().trim()); - Chapter caud = new Chapter("audition", "Audition"); - Chapter copen = new Chapter("open", "Opening Credits"); - Chapter cclose = new Chapter("close", "Closing Credits"); - Chapter cone = new Chapter(UUID.randomUUID().toString(), "Chapter 1"); + Chapter caud = new Chapter(newbook, "audition", "Audition"); + Chapter copen = new Chapter(newbook, "open", "Opening Credits"); + Chapter cclose = new Chapter(newbook, "close", "Closing Credits"); + Chapter cone = new Chapter(newbook, UUID.randomUUID().toString(), "Chapter 1"); newbook.add(caud); newbook.add(copen); @@ -1345,7 +1345,8 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { JMenuObject o = (JMenuObject)e.getSource(); Sentence s = (Sentence)o.getObject(); Chapter c = (Chapter)s.getParent(); - Sentence newSentence = new Sentence(); + Book b = c.getBook(); + Sentence newSentence = new Sentence(b); int where = bookTreeModel.getIndexOfChild(c, s); bookTreeModel.insertNodeInto(newSentence, c, where); bookTreeModel.reload(newSentence); @@ -1358,7 +1359,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { JMenuObject o = (JMenuObject)e.getSource(); Sentence s = (Sentence)o.getObject(); Chapter c = (Chapter)s.getParent(); - Sentence newSentence = new Sentence(); + Sentence newSentence = new Sentence(c.getBook()); int where = bookTreeModel.getIndexOfChild(c, s); bookTreeModel.insertNodeInto(newSentence, c, where + 1); bookTreeModel.reload(newSentence); @@ -2001,8 +2002,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { lastSentence.setPostGapType("continuation"); } - Sentence s = new Sentence(); - s.setParentBook(getBook()); + Sentence s = new Sentence(getBook()); bookTreeModel.insertNodeInto(s, c, c.getChildCount()); bookTree.expandPath(new TreePath(c.getPath())); @@ -2053,8 +2053,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { lastSentence.setPostGapType("paragraph"); } - Sentence s = new Sentence(); - s.setParentBook(getBook()); + Sentence s = new Sentence(getBook()); bookTreeModel.insertNodeInto(s, c, c.getChildCount()); bookTree.expandPath(new TreePath(c.getPath())); @@ -2104,8 +2103,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { lastSentence.setPostGapType("section"); } - Sentence s = new Sentence(); - s.setParentBook(getBook()); + Sentence s = new Sentence(getBook()); bookTreeModel.insertNodeInto(s, c, c.getChildCount()); bookTree.expandPath(new TreePath(c.getPath())); @@ -2155,8 +2153,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { lastSentence.setPostGapType("sentence"); } - Sentence s = new Sentence(); - s.setParentBook(getBook()); + Sentence s = new Sentence(getBook()); bookTreeModel.insertNodeInto(s, c, c.getChildCount()); 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) { - 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++) { String sid = data.getProperty(String.format("chapter." + name + ".sentence.%08d.id", 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))); if (sid == null) break; - Sentence s = new Sentence(sid, text); + Sentence s = new Sentence(c.getBook(), sid, text); s.setPostGap(gap); 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)))); @@ -2435,15 +2432,12 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { sampleWaveform.setPlayMarker(pos / format.getFrameSize()); int l = data.length - pos; if (l > blockSize) l = blockSize; - System.out.println(play.write(data, pos, l)); } - System.out.println("Closing..."); play.drain(); play.stop(); play.close(); play = null; - System.out.println("Closed"); playing = null; } catch (Exception e) { e.printStackTrace(); @@ -2691,10 +2685,8 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { public void stopPlaying() { Debug.trace(); if (play != null) { - System.out.println("Forcing close"); play.close(); play = null; - System.out.println("Closed!!!"); } playing = null; } @@ -2785,8 +2777,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { Chapter fc = (Chapter)from.getFirstChild(); Chapter tc = findChapter(to, fc.getId(), fc.getName()); if (tc == null) { - tc = new Chapter(fc.getId(), fc.getName()); - tc.setParentBook(to); + tc = new Chapter(to, fc.getId(), fc.getName()); to.add(tc); } moveSentences(fc, tc); @@ -3434,7 +3425,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { public void findOrphans(Book book) { Chapter orphans = book.getChapterById("orphans"); if (orphans == null) { - orphans = new Chapter("orphans", "Orphan Files"); + orphans = new Chapter(book, "orphans", "Orphan Files"); orphans.setParentBook(book); book.add(orphans); } @@ -3449,7 +3440,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { String id = filename.substring(0, filename.length() - 4); Debug.d("Testing orphanicity of", id); if (!sentenceIdExists(book, id)) { - Sentence newSentence = new Sentence(id, id); + Sentence newSentence = new Sentence(book, id, id); newSentence.setParentBook(book); orphans.add(newSentence); } @@ -3644,7 +3635,7 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { Book book = c.getBook(); AudioFormat targetFormat = book.getAudioFormat(); - Sentence newSentence = new Sentence(); + Sentence newSentence = new Sentence(book); newSentence.setText(f.getName()); newSentence.setParentBook(book); c.add(newSentence); diff --git a/src/uk/co/majenko/audiobookrecorder/Biquad.java b/src/uk/co/majenko/audiobookrecorder/Biquad.java index e72499b..993b23b 100644 --- a/src/uk/co/majenko/audiobookrecorder/Biquad.java +++ b/src/uk/co/majenko/audiobookrecorder/Biquad.java @@ -259,8 +259,4 @@ public class Biquad implements Effect { return getName(); } - public void dump() { - Debug.trace(); - System.out.println(toString()); - } } diff --git a/src/uk/co/majenko/audiobookrecorder/Book.java b/src/uk/co/majenko/audiobookrecorder/Book.java index 93ac82c..02252fe 100644 --- a/src/uk/co/majenko/audiobookrecorder/Book.java +++ b/src/uk/co/majenko/audiobookrecorder/Book.java @@ -64,7 +64,7 @@ public class Book extends BookTreeNode { location = new File(Options.get("path.storage"), sanitize(name)); AudiobookRecorder.window.setTitle("AudioBook Recorder :: " + name); // This should be in the load routine!!!! setIcon(Icons.book); - roomNoise = new Sentence("room-noise", "Room Noise"); + roomNoise = new Sentence(this, "room-noise", "Room Noise"); roomNoise.setParentBook(this); loadEffects(); } @@ -118,14 +118,14 @@ public class Book extends BookTreeNode { setIcon(Icons.book); } - roomNoise = new Sentence("room-noise", "Room Noise"); + roomNoise = new Sentence(this, "room-noise", "Room Noise"); roomNoise.setParentBook(this); Element chapters = getNode(root, "chapters"); NodeList chapterList = chapters.getElementsByTagName("chapter"); for (int i = 0; i < chapterList.getLength(); i++) { Element chapterElement = (Element)chapterList.item(i); - Chapter newChapter = new Chapter(chapterElement); + Chapter newChapter = new Chapter(this, chapterElement); newChapter.setParentBook(this); add(newChapter); } @@ -160,12 +160,12 @@ public class Book extends BookTreeNode { NodeList chapterList = chapters.getElementsByTagName("chapter"); - roomNoise = new Sentence("room-noise", "Room Noise"); + roomNoise = new Sentence(this, "room-noise", "Room Noise"); roomNoise.setParentBook(this); for (int i = 0; i < chapterList.getLength(); 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()); } } @@ -259,7 +259,7 @@ public class Book extends BookTreeNode { public Chapter addChapter() { Debug.trace(); String uuid = UUID.randomUUID().toString(); - Chapter c = new Chapter(uuid, uuid); + Chapter c = new Chapter(this, uuid, uuid); add(c); c.setParentBook(this); return c; @@ -268,7 +268,7 @@ public class Book extends BookTreeNode { public Chapter addChapter(String name) { Debug.trace(); String uuid = UUID.randomUUID().toString(); - Chapter c = new Chapter(uuid, name); + Chapter c = new Chapter(this, uuid, name); add(c); c.setParentBook(this); return c; @@ -276,7 +276,7 @@ public class Book extends BookTreeNode { public Chapter addChapter(String id, String name) { Debug.trace(); - Chapter c = new Chapter(id, name); + Chapter c = new Chapter(this, id, name); add(c); c.setParentBook(this); return c; diff --git a/src/uk/co/majenko/audiobookrecorder/Chain.java b/src/uk/co/majenko/audiobookrecorder/Chain.java index b4cb0e4..9c48663 100644 --- a/src/uk/co/majenko/audiobookrecorder/Chain.java +++ b/src/uk/co/majenko/audiobookrecorder/Chain.java @@ -34,10 +34,6 @@ public class Chain implements Effect { return "Chain to " + target; } - public void dump() { - System.out.println(toString()); - } - public void init(double sf) { if (target != null) { Effect t = AudiobookRecorder.window.getBook().effects.get(target); diff --git a/src/uk/co/majenko/audiobookrecorder/Chapter.java b/src/uk/co/majenko/audiobookrecorder/Chapter.java index 5adec94..dfcc8c1 100644 --- a/src/uk/co/majenko/audiobookrecorder/Chapter.java +++ b/src/uk/co/majenko/audiobookrecorder/Chapter.java @@ -54,15 +54,17 @@ public class Chapter extends BookTreeNode { String notes; Book parentBook = null; - public Chapter(String i, String chaptername) { + public Chapter(Book p, String i, String chaptername) { super(chaptername); + parentBook = p; Debug.trace(); id = i; name = chaptername; } - public Chapter(Element root, DefaultTreeModel model) { + public Chapter(Book p, Element root, DefaultTreeModel model) { Debug.trace(); + parentBook = p; name = Book.getTextNode(root, "name"); id = root.getAttribute("id"); @@ -73,13 +75,14 @@ public class Chapter extends BookTreeNode { for (int i = 0; i < sentences.getLength(); i++) { Element sentenceElement = (Element)sentences.item(i); - Sentence newSentence = new Sentence(sentenceElement); + Sentence newSentence = new Sentence(parentBook, sentenceElement); model.insertNodeInto(newSentence, this, getChildCount()); } } - public Chapter(Element root) { + public Chapter(Book p, Element root) { Debug.trace(); + parentBook = p; name = Book.getTextNode(root, "name"); id = root.getAttribute("id"); @@ -90,7 +93,7 @@ public class Chapter extends BookTreeNode { for (int i = 0; i < sentences.getLength(); i++) { Element sentenceElement = (Element)sentences.item(i); - Sentence newSentence = new Sentence(sentenceElement); + Sentence newSentence = new Sentence(parentBook, sentenceElement); add(newSentence); } } diff --git a/src/uk/co/majenko/audiobookrecorder/Clipping.java b/src/uk/co/majenko/audiobookrecorder/Clipping.java index 3a6d843..6b576c2 100644 --- a/src/uk/co/majenko/audiobookrecorder/Clipping.java +++ b/src/uk/co/majenko/audiobookrecorder/Clipping.java @@ -40,10 +40,6 @@ public class Clipping implements Effect { return getName(); } - public void dump() { - System.out.println(toString()); - } - public void init(double sf) { } } diff --git a/src/uk/co/majenko/audiobookrecorder/DelayLine.java b/src/uk/co/majenko/audiobookrecorder/DelayLine.java index 254cba6..0180eb1 100644 --- a/src/uk/co/majenko/audiobookrecorder/DelayLine.java +++ b/src/uk/co/majenko/audiobookrecorder/DelayLine.java @@ -72,13 +72,6 @@ public class DelayLine implements Effect { return getName(); } - public void dump() { - System.out.println(toString()); - for (DelayLineStore s : delayLines) { - s.dump(); - } - } - public void init(double sf) { for (DelayLineStore s : delayLines) { s.init(sf); diff --git a/src/uk/co/majenko/audiobookrecorder/DelayLineStore.java b/src/uk/co/majenko/audiobookrecorder/DelayLineStore.java index 09b6d83..3e36668 100644 --- a/src/uk/co/majenko/audiobookrecorder/DelayLineStore.java +++ b/src/uk/co/majenko/audiobookrecorder/DelayLineStore.java @@ -68,11 +68,4 @@ public class DelayLineStore { e.init(sf); } } - - public void dump() { - System.out.println(" Samples: " + numSamples + ", gain: " + gain); - for (Effect e : effects) { - e.dump(); - } - } } diff --git a/src/uk/co/majenko/audiobookrecorder/Effect.java b/src/uk/co/majenko/audiobookrecorder/Effect.java index e4aee61..c3bce52 100644 --- a/src/uk/co/majenko/audiobookrecorder/Effect.java +++ b/src/uk/co/majenko/audiobookrecorder/Effect.java @@ -6,7 +6,6 @@ public interface Effect { public void process(double[][] samples); public String getName(); public ArrayList getChildEffects(); - public void dump(); public void init(double sr); public String toString(); } diff --git a/src/uk/co/majenko/audiobookrecorder/EffectGroup.java b/src/uk/co/majenko/audiobookrecorder/EffectGroup.java index e909129..791ff10 100644 --- a/src/uk/co/majenko/audiobookrecorder/EffectGroup.java +++ b/src/uk/co/majenko/audiobookrecorder/EffectGroup.java @@ -58,13 +58,6 @@ public class EffectGroup implements Effect { return name; } - public void dump() { - System.out.println(toString() + " >> "); - for (Effect e : effects) { - e.dump(); - } - } - public void init(double sf) { for (Effect e : effects) { e.init(sf); diff --git a/src/uk/co/majenko/audiobookrecorder/FFT.java b/src/uk/co/majenko/audiobookrecorder/FFT.java index 5f7c3ee..768c5c5 100644 --- a/src/uk/co/majenko/audiobookrecorder/FFT.java +++ b/src/uk/co/majenko/audiobookrecorder/FFT.java @@ -7,7 +7,7 @@ public class FFT { double ld = Math.log(n) / Math.log(2.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; } diff --git a/src/uk/co/majenko/audiobookrecorder/LFO.java b/src/uk/co/majenko/audiobookrecorder/LFO.java index b6ccc8e..dfc5782 100644 --- a/src/uk/co/majenko/audiobookrecorder/LFO.java +++ b/src/uk/co/majenko/audiobookrecorder/LFO.java @@ -83,10 +83,6 @@ public class LFO implements Effect { public ArrayList getChildEffects() { return null; } - public void dump() { - System.out.println(getName()); - } - public void init(double sr) { sampleRate = sr; diff --git a/src/uk/co/majenko/audiobookrecorder/Options.java b/src/uk/co/majenko/audiobookrecorder/Options.java index 2d2e2ab..7db4972 100644 --- a/src/uk/co/majenko/audiobookrecorder/Options.java +++ b/src/uk/co/majenko/audiobookrecorder/Options.java @@ -54,19 +54,8 @@ public class Options extends JDialog { JComboBox playbackBlockSize; JTextField storageFolder; JTextField archiveFolder; - JSpinner preChapterGap; - JSpinner postChapterGap; - JSpinner postSentenceGap; - JSpinner shortSentenceGap; - JSpinner postParagraphGap; - JSpinner postSectionGap; - JSpinner rmsLow; - JSpinner rmsHigh; JCheckBox autoNormalize; JTextField ffmpegLocation; - JComboBox bitRate; - JComboBox channels; - JComboBox exportRate; JCheckBox enableParsing; 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"); 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."); - 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"); addSeparator(optionsPanel); @@ -591,16 +578,7 @@ public class Options extends JDialog { defaultPrefs.put("audio.recording.trim.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.rms.low", "-22"); - defaultPrefs.put("audio.recording.rms.high", "-20"); defaultPrefs.put("process.normalize", "true"); 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.archive", archiveFolder.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.initials", narratorInitials.getText()); set("process.sphinx", enableParsing.isSelected()); @@ -740,8 +709,6 @@ public class Options extends JDialog { set("editor.external", externalEditor.getText()); set("cache.size", cacheSize.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()); 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); diff --git a/src/uk/co/majenko/audiobookrecorder/Pan.java b/src/uk/co/majenko/audiobookrecorder/Pan.java index 2a81c65..adb5bd8 100644 --- a/src/uk/co/majenko/audiobookrecorder/Pan.java +++ b/src/uk/co/majenko/audiobookrecorder/Pan.java @@ -43,10 +43,6 @@ public class Pan implements Effect { return getName(); } - public void dump() { - System.out.println(toString()); - } - public void init(double sf) { } } diff --git a/src/uk/co/majenko/audiobookrecorder/Sentence.java b/src/uk/co/majenko/audiobookrecorder/Sentence.java index 6d4f35f..b94d54b 100644 --- a/src/uk/co/majenko/audiobookrecorder/Sentence.java +++ b/src/uk/co/majenko/audiobookrecorder/Sentence.java @@ -192,25 +192,28 @@ public class Sentence extends BookTreeNode implements Cacheable { } } - public Sentence() { + public Sentence(Book p) { super(""); Debug.trace(); + parentBook = p; id = UUID.randomUUID().toString(); text = id; setUserObject(text); } - public Sentence(String i, String t) { + public Sentence(Book p, String i, String t) { super(""); + parentBook = p; Debug.trace(); id = i; text = t; setUserObject(text); } - public Sentence(Element root) { + public Sentence(Book p, Element root) { super(""); Debug.trace(); + parentBook = p; id = root.getAttribute("id"); text = Book.getTextNode(root, "text"); notes = Book.getTextNode(root, "notes"); @@ -896,7 +899,7 @@ public class Sentence extends BookTreeNode implements Cacheable { public Sentence cloneSentence() throws IOException { Debug.trace(); - Sentence sentence = new Sentence(); + Sentence sentence = new Sentence(getBook()); sentence.setParentBook(getBook()); sentence.setPostGap(getPostGap()); if (!id.equals(text)) {