From f11dfc53780298d79b6182be05380fe71f202d25 Mon Sep 17 00:00:00 2001 From: Downforce Agent Date: Sun, 21 Jul 2024 16:58:27 -0500 Subject: [PATCH] fix playlist zombification --- firestar/src/main/java/Clifford.java | 2 +- firestar/src/main/java/Suggs.form | 27 ++++++++++++++++++++++----- firestar/src/main/java/Suggs.java | 10 +++++++++- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/firestar/src/main/java/Clifford.java b/firestar/src/main/java/Clifford.java index c73a217..d8057df 100644 --- a/firestar/src/main/java/Clifford.java +++ b/firestar/src/main/java/Clifford.java @@ -222,8 +222,8 @@ public class Clifford implements ActionListener { container.put("loaderversion", 1); if (isSoundtrack) { ArrayList requiresTemp = new ArrayList<>(); - requiresTemp.add(new boolean[]{true, false, false, false}); requiresTemp.add(new boolean[]{false, true, false, false}); + requiresTemp.add(new boolean[]{true, false, false, false}); container.put("requires", requiresTemp); // Pull localization files for patching. } } else { diff --git a/firestar/src/main/java/Suggs.form b/firestar/src/main/java/Suggs.form index f12efc1..ef427f2 100644 --- a/firestar/src/main/java/Suggs.form +++ b/firestar/src/main/java/Suggs.form @@ -40,7 +40,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -67,25 +67,27 @@ - + - + + + - + @@ -96,6 +98,21 @@ + + + + + + + + + + + + + + + diff --git a/firestar/src/main/java/Suggs.java b/firestar/src/main/java/Suggs.java index a7fd65f..8f768d7 100644 --- a/firestar/src/main/java/Suggs.java +++ b/firestar/src/main/java/Suggs.java @@ -73,10 +73,12 @@ public class Suggs implements ActionListener, ListSelectionListener { private JCheckBox checkAdditive; private JButton spDeleteBtn; private JButton mpDeleteBtn; + private JCheckBox checkNormalize; private Scooter progressDialog; JFrame parent; int curIndex = -1; + boolean normalizeVolumes = false; public class AudioTrack { public File path; // file name @@ -85,7 +87,7 @@ public class Suggs implements ActionListener, ListSelectionListener { public long size; // file size in bytes public boolean noConvert; } - private static List tracklist = new ArrayList(); + private List tracklist = new ArrayList(); private File sptrack; private File mptrack; @@ -379,6 +381,7 @@ public class Suggs implements ActionListener, ListSelectionListener { private void save() { frame.setEnabled(false); frame.setAlwaysOnTop(false); + normalizeVolumes = checkNormalize.isSelected(); Main.deleteDir(new File(System.getProperty("user.home") + "/.firestar/temp/")); // starts with clean temp new Thread(() -> { int progressSize = tracklist.size()+(sptrack != null?1:0)+(mptrack != null?1:0)+1; // Accounting for processes @@ -423,6 +426,11 @@ public class Suggs implements ActionListener, ListSelectionListener { p.waitFor(); at.path = new File(Main.inpath + "temp/ffmpeg/" + at.path.getName() + ".wav"); } + if (normalizeVolumes) { // normalize tracks + Process p = Main.exec(new String[]{Main.inpath + "ffmpeg.exe", "-i", at.path.getPath(), "-filter:a loudnorm=linear=true:i=-5.0:lra=7.0:tp=0.0", "ffmpeg/" + at.path.getName() + "_normalized.wav"}, Main.inpath + "temp/"); + p.waitFor(); + at.path = new File(Main.inpath + "temp/ffmpeg/" + at.path.getName() + "_normalized.wav"); + } Process p = Main.exec(new String[]{Main.inpath + "at9tool.exe", "-e", "-br", "144", at.path.getPath(), "data/audio/music/" + trackno + "/music_stereo.at9"}, Main.inpath + "temp/"); p.waitFor(); } catch (IOException | InterruptedException ex) {