Add refresh data button
This commit is contained in:
BIN
resources/uk/co/majenko/audiobookrecorder/icons/refresh.png
Normal file
BIN
resources/uk/co/majenko/audiobookrecorder/icons/refresh.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -183,6 +183,8 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
||||
JToggleButtonSpacePlay selectCutMode;
|
||||
JButtonSpacePlay doCutSplit;
|
||||
|
||||
JButtonSpacePlay refreshSentence;
|
||||
|
||||
JComboBox<KVPair<String,String>> effectChain;
|
||||
|
||||
Thread playingThread = null;
|
||||
@@ -574,6 +576,14 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
||||
}
|
||||
});
|
||||
|
||||
refreshSentence = new JButtonSpacePlay(Icons.refresh, "Refresh Phrase Data", new ActionListener() {
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
Debug.trace();
|
||||
if (selectedSentence == null) return;
|
||||
selectedSentence.refreshAllData();
|
||||
}
|
||||
});
|
||||
|
||||
controlsTop.add(attention);
|
||||
|
||||
controlsTop.add(Box.createHorizontalGlue());
|
||||
@@ -586,6 +596,8 @@ public class AudiobookRecorder extends JFrame implements DocumentListener {
|
||||
controlsTop.add(new JLabel("%"));
|
||||
|
||||
controlsTop.add(Box.createHorizontalGlue());
|
||||
|
||||
controlsTop.add(refreshSentence);
|
||||
|
||||
|
||||
JButtonSpacePlay zoomIn = new JButtonSpacePlay(Icons.zoomIn, "Zoom In", new ActionListener() {
|
||||
|
||||
@@ -98,7 +98,7 @@ public class BookTreeRenderer extends DefaultTreeCellRenderer {
|
||||
|
||||
String effectChain = s.getEffectChain();
|
||||
if ((effectChain != null) && (!effectChain.equals("none"))) {
|
||||
Effect e = AudiobookRecorder.window.getBook().effects.get(effectChain);
|
||||
Effect e = s.getBook().effects.get(effectChain);
|
||||
if (e != null) {
|
||||
JLabel eff = new JLabel(e.toString() + " ");
|
||||
ctx.weightx = 0.0d;
|
||||
|
||||
@@ -43,4 +43,5 @@ public class Icons {
|
||||
static public final ImageIcon queued = new ImageIcon(Icons.class.getResource("icons/queued.png"));
|
||||
static public final ImageIcon processing = new ImageIcon(Icons.class.getResource("icons/processing.png"));
|
||||
static public final ImageIcon close = new ImageIcon(Icons.class.getResource("icons/close.png"));
|
||||
static public final ImageIcon refresh = new ImageIcon(Icons.class.getResource("icons/refresh.png"));
|
||||
}
|
||||
|
||||
@@ -1762,4 +1762,21 @@ public class Sentence extends BookTreeNode implements Cacheable {
|
||||
public void setParentBook(Book b) {
|
||||
parentBook = b;
|
||||
}
|
||||
|
||||
public void refreshAllData() {
|
||||
runtime = -1d;
|
||||
peak = -1d;
|
||||
sampleSize = -1;
|
||||
audioData = null;
|
||||
processedAudio = null;
|
||||
fftProfile = null;
|
||||
CacheManager.removeFromCache(this);
|
||||
getProcessedAudioData();
|
||||
getLength();
|
||||
crossStartOffset = -1;
|
||||
crossEndOffset = -1;
|
||||
updateCrossings();
|
||||
getPeakDB();
|
||||
reloadTree();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user