Added about panel

This commit is contained in:
2018-09-15 17:00:40 +01:00
parent 6ea1bd22b0
commit ec90e5727f
198 changed files with 15477 additions and 8 deletions

View File

@@ -0,0 +1,34 @@
package uk.co.majenko.audiobookrecorder;
import javax.swing.*;
import java.awt.*;
public class AboutPanel extends JPanel {
public AboutPanel() {
setLayout(new BorderLayout());
JLabel icon = new JLabel(Icons.appIcon);
add(icon, BorderLayout.WEST);
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS));
p.add(Box.createVerticalGlue());
JLabel l1 = new JLabel("AudiobookRecorder");
JLabel l2 = new JLabel("Version " + AudiobookRecorder.config.getProperty("version"));
JLabel l3 = new JLabel("(c) 2018 Majenko Technologies");
l1.setAlignmentX(JComponent.CENTER_ALIGNMENT);
l2.setAlignmentX(JComponent.CENTER_ALIGNMENT);
l3.setAlignmentX(JComponent.CENTER_ALIGNMENT);
p.add(l1);
p.add(Box.createVerticalGlue());
p.add(l2);
p.add(l3);
p.add(Box.createVerticalGlue());
add(p, BorderLayout.CENTER);
}
}

View File

@@ -19,12 +19,15 @@ import edu.cmu.sphinx.result.*;
public class AudiobookRecorder extends JFrame {
static Properties config = new Properties();
MainToolBar toolBar;
JMenuBar menuBar;
JMenu fileMenu;
JMenu bookMenu;
JMenu toolsMenu;
JMenu helpMenu;
JMenuItem fileNewBook;
JMenuItem fileOpenBook;
@@ -35,6 +38,8 @@ public class AudiobookRecorder extends JFrame {
JMenuItem toolsOptions;
JMenuItem helpAbout;
FlashPanel centralPanel;
JPanel statusBar;
@@ -174,6 +179,19 @@ public class AudiobookRecorder extends JFrame {
menuBar.add(toolsMenu);
helpMenu = new JMenu("Help");
helpAbout = new JMenuItem("About AudiobookRecorder");
helpAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(AudiobookRecorder.this, new AboutPanel(), "About AudiobookRecorder", JOptionPane.PLAIN_MESSAGE);
}
});
helpMenu.add(helpAbout);
menuBar.add(helpMenu);
ob.add(menuBar, BorderLayout.NORTH);
setPreferredSize(new Dimension(700, 500));
@@ -536,6 +554,11 @@ public class AudiobookRecorder extends JFrame {
}
public static void main(String args[]) {
try {
config.load(AudiobookRecorder.class.getResourceAsStream("config.txt"));
} catch (Exception e) {
e.printStackTrace();
}
AudiobookRecorder frame = new AudiobookRecorder();
}

View File

@@ -353,15 +353,15 @@ public class Options extends JDialog {
defaultPrefs.put("audio.recording.device", "");
}
defaultPrefs.put("audio.recording.channels", "2");
defaultPrefs.put("audio.recording.samplerate", "48000");
defaultPrefs.put("audio.recording.samplerate", "44100");
if (playbackMixers.length > 0) {
defaultPrefs.put("audio.playback.device", playbackMixers[0].key);
} else {
defaultPrefs.put("audio.playback.device", "");
}
defaultPrefs.put("catenation.pre-chapter", "2000");
defaultPrefs.put("catenation.post-chapter", "2000");
defaultPrefs.put("catenation.pre-chapter", "1000");
defaultPrefs.put("catenation.post-chapter", "1500");
defaultPrefs.put("catenation.post-sentence", "1000");
defaultPrefs.put("catenation.post-paragraph", "2000");