Added curve smoothing button to EQ

This commit is contained in:
2018-09-24 18:53:10 +01:00
parent a51af45e50
commit 6adb22b9ac
2 changed files with 21 additions and 0 deletions

View File

@@ -35,3 +35,4 @@ Third party software
* JAVE ffmpeg wrapper: http://www.sauronsoftware.it/projects/jave/ * JAVE ffmpeg wrapper: http://www.sauronsoftware.it/projects/jave/
* JTattoo: 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 * Icons from, or based on, Oxygen: https://github.com/KDE/oxygen-icons
* JEQ, the Java Equaliser: https://sourceforge.net/projects/jeq/

View File

@@ -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); tabs.add("EQ", eqPanel);