Clean up tools and book menus a little
This commit is contained in:
@@ -137,11 +137,9 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
JMenuItem bookVisitAudition;
|
JMenuItem bookVisitAudition;
|
||||||
JMenuItem bookVisitProduce;
|
JMenuItem bookVisitProduce;
|
||||||
|
|
||||||
JMenuItem toolsMerge;
|
|
||||||
JMenuItem toolsArchive;
|
JMenuItem toolsArchive;
|
||||||
JMenuItem toolsCoverArt;
|
JMenuItem toolsCoverArt;
|
||||||
JMenuItem toolsManuscript;
|
JMenuItem toolsManuscript;
|
||||||
JMenuItem toolsReloadEffects;
|
|
||||||
JMenuItem toolsOptions;
|
JMenuItem toolsOptions;
|
||||||
|
|
||||||
JMenuItem helpAbout;
|
JMenuItem helpAbout;
|
||||||
@@ -184,7 +182,6 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
|
|
||||||
JSpinner postSentenceGap;
|
JSpinner postSentenceGap;
|
||||||
JSpinner gainPercent;
|
JSpinner gainPercent;
|
||||||
Timer waveformUpdater = new Timer();
|
|
||||||
JCheckBox locked;
|
JCheckBox locked;
|
||||||
JCheckBox attention;
|
JCheckBox attention;
|
||||||
JCheckBox rawAudio;
|
JCheckBox rawAudio;
|
||||||
@@ -332,14 +329,6 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
|
|
||||||
toolsMenu = new JMenu("Tools");
|
toolsMenu = new JMenu("Tools");
|
||||||
|
|
||||||
toolsMerge = new JMenuItem("Merge Book...");
|
|
||||||
toolsMerge.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
Debug.trace();
|
|
||||||
mergeBook(getBook());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
toolsArchive = new JMenuItem("Archive Book");
|
toolsArchive = new JMenuItem("Archive Book");
|
||||||
toolsArchive.addActionListener(new ActionListener() {
|
toolsArchive.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
@@ -364,18 +353,6 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
toolsReloadEffects = new JMenuItem("Reload effects");
|
|
||||||
toolsReloadEffects.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
Debug.trace();
|
|
||||||
queueJob(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
getBook().loadEffects();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
toolsOptions = new JMenuItem("Options");
|
toolsOptions = new JMenuItem("Options");
|
||||||
toolsOptions.addActionListener(new ActionListener() {
|
toolsOptions.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
@@ -384,11 +361,9 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
toolsMenu.add(toolsMerge);
|
|
||||||
toolsMenu.add(toolsArchive);
|
toolsMenu.add(toolsArchive);
|
||||||
toolsMenu.add(toolsCoverArt);
|
toolsMenu.add(toolsCoverArt);
|
||||||
toolsMenu.add(toolsManuscript);
|
toolsMenu.add(toolsManuscript);
|
||||||
toolsMenu.add(toolsReloadEffects);
|
|
||||||
toolsMenu.addSeparator();
|
toolsMenu.addSeparator();
|
||||||
toolsMenu.add(toolsOptions);
|
toolsMenu.add(toolsOptions);
|
||||||
|
|
||||||
@@ -1887,6 +1862,15 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
menu.add(new JMenuObject("Reload effects", book, new ActionListener() {
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
Debug.trace();
|
||||||
|
JMenuObject src = (JMenuObject)(e.getSource());
|
||||||
|
Book thisBook = (Book)(src.getObject());
|
||||||
|
thisBook.loadEffects();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
|
||||||
menu.add(new JMenuObject("Close book", book, new ActionListener() {
|
menu.add(new JMenuObject("Close book", book, new ActionListener() {
|
||||||
@@ -3243,36 +3227,22 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
|||||||
updateWaveform(false);
|
updateWaveform(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
TimerTask waveformUpdaterTask = null;
|
|
||||||
|
|
||||||
synchronized public void updateWaveform(boolean force) {
|
synchronized public void updateWaveform(boolean force) {
|
||||||
Debug.trace();
|
Debug.trace();
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
public void run() {
|
||||||
if (selectedSentence != null) {
|
if (selectedSentence != null) {
|
||||||
if ((!force) && (sampleWaveform.getId() != null) && (sampleWaveform.getId().equals(selectedSentence.getId()))) return;
|
if ((!force) && (sampleWaveform.getId() != null) && (sampleWaveform.getId().equals(selectedSentence.getId()))) return;
|
||||||
|
|
||||||
synchronized (waveformUpdater) {
|
|
||||||
// try {
|
|
||||||
// if (waveformUpdaterTask != null) {
|
|
||||||
// waveformUpdaterTask.cancel();
|
|
||||||
// }
|
|
||||||
// } catch (Exception ex) {
|
|
||||||
// }
|
|
||||||
|
|
||||||
// waveformUpdaterTask = new TimerTask() {
|
|
||||||
// public void run() {
|
|
||||||
sampleWaveform.setId(selectedSentence.getId());
|
sampleWaveform.setId(selectedSentence.getId());
|
||||||
if (rawAudio.isSelected()) {
|
if (rawAudio.isSelected()) {
|
||||||
sampleWaveform.setData(selectedSentence.getRawAudioData());
|
sampleWaveform.setData(selectedSentence.getRawAudioData());
|
||||||
} else {
|
} else {
|
||||||
sampleWaveform.setData(selectedSentence.getDoubleAudioData(effectsEnabled));
|
sampleWaveform.setData(selectedSentence.getDoubleAudioData(effectsEnabled));
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
// };
|
|
||||||
|
|
||||||
// waveformUpdater.schedule(waveformUpdaterTask, 20);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized public void updateWaveformMarkers() {
|
synchronized public void updateWaveformMarkers() {
|
||||||
|
|||||||
Reference in New Issue
Block a user