Migrated code to JVM-11 compatability
This commit is contained in:
@@ -363,7 +363,6 @@ public class AudiobookRecorder extends JFrame {
|
||||
});
|
||||
|
||||
|
||||
|
||||
JPanel controlsTop = new JPanel();
|
||||
JPanel controlsBottom = new JPanel();
|
||||
JToolBar controlsLeft = new JToolBar(JToolBar.VERTICAL);
|
||||
@@ -597,6 +596,7 @@ public class AudiobookRecorder extends JFrame {
|
||||
|
||||
setIconImage(Icons.appIcon.getImage());
|
||||
|
||||
|
||||
pack();
|
||||
setVisible(true);
|
||||
|
||||
@@ -735,8 +735,8 @@ public class AudiobookRecorder extends JFrame {
|
||||
JMenuObject rec = new JMenuObject("Recognise text from audio", s);
|
||||
JMenu moveMenu = new JMenu("Move sentence to...");
|
||||
|
||||
for (Enumeration<Chapter> c = book.children(); c.hasMoreElements();) {
|
||||
Chapter chp = c.nextElement();
|
||||
for (Enumeration c = book.children(); c.hasMoreElements();) {
|
||||
Chapter chp = (Chapter)c.nextElement();
|
||||
JMenuObject2 m = new JMenuObject2(chp.getName(), s, chp);
|
||||
m.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
@@ -858,8 +858,8 @@ public class AudiobookRecorder extends JFrame {
|
||||
}
|
||||
});
|
||||
|
||||
for (Enumeration<Chapter> bc = book.children(); bc.hasMoreElements();) {
|
||||
Chapter chp = bc.nextElement();
|
||||
for (Enumeration bc = book.children(); bc.hasMoreElements();) {
|
||||
Chapter chp = (Chapter)bc.nextElement();
|
||||
if (chp.getId().equals(c.getId())) {
|
||||
continue;
|
||||
}
|
||||
@@ -932,8 +932,8 @@ public class AudiobookRecorder extends JFrame {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JMenuObject o = (JMenuObject)e.getSource();
|
||||
Chapter c = (Chapter)o.getObject();
|
||||
for (Enumeration<Sentence> s = c.children(); s.hasMoreElements();) {
|
||||
Sentence snt = s.nextElement();
|
||||
for (Enumeration s = c.children(); s.hasMoreElements();) {
|
||||
Sentence snt = (Sentence)s.nextElement();
|
||||
if (!snt.isLocked()) {
|
||||
snt.autoTrimSamplePeak();
|
||||
}
|
||||
@@ -945,8 +945,8 @@ public class AudiobookRecorder extends JFrame {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JMenuObject o = (JMenuObject)e.getSource();
|
||||
Chapter c = (Chapter)o.getObject();
|
||||
for (Enumeration<Sentence> s = c.children(); s.hasMoreElements();) {
|
||||
Sentence snt = s.nextElement();
|
||||
for (Enumeration s = c.children(); s.hasMoreElements();) {
|
||||
Sentence snt = (Sentence)s.nextElement();
|
||||
snt.setLocked(true);
|
||||
bookTreeModel.reload(snt);
|
||||
}
|
||||
@@ -956,8 +956,8 @@ public class AudiobookRecorder extends JFrame {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JMenuObject o = (JMenuObject)e.getSource();
|
||||
Chapter c = (Chapter)o.getObject();
|
||||
for (Enumeration<Sentence> s = c.children(); s.hasMoreElements();) {
|
||||
Sentence snt = s.nextElement();
|
||||
for (Enumeration s = c.children(); s.hasMoreElements();) {
|
||||
Sentence snt = (Sentence)s.nextElement();
|
||||
snt.setLocked(false);
|
||||
bookTreeModel.reload(snt);
|
||||
}
|
||||
@@ -1228,17 +1228,17 @@ public class AudiobookRecorder extends JFrame {
|
||||
prefs.setProperty("audio.eq." + i, String.format("%.3f", book.equaliser.getChannel(i)));
|
||||
}
|
||||
|
||||
for (Enumeration<Chapter> o = book.children(); o.hasMoreElements();) {
|
||||
for (Enumeration o = book.children(); o.hasMoreElements();) {
|
||||
|
||||
Chapter c = o.nextElement();
|
||||
Chapter c = (Chapter)o.nextElement();
|
||||
String keybase = "chapter." + c.getId();
|
||||
prefs.setProperty(keybase + ".name", c.getName());
|
||||
prefs.setProperty(keybase + ".pre-gap", Integer.toString(c.getPreGap()));
|
||||
prefs.setProperty(keybase + ".post-gap", Integer.toString(c.getPostGap()));
|
||||
|
||||
int i = 0;
|
||||
for (Enumeration<Sentence> s = c.children(); s.hasMoreElements();) {
|
||||
Sentence snt = s.nextElement();
|
||||
for (Enumeration s = c.children(); s.hasMoreElements();) {
|
||||
Sentence snt = (Sentence)s.nextElement();
|
||||
prefs.setProperty(String.format("%s.sentence.%08d.id", keybase, i), snt.getId());
|
||||
prefs.setProperty(String.format("%s.sentence.%08d.text", keybase, i), snt.getText());
|
||||
prefs.setProperty(String.format("%s.sentence.%08d.post-gap", keybase, i), Integer.toString(snt.getPostGap()));
|
||||
@@ -1625,8 +1625,8 @@ public class AudiobookRecorder extends JFrame {
|
||||
public void exportAudio() {
|
||||
|
||||
|
||||
for (Enumeration<Chapter> o = book.children(); o.hasMoreElements();) {
|
||||
Chapter c = o.nextElement();
|
||||
for (Enumeration o = book.children(); o.hasMoreElements();) {
|
||||
Chapter c = (Chapter)o.nextElement();
|
||||
ExportDialog ed = new ExportDialog("Exporting " + c.getName());
|
||||
|
||||
ExportThread t = new ExportThread(c, ed);
|
||||
|
||||
@@ -68,8 +68,8 @@ public class Book extends DefaultMutableTreeNode {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public Chapter getChapterById(String id) {
|
||||
for (Enumeration<Object>o = children(); o.hasMoreElements();) {
|
||||
Object ob = o.nextElement();
|
||||
for (Enumeration o = children(); o.hasMoreElements();) {
|
||||
Object ob = (Object)o.nextElement();
|
||||
if (ob instanceof Chapter) {
|
||||
Chapter c = (Chapter)ob;
|
||||
if (c.getId().equals(id)) {
|
||||
@@ -152,8 +152,8 @@ public class Book extends DefaultMutableTreeNode {
|
||||
public void renumberChapters() {
|
||||
int id = 1;
|
||||
|
||||
for (Enumeration<Chapter> c = children(); c.hasMoreElements();) {
|
||||
Chapter chp = c.nextElement();
|
||||
for (Enumeration c = children(); c.hasMoreElements();) {
|
||||
Chapter chp = (Chapter)c.nextElement();
|
||||
if (Utils.s2i(chp.getId()) > 0) {
|
||||
chp.setId(String.format("%04d", id));
|
||||
id++;
|
||||
|
||||
@@ -116,7 +116,7 @@ public class Chapter extends DefaultMutableTreeNode {
|
||||
audioAttributes.setCodec("libmp3lame");
|
||||
audioAttributes.setBitRate(Options.getInteger("audio.export.bitrate"));
|
||||
audioAttributes.setSamplingRate(Options.getInteger("audio.export.samplerate"));
|
||||
audioAttributes.setChannels(new Integer(2));
|
||||
audioAttributes.setChannels(2); //new Integer(2));
|
||||
attributes.setFormat("mp3");
|
||||
attributes.setAudioAttributes(audioAttributes);
|
||||
|
||||
@@ -145,10 +145,10 @@ public class Chapter extends DefaultMutableTreeNode {
|
||||
int kidno = 0;
|
||||
|
||||
|
||||
for (Enumeration<Sentence> s = children(); s.hasMoreElements();) {
|
||||
for (Enumeration s = children(); s.hasMoreElements();) {
|
||||
kidno++;
|
||||
if (exportDialog != null) exportDialog.setProgress(kidno * 1000 / kids);
|
||||
Sentence snt = s.nextElement();
|
||||
Sentence snt = (Sentence)s.nextElement();
|
||||
data = snt.getRawAudioData();
|
||||
|
||||
fullLength += data.length;
|
||||
|
||||
@@ -154,6 +154,7 @@ public class Sentence extends DefaultMutableTreeNode implements Cacheable {
|
||||
recognise();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final int FFTBuckets = 1024;
|
||||
|
||||
Reference in New Issue
Block a user