mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-05 01:54:18 +00:00
Added #2259 Optional resampling sound to 44kHz on playback and on export
This commit is contained in:
@@ -72,6 +72,8 @@ public class PlayerControls extends JPanel implements MediaDisplayListener {
|
||||
private final JButton pauseButton;
|
||||
|
||||
private final JButton loopButton;
|
||||
|
||||
private final JToggleButton resampleButton;
|
||||
|
||||
private MediaDisplay display;
|
||||
|
||||
@@ -92,6 +94,8 @@ public class PlayerControls extends JPanel implements MediaDisplayListener {
|
||||
private static final Icon loopIcon = View.getIcon("loopon16");
|
||||
|
||||
private static final Icon noLoopIcon = View.getIcon("loopoff16");
|
||||
|
||||
private static final Icon resampleIcon = View.getIcon("resample16");
|
||||
|
||||
private final JLabel percentLabel = new JLabel("100%");
|
||||
|
||||
@@ -317,9 +321,17 @@ public class PlayerControls extends JPanel implements MediaDisplayListener {
|
||||
loopButton.addActionListener(this::loopButtonActionPerformed);
|
||||
boolean loop = Configuration.loopMedia.get();
|
||||
loopButton.setIcon(loop ? loopIcon : noLoopIcon);
|
||||
|
||||
resampleButton = new JToggleButton(resampleIcon);
|
||||
resampleButton.setToolTipText(AppStrings.translate("preview.resample"));
|
||||
resampleButton.setMargin(new Insets(4, 2, 2, 2));
|
||||
resampleButton.addActionListener(this::resampleButtonActionPerformed);
|
||||
resampleButton.setSelected(Configuration.previewResampleSound.get());
|
||||
|
||||
buttonsPanel.add(pauseButton);
|
||||
buttonsPanel.add(stopButton);
|
||||
buttonsPanel.add(loopButton);
|
||||
buttonsPanel.add(resampleButton);
|
||||
controlPanel.add(buttonsPanel, BorderLayout.CENTER);
|
||||
|
||||
progress = new JProgressBar();
|
||||
@@ -506,6 +518,12 @@ public class PlayerControls extends JPanel implements MediaDisplayListener {
|
||||
loopButton.setIcon(loop ? loopIcon : noLoopIcon);
|
||||
display.setLoop(loop);
|
||||
}
|
||||
|
||||
private void resampleButtonActionPerformed(ActionEvent evt) {
|
||||
boolean resample = resampleButton.isSelected();
|
||||
Configuration.previewResampleSound.set(resample);
|
||||
display.setResample(resample);
|
||||
}
|
||||
|
||||
private void gotoFrameButtonActionPerformed(ActionEvent evt) {
|
||||
final JPanel gotoPanel = new JPanel(new BorderLayout());
|
||||
|
||||
Reference in New Issue
Block a user