diff --git a/LICENCE.md b/LICENCE.md index bfaacf4..97e8c9e 100644 --- a/LICENCE.md +++ b/LICENCE.md @@ -35,3 +35,4 @@ Third party software * JAVE ffmpeg wrapper: http://www.sauronsoftware.it/projects/jave/ * JTattoo: http://www.sauronsoftware.it/projects/jave/ * Icons from, or based on, Oxygen: https://github.com/KDE/oxygen-icons +* JEQ, the Java Equaliser: https://sourceforge.net/projects/jeq/ diff --git a/src/uk/co/majenko/audiobookrecorder/Options.java b/src/uk/co/majenko/audiobookrecorder/Options.java index 0d06182..3ffc067 100644 --- a/src/uk/co/majenko/audiobookrecorder/Options.java +++ b/src/uk/co/majenko/audiobookrecorder/Options.java @@ -381,6 +381,26 @@ public class Options extends JDialog { } + JButton smooth = new JButton("Smooth curve"); + smooth.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + Float ave[] = new Float[31]; + for (int i = 1; i < 30; i++) { + ave[i] = (Utils.s2f(eqvals[i - 1].getText()) + Utils.s2f(eqvals[i].getText()) + Utils.s2f(eqvals[i + 1].getText())) / 3.0f; + } + + for (int i = 1; i < 30; i++) { + eqvals[i].setText(String.format("%.1f", ave[i])); + sliders[i].setValue((int)(ave[i] * 10)); + } + } + }); + + constraint.gridx = 0; + constraint.gridy = 2; + constraint.gridwidth = 4; + eqPanel.add(smooth, constraint); + tabs.add("EQ", eqPanel);