Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4896ee7a65 | |||
| ce3eb7165a | |||
| 4de00b8fac |
@@ -1 +1 @@
|
|||||||
version=0.3.2
|
version=0.3.3
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package uk.co.majenko.audiobookrecorder;
|
|||||||
import javax.sound.sampled.*;
|
import javax.sound.sampled.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.*;
|
import javax.swing.event.*;
|
||||||
|
import javax.swing.text.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
@@ -32,6 +33,7 @@ import javax.xml.transform.Transformer;
|
|||||||
import javax.xml.transform.TransformerFactory;
|
import javax.xml.transform.TransformerFactory;
|
||||||
import javax.xml.transform.dom.DOMSource;
|
import javax.xml.transform.dom.DOMSource;
|
||||||
import javax.xml.transform.stream.StreamResult;
|
import javax.xml.transform.stream.StreamResult;
|
||||||
|
import javax.xml.transform.OutputKeys;
|
||||||
import org.w3c.dom.Attr;
|
import org.w3c.dom.Attr;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
@@ -39,7 +41,7 @@ import org.w3c.dom.Element;
|
|||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
|
|
||||||
public class AudiobookRecorder extends JFrame {
|
public class AudiobookRecorder extends JFrame implements DocumentListener {
|
||||||
|
|
||||||
// Settings - tweakable
|
// Settings - tweakable
|
||||||
|
|
||||||
@@ -105,8 +107,17 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
public Waveform sampleWaveform;
|
public Waveform sampleWaveform;
|
||||||
JScrollBar sampleScroll;
|
JScrollBar sampleScroll;
|
||||||
JSplitPane mainSplit;
|
JSplitPane mainSplit;
|
||||||
JTextArea notesArea;
|
|
||||||
JScrollPane notesScroll;
|
JTabbedPane notesTabs;
|
||||||
|
|
||||||
|
JTextArea bookNotesArea;
|
||||||
|
JScrollPane bookNotesScroll;
|
||||||
|
|
||||||
|
JTextArea chapterNotesArea;
|
||||||
|
JScrollPane chapterNotesScroll;
|
||||||
|
|
||||||
|
JTextArea sentenceNotesArea;
|
||||||
|
JScrollPane sentenceNotesScroll;
|
||||||
|
|
||||||
JSpinner postSentenceGap;
|
JSpinner postSentenceGap;
|
||||||
JSpinner gainPercent;
|
JSpinner gainPercent;
|
||||||
@@ -640,10 +651,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
centralPanel.getActionMap().put("startRecord", new AbstractAction() {
|
centralPanel.getActionMap().put("startRecord", new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (!getLock()) return;
|
if (!getLock()) return;
|
||||||
if (getFocusOwner() == notesArea) {
|
if (getFocusOwner() == bookNotesArea) { freeLock(); return; }
|
||||||
freeLock();
|
if (getFocusOwner() == chapterNotesArea) { freeLock(); return; }
|
||||||
return;
|
if (getFocusOwner() == sentenceNotesArea) { freeLock(); return; }
|
||||||
}
|
|
||||||
if (bookTree.isEditing()) {
|
if (bookTree.isEditing()) {
|
||||||
freeLock();
|
freeLock();
|
||||||
return;
|
return;
|
||||||
@@ -659,10 +669,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
centralPanel.getActionMap().put("startRecordShort", new AbstractAction() {
|
centralPanel.getActionMap().put("startRecordShort", new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (!getLock()) return;
|
if (!getLock()) return;
|
||||||
if (getFocusOwner() == notesArea) {
|
if (getFocusOwner() == bookNotesArea) { freeLock(); return; }
|
||||||
freeLock();
|
if (getFocusOwner() == chapterNotesArea) { freeLock(); return; }
|
||||||
return;
|
if (getFocusOwner() == sentenceNotesArea) { freeLock(); return; }
|
||||||
}
|
|
||||||
if (bookTree.isEditing()) {
|
if (bookTree.isEditing()) {
|
||||||
freeLock();
|
freeLock();
|
||||||
return;
|
return;
|
||||||
@@ -678,10 +687,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
centralPanel.getActionMap().put("startRecordNewPara", new AbstractAction() {
|
centralPanel.getActionMap().put("startRecordNewPara", new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (!getLock()) return;
|
if (!getLock()) return;
|
||||||
if (getFocusOwner() == notesArea) {
|
if (getFocusOwner() == bookNotesArea) { freeLock(); return; }
|
||||||
freeLock();
|
if (getFocusOwner() == chapterNotesArea) { freeLock(); return; }
|
||||||
return;
|
if (getFocusOwner() == sentenceNotesArea) { freeLock(); return; }
|
||||||
}
|
|
||||||
if (bookTree.isEditing()) {
|
if (bookTree.isEditing()) {
|
||||||
freeLock();
|
freeLock();
|
||||||
return;
|
return;
|
||||||
@@ -697,10 +705,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
centralPanel.getActionMap().put("startRecordNewSection", new AbstractAction() {
|
centralPanel.getActionMap().put("startRecordNewSection", new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (!getLock()) return;
|
if (!getLock()) return;
|
||||||
if (getFocusOwner() == notesArea) {
|
if (getFocusOwner() == bookNotesArea) { freeLock(); return; }
|
||||||
freeLock();
|
if (getFocusOwner() == chapterNotesArea) { freeLock(); return; }
|
||||||
return;
|
if (getFocusOwner() == sentenceNotesArea) { freeLock(); return; }
|
||||||
}
|
|
||||||
if (bookTree.isEditing()) {
|
if (bookTree.isEditing()) {
|
||||||
freeLock();
|
freeLock();
|
||||||
return;
|
return;
|
||||||
@@ -716,10 +723,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
centralPanel.getActionMap().put("startRerecord", new AbstractAction() {
|
centralPanel.getActionMap().put("startRerecord", new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (!getLock()) return;
|
if (!getLock()) return;
|
||||||
if (getFocusOwner() == notesArea) {
|
if (getFocusOwner() == bookNotesArea) { freeLock(); return; }
|
||||||
freeLock();
|
if (getFocusOwner() == chapterNotesArea) { freeLock(); return; }
|
||||||
return;
|
if (getFocusOwner() == sentenceNotesArea) { freeLock(); return; }
|
||||||
}
|
|
||||||
if (bookTree.isEditing()) {
|
if (bookTree.isEditing()) {
|
||||||
freeLock();
|
freeLock();
|
||||||
return;
|
return;
|
||||||
@@ -734,9 +740,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
});
|
});
|
||||||
centralPanel.getActionMap().put("stopRecord", new AbstractAction() {
|
centralPanel.getActionMap().put("stopRecord", new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (getFocusOwner() == notesArea) {
|
if (getFocusOwner() == bookNotesArea) { return; }
|
||||||
return;
|
if (getFocusOwner() == chapterNotesArea) { return; }
|
||||||
}
|
if (getFocusOwner() == sentenceNotesArea) { return; }
|
||||||
if (bookTree.isEditing()) return;
|
if (bookTree.isEditing()) return;
|
||||||
stopLock();
|
stopLock();
|
||||||
stopRecording();
|
stopRecording();
|
||||||
@@ -745,9 +751,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
});
|
});
|
||||||
centralPanel.getActionMap().put("deleteLast", new AbstractAction() {
|
centralPanel.getActionMap().put("deleteLast", new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (getFocusOwner() == notesArea) {
|
if (getFocusOwner() == bookNotesArea) { return; }
|
||||||
return;
|
if (getFocusOwner() == chapterNotesArea) { return; }
|
||||||
}
|
if (getFocusOwner() == sentenceNotesArea) { return; }
|
||||||
if (bookTree.isEditing()) return;
|
if (bookTree.isEditing()) return;
|
||||||
deleteLastRecording();
|
deleteLastRecording();
|
||||||
}
|
}
|
||||||
@@ -755,9 +761,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
|
|
||||||
centralPanel.getActionMap().put("startStopPlayback", new AbstractAction() {
|
centralPanel.getActionMap().put("startStopPlayback", new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (getFocusOwner() == notesArea) {
|
if (getFocusOwner() == bookNotesArea) { return; }
|
||||||
return;
|
if (getFocusOwner() == chapterNotesArea) { return; }
|
||||||
}
|
if (getFocusOwner() == sentenceNotesArea) { return; }
|
||||||
if (bookTree.isEditing()) return;
|
if (bookTree.isEditing()) return;
|
||||||
if (playing == null) {
|
if (playing == null) {
|
||||||
playSelectedSentence();
|
playSelectedSentence();
|
||||||
@@ -769,9 +775,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
|
|
||||||
centralPanel.getActionMap().put("startPlaybackFrom", new AbstractAction() {
|
centralPanel.getActionMap().put("startPlaybackFrom", new AbstractAction() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
if (getFocusOwner() == notesArea) {
|
if (getFocusOwner() == bookNotesArea) { return; }
|
||||||
return;
|
if (getFocusOwner() == chapterNotesArea) { return; }
|
||||||
}
|
if (getFocusOwner() == sentenceNotesArea) { return; }
|
||||||
if (bookTree.isEditing()) return;
|
if (bookTree.isEditing()) return;
|
||||||
if (playing == null) {
|
if (playing == null) {
|
||||||
playFromSelectedSentence();
|
playFromSelectedSentence();
|
||||||
@@ -781,12 +787,30 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
|
|
||||||
mainScroll = new JScrollPane();
|
mainScroll = new JScrollPane();
|
||||||
|
|
||||||
notesArea = new JTextArea();
|
bookNotesArea = new JTextArea();
|
||||||
notesArea.setFont(new Font("Monospaced", Font.PLAIN, 10));
|
bookNotesArea.setFont(new Font("Monospaced", Font.PLAIN, 10));
|
||||||
notesScroll = new JScrollPane();
|
bookNotesScroll = new JScrollPane();
|
||||||
notesScroll.setViewportView(notesArea);
|
bookNotesScroll.setViewportView(bookNotesArea);
|
||||||
|
|
||||||
mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, mainScroll, notesScroll);
|
chapterNotesArea = new JTextArea();
|
||||||
|
chapterNotesArea.setFont(new Font("Monospaced", Font.PLAIN, 10));
|
||||||
|
chapterNotesArea.getDocument().addDocumentListener(this);
|
||||||
|
chapterNotesScroll = new JScrollPane();
|
||||||
|
chapterNotesScroll.setViewportView(chapterNotesArea);
|
||||||
|
|
||||||
|
sentenceNotesArea = new JTextArea();
|
||||||
|
sentenceNotesArea.setFont(new Font("Monospaced", Font.PLAIN, 10));
|
||||||
|
sentenceNotesArea.getDocument().addDocumentListener(this);
|
||||||
|
sentenceNotesScroll = new JScrollPane();
|
||||||
|
sentenceNotesScroll.setViewportView(sentenceNotesArea);
|
||||||
|
|
||||||
|
notesTabs = new JTabbedPane();
|
||||||
|
|
||||||
|
notesTabs.add("Book", bookNotesScroll);
|
||||||
|
notesTabs.add("Chapter", chapterNotesScroll);
|
||||||
|
notesTabs.add("Phrase", sentenceNotesScroll);
|
||||||
|
|
||||||
|
mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, mainScroll, notesTabs);
|
||||||
centralPanel.add(mainSplit, BorderLayout.CENTER);
|
centralPanel.add(mainSplit, BorderLayout.CENTER);
|
||||||
|
|
||||||
mainSplit.addPropertyChangeListener(new PropertyChangeListener() {
|
mainSplit.addPropertyChangeListener(new PropertyChangeListener() {
|
||||||
@@ -949,6 +973,8 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
// write the content into xml file
|
// write the content into xml file
|
||||||
TransformerFactory transformerFactory = TransformerFactory.newInstance();
|
TransformerFactory transformerFactory = TransformerFactory.newInstance();
|
||||||
Transformer transformer = transformerFactory.newTransformer();
|
Transformer transformer = transformerFactory.newTransformer();
|
||||||
|
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||||
|
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
|
||||||
DOMSource source = new DOMSource(doc);
|
DOMSource source = new DOMSource(doc);
|
||||||
StreamResult result = new StreamResult(xml);
|
StreamResult result = new StreamResult(xml);
|
||||||
transformer.transform(source, result);
|
transformer.transform(source, result);
|
||||||
@@ -1298,6 +1324,34 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
JMenuObject peaknew = new JMenuObject("Auto-trim new (Peak)", c, new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
JMenuObject o = (JMenuObject)e.getSource();
|
||||||
|
Chapter chap = (Chapter)o.getObject();
|
||||||
|
|
||||||
|
ProgressDialog ed = new ProgressDialog("Auto-trimming " + chap.getName());
|
||||||
|
|
||||||
|
AutoTrimThread t = new AutoTrimThread(chap, ed, AutoTrimThread.Peak, AutoTrimThread.NewOnly);
|
||||||
|
Thread nt = new Thread(t);
|
||||||
|
nt.start();
|
||||||
|
ed.setVisible(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
JMenuObject fftnew = new JMenuObject("Auto-trim new (FFT)", c, new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
JMenuObject o = (JMenuObject)e.getSource();
|
||||||
|
Chapter chap = (Chapter)o.getObject();
|
||||||
|
|
||||||
|
ProgressDialog ed = new ProgressDialog("Auto-trimming " + chap.getName());
|
||||||
|
|
||||||
|
AutoTrimThread t = new AutoTrimThread(chap, ed, AutoTrimThread.FFT, AutoTrimThread.NewOnly);
|
||||||
|
Thread nt = new Thread(t);
|
||||||
|
nt.start();
|
||||||
|
ed.setVisible(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
JMenuObject peak = new JMenuObject("Auto-trim all (Peak)", c, new ActionListener() {
|
JMenuObject peak = new JMenuObject("Auto-trim all (Peak)", c, new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
JMenuObject o = (JMenuObject)e.getSource();
|
JMenuObject o = (JMenuObject)e.getSource();
|
||||||
@@ -1305,7 +1359,7 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
|
|
||||||
ProgressDialog ed = new ProgressDialog("Auto-trimming " + chap.getName());
|
ProgressDialog ed = new ProgressDialog("Auto-trimming " + chap.getName());
|
||||||
|
|
||||||
AutoTrimThread t = new AutoTrimThread(chap, ed, AutoTrimThread.Peak);
|
AutoTrimThread t = new AutoTrimThread(chap, ed, AutoTrimThread.Peak, AutoTrimThread.All);
|
||||||
Thread nt = new Thread(t);
|
Thread nt = new Thread(t);
|
||||||
nt.start();
|
nt.start();
|
||||||
ed.setVisible(true);
|
ed.setVisible(true);
|
||||||
@@ -1319,7 +1373,7 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
|
|
||||||
ProgressDialog ed = new ProgressDialog("Auto-trimming " + chap.getName());
|
ProgressDialog ed = new ProgressDialog("Auto-trimming " + chap.getName());
|
||||||
|
|
||||||
AutoTrimThread t = new AutoTrimThread(chap, ed, AutoTrimThread.FFT);
|
AutoTrimThread t = new AutoTrimThread(chap, ed, AutoTrimThread.FFT, AutoTrimThread.All);
|
||||||
Thread nt = new Thread(t);
|
Thread nt = new Thread(t);
|
||||||
nt.start();
|
nt.start();
|
||||||
ed.setVisible(true);
|
ed.setVisible(true);
|
||||||
@@ -1512,6 +1566,8 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.add(mergeWith);
|
menu.add(mergeWith);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
menu.add(peaknew);
|
||||||
|
menu.add(fftnew);
|
||||||
menu.add(peak);
|
menu.add(peak);
|
||||||
menu.add(fft);
|
menu.add(fft);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
@@ -1934,6 +1990,8 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
// write the content into xml file
|
// write the content into xml file
|
||||||
TransformerFactory transformerFactory = TransformerFactory.newInstance();
|
TransformerFactory transformerFactory = TransformerFactory.newInstance();
|
||||||
Transformer transformer = transformerFactory.newTransformer();
|
Transformer transformer = transformerFactory.newTransformer();
|
||||||
|
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||||
|
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
|
||||||
DOMSource source = new DOMSource(doc);
|
DOMSource source = new DOMSource(doc);
|
||||||
StreamResult result = new StreamResult(xml);
|
StreamResult result = new StreamResult(xml);
|
||||||
transformer.transform(source, result);
|
transformer.transform(source, result);
|
||||||
@@ -1976,6 +2034,11 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
bookTree.addTreeSelectionListener(new TreeSelectionListener() {
|
bookTree.addTreeSelectionListener(new TreeSelectionListener() {
|
||||||
public void valueChanged(TreeSelectionEvent e) {
|
public void valueChanged(TreeSelectionEvent e) {
|
||||||
DefaultMutableTreeNode n = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
DefaultMutableTreeNode n = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
||||||
|
if (n instanceof BookTreeNode) {
|
||||||
|
BookTreeNode btn = (BookTreeNode)n;
|
||||||
|
btn.onSelect();
|
||||||
|
}
|
||||||
|
|
||||||
if (n instanceof Sentence) {
|
if (n instanceof Sentence) {
|
||||||
Sentence s = (Sentence)n;
|
Sentence s = (Sentence)n;
|
||||||
selectedSentence = s;
|
selectedSentence = s;
|
||||||
@@ -2143,6 +2206,11 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
bookTree.addTreeSelectionListener(new TreeSelectionListener() {
|
bookTree.addTreeSelectionListener(new TreeSelectionListener() {
|
||||||
public void valueChanged(TreeSelectionEvent e) {
|
public void valueChanged(TreeSelectionEvent e) {
|
||||||
DefaultMutableTreeNode n = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
DefaultMutableTreeNode n = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
||||||
|
if (n instanceof BookTreeNode) {
|
||||||
|
BookTreeNode btn = (BookTreeNode)n;
|
||||||
|
btn.onSelect();
|
||||||
|
}
|
||||||
|
|
||||||
if (n instanceof Sentence) {
|
if (n instanceof Sentence) {
|
||||||
Sentence s = (Sentence)n;
|
Sentence s = (Sentence)n;
|
||||||
selectedSentence = s;
|
selectedSentence = s;
|
||||||
@@ -2478,15 +2546,19 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
ProgressDialog dialog;
|
ProgressDialog dialog;
|
||||||
Chapter chapter;
|
Chapter chapter;
|
||||||
int type;
|
int type;
|
||||||
|
int scope;
|
||||||
|
|
||||||
public final static int FFT = 0;
|
public final static int FFT = 0;
|
||||||
public final static int Peak = 1;
|
public final static int Peak = 1;
|
||||||
|
public final static int NewOnly = 0;
|
||||||
|
public final static int All = 1;
|
||||||
|
|
||||||
public AutoTrimThread(Chapter c, ProgressDialog e, int t) {
|
public AutoTrimThread(Chapter c, ProgressDialog e, int t, int sc) {
|
||||||
super();
|
super();
|
||||||
dialog = e;
|
dialog = e;
|
||||||
chapter = c;
|
chapter = c;
|
||||||
type = t;
|
type = t;
|
||||||
|
scope = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -2498,6 +2570,9 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
kidCount++;
|
kidCount++;
|
||||||
dialog.setProgress(kidCount * 2000 / numKids);
|
dialog.setProgress(kidCount * 2000 / numKids);
|
||||||
Sentence snt = (Sentence)s.nextElement();
|
Sentence snt = (Sentence)s.nextElement();
|
||||||
|
if (scope == NewOnly) {
|
||||||
|
if (snt.isProcessed()) continue;
|
||||||
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case FFT:
|
case FFT:
|
||||||
snt.autoTrimSampleFFT();
|
snt.autoTrimSampleFFT();
|
||||||
@@ -3687,12 +3762,28 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
System.err.println("Effects Enabled: " + b);
|
System.err.println("Effects Enabled: " + b);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNotes(String text) {
|
public void setBookNotes(String text) {
|
||||||
notesArea.setText(text);
|
bookNotesArea.setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNotes() {
|
public void setChapterNotes(String text) {
|
||||||
return notesArea.getText();
|
chapterNotesArea.setText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSentenceNotes(String text) {
|
||||||
|
sentenceNotesArea.setText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBookNotes() {
|
||||||
|
return bookNotesArea.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChapterNotes() {
|
||||||
|
return chapterNotesArea.getText();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSentenceNotes() {
|
||||||
|
return sentenceNotesArea.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openManuscript() {
|
public void openManuscript() {
|
||||||
@@ -3724,4 +3815,74 @@ public class AudiobookRecorder extends JFrame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//* DocumentListener
|
||||||
|
|
||||||
|
public void changedUpdate(DocumentEvent e) {
|
||||||
|
javax.swing.text.Document doc = e.getDocument();
|
||||||
|
if (doc == chapterNotesArea.getDocument()) {
|
||||||
|
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
||||||
|
if (selectedNode instanceof Sentence) {
|
||||||
|
selectedNode = (DefaultMutableTreeNode)selectedNode.getParent();
|
||||||
|
}
|
||||||
|
if (! (selectedNode instanceof Chapter)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Chapter c = (Chapter)selectedNode;
|
||||||
|
c.setNotes(chapterNotesArea.getText());
|
||||||
|
} else if (doc == sentenceNotesArea.getDocument()) {
|
||||||
|
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
||||||
|
if (! (selectedNode instanceof Sentence)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Sentence s = (Sentence)selectedNode;
|
||||||
|
s.setNotes(sentenceNotesArea.getText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeUpdate(DocumentEvent e) {
|
||||||
|
javax.swing.text.Document doc = e.getDocument();
|
||||||
|
if (doc == chapterNotesArea.getDocument()) {
|
||||||
|
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
||||||
|
if (selectedNode instanceof Sentence) {
|
||||||
|
selectedNode = (DefaultMutableTreeNode)selectedNode.getParent();
|
||||||
|
}
|
||||||
|
if (! (selectedNode instanceof Chapter)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Chapter c = (Chapter)selectedNode;
|
||||||
|
c.setNotes(chapterNotesArea.getText());
|
||||||
|
} else if (doc == sentenceNotesArea.getDocument()) {
|
||||||
|
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
||||||
|
if (! (selectedNode instanceof Sentence)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Sentence s = (Sentence)selectedNode;
|
||||||
|
s.setNotes(sentenceNotesArea.getText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertUpdate(DocumentEvent e) {
|
||||||
|
javax.swing.text.Document doc = e.getDocument();
|
||||||
|
if (doc == chapterNotesArea.getDocument()) {
|
||||||
|
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
||||||
|
if (selectedNode instanceof Sentence) {
|
||||||
|
selectedNode = (DefaultMutableTreeNode)selectedNode.getParent();
|
||||||
|
}
|
||||||
|
if (! (selectedNode instanceof Chapter)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Chapter c = (Chapter)selectedNode;
|
||||||
|
c.setNotes(chapterNotesArea.getText());
|
||||||
|
} else if (doc == sentenceNotesArea.getDocument()) {
|
||||||
|
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode)bookTree.getLastSelectedPathComponent();
|
||||||
|
if (! (selectedNode instanceof Sentence)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Sentence s = (Sentence)selectedNode;
|
||||||
|
s.setNotes(sentenceNotesArea.getText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DocumentListener *//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class Book extends DefaultMutableTreeNode {
|
|||||||
ACX = getTextNode(root, "acx");
|
ACX = getTextNode(root, "acx");
|
||||||
manuscript = getTextNode(root, "manuscript");
|
manuscript = getTextNode(root, "manuscript");
|
||||||
|
|
||||||
AudiobookRecorder.window.setNotes(getTextNode(root, "notes"));
|
AudiobookRecorder.window.setBookNotes(getTextNode(root, "notes"));
|
||||||
|
|
||||||
Element settings = getNode(root, "settings");
|
Element settings = getNode(root, "settings");
|
||||||
Element audioSettings = getNode(settings, "audio");
|
Element audioSettings = getNode(settings, "audio");
|
||||||
@@ -306,7 +306,7 @@ public class Book extends DefaultMutableTreeNode {
|
|||||||
root.appendChild(makeTextNode(doc, "acx", ACX));
|
root.appendChild(makeTextNode(doc, "acx", ACX));
|
||||||
root.appendChild(makeTextNode(doc, "manuscript", manuscript));
|
root.appendChild(makeTextNode(doc, "manuscript", manuscript));
|
||||||
|
|
||||||
root.appendChild(makeTextNode(doc, "notes", AudiobookRecorder.window.getNotes()));
|
root.appendChild(makeTextNode(doc, "notes", AudiobookRecorder.window.getBookNotes()));
|
||||||
|
|
||||||
Element settingsNode = doc.createElement("settings");
|
Element settingsNode = doc.createElement("settings");
|
||||||
root.appendChild(settingsNode);
|
root.appendChild(settingsNode);
|
||||||
|
|||||||
20
src/uk/co/majenko/audiobookrecorder/BookTreeNode.java
Normal file
20
src/uk/co/majenko/audiobookrecorder/BookTreeNode.java
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package uk.co.majenko.audiobookrecorder;
|
||||||
|
|
||||||
|
import javax.swing.tree.DefaultMutableTreeNode;
|
||||||
|
|
||||||
|
public abstract class BookTreeNode extends DefaultMutableTreeNode {
|
||||||
|
|
||||||
|
public BookTreeNode(String t) {
|
||||||
|
super(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BookTreeNode() {
|
||||||
|
super("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void setNotes(String t);
|
||||||
|
public abstract String getNotes();
|
||||||
|
|
||||||
|
public abstract void onSelect();
|
||||||
|
}
|
||||||
|
|
||||||
@@ -20,6 +20,10 @@ public class BookTreeRenderer extends DefaultTreeCellRenderer {
|
|||||||
ret.setText(s.getOverrideText());
|
ret.setText(s.getOverrideText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!s.isProcessed()) {
|
||||||
|
ret.setForeground(new Color(0x88, 0x88, 0x88));
|
||||||
|
}
|
||||||
|
|
||||||
if (s.getAttentionFlag()) {
|
if (s.getAttentionFlag()) {
|
||||||
ret.setForeground(new Color(0xFF, 0xFF, 0x00));
|
ret.setForeground(new Color(0xFF, 0xFF, 0x00));
|
||||||
icn.add(Overlays.attention, OverlayIcon.TOP_LEFT);
|
icn.add(Overlays.attention, OverlayIcon.TOP_LEFT);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.w3c.dom.Node;
|
|||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
import org.w3c.dom.Text;
|
import org.w3c.dom.Text;
|
||||||
|
|
||||||
public class Chapter extends DefaultMutableTreeNode {
|
public class Chapter extends BookTreeNode {
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
String id;
|
String id;
|
||||||
@@ -34,6 +34,8 @@ public class Chapter extends DefaultMutableTreeNode {
|
|||||||
int preGap;
|
int preGap;
|
||||||
int postGap;
|
int postGap;
|
||||||
|
|
||||||
|
String notes;
|
||||||
|
|
||||||
public Chapter(String i, String chaptername) {
|
public Chapter(String i, String chaptername) {
|
||||||
super(chaptername);
|
super(chaptername);
|
||||||
|
|
||||||
@@ -50,6 +52,8 @@ public class Chapter extends DefaultMutableTreeNode {
|
|||||||
preGap = Utils.s2i(Book.getTextNode(root, "pre-gap"));
|
preGap = Utils.s2i(Book.getTextNode(root, "pre-gap"));
|
||||||
postGap = Utils.s2i(Book.getTextNode(root, "post-gap"));
|
postGap = Utils.s2i(Book.getTextNode(root, "post-gap"));
|
||||||
|
|
||||||
|
notes = Book.getTextNode(root, "notes");
|
||||||
|
|
||||||
Element sentencesNode = Book.getNode(root, "sentences");
|
Element sentencesNode = Book.getNode(root, "sentences");
|
||||||
NodeList sentences = sentencesNode.getElementsByTagName("sentence");
|
NodeList sentences = sentencesNode.getElementsByTagName("sentence");
|
||||||
|
|
||||||
@@ -284,6 +288,7 @@ public class Chapter extends DefaultMutableTreeNode {
|
|||||||
chapterNode.appendChild(Book.makeTextNode(doc, "name", name));
|
chapterNode.appendChild(Book.makeTextNode(doc, "name", name));
|
||||||
chapterNode.appendChild(Book.makeTextNode(doc, "pre-gap", preGap));
|
chapterNode.appendChild(Book.makeTextNode(doc, "pre-gap", preGap));
|
||||||
chapterNode.appendChild(Book.makeTextNode(doc, "post-gap", postGap));
|
chapterNode.appendChild(Book.makeTextNode(doc, "post-gap", postGap));
|
||||||
|
chapterNode.appendChild(Book.makeTextNode(doc, "notes", notes));
|
||||||
|
|
||||||
Element sentencesNode = doc.createElement("sentences");
|
Element sentencesNode = doc.createElement("sentences");
|
||||||
chapterNode.appendChild(sentencesNode);
|
chapterNode.appendChild(sentencesNode);
|
||||||
@@ -299,4 +304,16 @@ public class Chapter extends DefaultMutableTreeNode {
|
|||||||
return chapterNode;
|
return chapterNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getNotes() {
|
||||||
|
return notes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNotes(String t) {
|
||||||
|
notes = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSelect() {
|
||||||
|
AudiobookRecorder.window.setChapterNotes(notes);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,10 +41,11 @@ import org.w3c.dom.Document;
|
|||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.Text;
|
import org.w3c.dom.Text;
|
||||||
|
|
||||||
public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
public class Sentence extends BookTreeNode implements Cacheable {
|
||||||
|
|
||||||
String text;
|
String text;
|
||||||
String id;
|
String id;
|
||||||
|
String notes;
|
||||||
int postGap;
|
int postGap;
|
||||||
int startOffset = 0;
|
int startOffset = 0;
|
||||||
int endOffset = 0;
|
int endOffset = 0;
|
||||||
@@ -60,6 +61,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
|
|
||||||
boolean inSample;
|
boolean inSample;
|
||||||
boolean attention = false;
|
boolean attention = false;
|
||||||
|
boolean processed = false;
|
||||||
|
|
||||||
String effectChain = null;
|
String effectChain = null;
|
||||||
|
|
||||||
@@ -86,20 +88,26 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
|
|
||||||
boolean effectEthereal = false;
|
boolean effectEthereal = false;
|
||||||
|
|
||||||
|
public void setSampleSize(int s) {
|
||||||
|
sampleSize = s;
|
||||||
|
}
|
||||||
|
|
||||||
static class RecordingThread implements Runnable {
|
static class RecordingThread implements Runnable {
|
||||||
|
|
||||||
boolean running = false;
|
boolean running = false;
|
||||||
boolean recording = false;
|
boolean recording = false;
|
||||||
|
Sentence sent = null;
|
||||||
|
|
||||||
File tempFile;
|
File tempFile;
|
||||||
File wavFile;
|
File wavFile;
|
||||||
|
|
||||||
AudioFormat format;
|
AudioFormat format;
|
||||||
|
|
||||||
public RecordingThread(File tf, File wf, AudioFormat af) {
|
public RecordingThread(File tf, File wf, AudioFormat af, Sentence s) {
|
||||||
tempFile = tf;
|
tempFile = tf;
|
||||||
wavFile = wf;
|
wavFile = wf;
|
||||||
format = af;
|
format = af;
|
||||||
|
sent = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -121,6 +129,8 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
fos.write(buf, 0, nr);
|
fos.write(buf, 0, nr);
|
||||||
fos.close();
|
fos.close();
|
||||||
|
|
||||||
|
sent.setSampleSize(len / format.getFrameSize());
|
||||||
|
|
||||||
FileInputStream fis = new FileInputStream(tempFile);
|
FileInputStream fis = new FileInputStream(tempFile);
|
||||||
AudioInputStream ais = new AudioInputStream(fis, format, len / format.getFrameSize());
|
AudioInputStream ais = new AudioInputStream(fis, format, len / format.getFrameSize());
|
||||||
fos = new FileOutputStream(wavFile);
|
fos = new FileOutputStream(wavFile);
|
||||||
@@ -170,6 +180,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
super("");
|
super("");
|
||||||
id = root.getAttribute("id");
|
id = root.getAttribute("id");
|
||||||
text = Book.getTextNode(root, "text");
|
text = Book.getTextNode(root, "text");
|
||||||
|
notes = Book.getTextNode(root, "notes");
|
||||||
setUserObject(text);
|
setUserObject(text);
|
||||||
setPostGap(Utils.s2i(Book.getTextNode(root, "post-gap")));
|
setPostGap(Utils.s2i(Book.getTextNode(root, "post-gap")));
|
||||||
setStartOffset(Utils.s2i(Book.getTextNode(root, "start-offset")));
|
setStartOffset(Utils.s2i(Book.getTextNode(root, "start-offset")));
|
||||||
@@ -180,6 +191,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
setEffectChain(Book.getTextNode(root, "effect"));
|
setEffectChain(Book.getTextNode(root, "effect"));
|
||||||
setPostGapType(Book.getTextNode(root, "gaptype"));
|
setPostGapType(Book.getTextNode(root, "gaptype"));
|
||||||
sampleSize = Utils.s2i(Book.getTextNode(root, "samples"));
|
sampleSize = Utils.s2i(Book.getTextNode(root, "samples"));
|
||||||
|
processed = Utils.s2b(Book.getTextNode(root, "processed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean startRecording() {
|
public boolean startRecording() {
|
||||||
@@ -190,7 +202,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
|
|
||||||
CacheManager.removeFromCache(this);
|
CacheManager.removeFromCache(this);
|
||||||
|
|
||||||
recordingThread = new RecordingThread(getTempFile(), getFile(), Options.getAudioFormat());
|
recordingThread = new RecordingThread(getTempFile(), getFile(), Options.getAudioFormat(), this);
|
||||||
|
|
||||||
Thread rc = new Thread(recordingThread);
|
Thread rc = new Thread(recordingThread);
|
||||||
rc.setDaemon(true);
|
rc.setDaemon(true);
|
||||||
@@ -230,6 +242,12 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
autoTrimSamplePeak(useRaw);
|
autoTrimSamplePeak(useRaw);
|
||||||
} else if (tm.equals("fft")) {
|
} else if (tm.equals("fft")) {
|
||||||
autoTrimSampleFFT(useRaw);
|
autoTrimSampleFFT(useRaw);
|
||||||
|
} else {
|
||||||
|
startOffset = 0;
|
||||||
|
crossStartOffset = 0;
|
||||||
|
endOffset = sampleSize - 1;
|
||||||
|
crossEndOffset = sampleSize - 1;
|
||||||
|
processed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,7 +349,8 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
updateCrossings(useRaw);
|
updateCrossings(useRaw);
|
||||||
intens = null;
|
intens = null;
|
||||||
samples = null;
|
samples = null;
|
||||||
|
processed = true;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void autoTrimSamplePeak() {
|
public void autoTrimSamplePeak() {
|
||||||
@@ -387,6 +406,8 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
if (startOffset < 0) startOffset = 0;
|
if (startOffset < 0) startOffset = 0;
|
||||||
if (endOffset >= samples.length) endOffset = samples.length-1;
|
if (endOffset >= samples.length) endOffset = samples.length-1;
|
||||||
updateCrossings(useRaw);
|
updateCrossings(useRaw);
|
||||||
|
processed = true;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
@@ -396,6 +417,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
public void setText(String t) {
|
public void setText(String t) {
|
||||||
overrideText = null;
|
overrideText = null;
|
||||||
text = t;
|
text = t;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getText() {
|
public String getText() {
|
||||||
@@ -443,6 +465,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
if (o instanceof String) {
|
if (o instanceof String) {
|
||||||
String so = (String)o;
|
String so = (String)o;
|
||||||
text = so;
|
text = so;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -502,6 +525,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
if (startOffset != o) {
|
if (startOffset != o) {
|
||||||
startOffset = o;
|
startOffset = o;
|
||||||
crossStartOffset = -1;
|
crossStartOffset = -1;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -517,6 +541,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
if (endOffset != o) {
|
if (endOffset != o) {
|
||||||
endOffset = o;
|
endOffset = o;
|
||||||
crossEndOffset = -1;
|
crossEndOffset = -1;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,6 +622,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
|
|
||||||
public void setLocked(boolean l) {
|
public void setLocked(boolean l) {
|
||||||
locked = l;
|
locked = l;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLocked() {
|
public boolean isLocked() {
|
||||||
@@ -699,6 +725,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
|
|
||||||
public void setAttentionFlag(boolean f) {
|
public void setAttentionFlag(boolean f) {
|
||||||
attention = f;
|
attention = f;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getAttentionFlag() {
|
public boolean getAttentionFlag() {
|
||||||
@@ -1298,6 +1325,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
CacheManager.removeFromCache(this);
|
CacheManager.removeFromCache(this);
|
||||||
}
|
}
|
||||||
effectChain = key;
|
effectChain = key;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getEffectChain() {
|
public String getEffectChain() {
|
||||||
@@ -1324,6 +1352,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
postGapType = t;
|
postGapType = t;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetPostGap() {
|
public void resetPostGap() {
|
||||||
@@ -1391,7 +1420,30 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
|||||||
sentenceNode.appendChild(Book.makeTextNode(doc, "effect", getEffectChain()));
|
sentenceNode.appendChild(Book.makeTextNode(doc, "effect", getEffectChain()));
|
||||||
sentenceNode.appendChild(Book.makeTextNode(doc, "gaptype", getPostGapType()));
|
sentenceNode.appendChild(Book.makeTextNode(doc, "gaptype", getPostGapType()));
|
||||||
sentenceNode.appendChild(Book.makeTextNode(doc, "samples", getSampleSize()));
|
sentenceNode.appendChild(Book.makeTextNode(doc, "samples", getSampleSize()));
|
||||||
|
sentenceNode.appendChild(Book.makeTextNode(doc, "processed", isProcessed()));
|
||||||
|
sentenceNode.appendChild(Book.makeTextNode(doc, "notes", getNotes()));
|
||||||
return sentenceNode;
|
return sentenceNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isProcessed() {
|
||||||
|
return processed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProcessed(boolean p) {
|
||||||
|
processed = p;
|
||||||
|
AudiobookRecorder.window.bookTreeModel.reload(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNotes(String n) {
|
||||||
|
notes = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNotes() {
|
||||||
|
return notes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSelect() {
|
||||||
|
AudiobookRecorder.window.setSentenceNotes(notes);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user