From 2c9fd2ecfdc2d81cb82ca89d217537df03738ac1 Mon Sep 17 00:00:00 2001 From: Recrown Date: Mon, 15 Jan 2018 17:07:01 -0600 Subject: [PATCH] cleaned up look and progress on music selection page --- .../ui/components/MusicSelectable.java | 20 +------------------ .../graphics/ui/pages/AnalysisPage.java | 4 ++++ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/MusicSelectable.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/MusicSelectable.java index 7218e69..1eafe95 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/MusicSelectable.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/MusicSelectable.java @@ -4,7 +4,6 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.scenes.scene2d.InputEvent; -import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup; @@ -18,8 +17,6 @@ public class MusicSelectable extends WidgetGroup implements Disposable { private Table table; private ShortenedTextLabel displayName; - private Label durationLabel; - private ShortenedTextLabel authorLabel; private boolean selected; @@ -40,12 +37,6 @@ public class MusicSelectable extends WidgetGroup implements Disposable { displayName = new ShortenedTextLabel(musicFile.nameWithoutExtension().replace('_', ' '), skin, "sub-font", skin.getColor("default")); table.add(displayName); - durationLabel = new Label("Loading...", skin, "sub-font", skin.getColor("default")); - table.add(durationLabel); - - authorLabel = new ShortenedTextLabel("Loading...", skin, "sub-font", skin.getColor("default")); - table.add(authorLabel); - table.pack(); addActor(table); addListener(new ClickListener() { @@ -66,22 +57,13 @@ public class MusicSelectable extends WidgetGroup implements Disposable { Gdx.app.debug("MusicSelectable", "Updating info for: " + getName()); this.musicInfo = musicInfo; displayName.setOriginalText(musicInfo.getMusicName()); - durationLabel.setText("Runtime: " - + ((musicInfo.getDurationInSeconds() / 60 < 1) ? "00" : musicInfo.getDurationInSeconds() / 60) + ":" - + ((musicInfo.getDurationInSeconds() - (musicInfo.getDurationInSeconds() / 60) * 60) < 10 - ? "0" + (musicInfo.getDurationInSeconds() - (musicInfo.getDurationInSeconds() / 60) * 60) - : (musicInfo.getDurationInSeconds() - (musicInfo.getDurationInSeconds() / 60) * 60))); - authorLabel.setOriginalText("Author: " + musicInfo.getAuthor()); - authorLabel.setToOriginalText(); } @Override public void layout() { - displayName.setTargetWidth((int) (getWidth()*0.43f)); - authorLabel.setTargetWidth((int) (getWidth()/3f)); + displayName.setTargetWidth((int) (getWidth()*0.8f)); displayName.resize(); - authorLabel.resize(); super.layout(); } diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java index d319561..12fe422 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/pages/AnalysisPage.java @@ -93,6 +93,10 @@ public class AnalysisPage extends Page { speedModifierSlider.setDisabled(false); healthModifierSlider.setDisabled(false); difficultyModifierSlider.setDisabled(false); + if (aa != null) { + aa.dispose(); + } + aa = new AudioAnalyzer(mm); aa.start(); }