From 17049220c2bca495646f54d9e48b5b5e51404a9d Mon Sep 17 00:00:00 2001 From: Recrown Date: Fri, 26 May 2017 11:45:10 -0500 Subject: [PATCH] continued revisions on creative stage and analysis --- core/src/zero1hd/polyjet/audio/AudioAnalyzer.java | 1 + core/src/zero1hd/polyjet/ui/windows/BeatViewer.java | 12 +++++++----- core/src/zero1hd/polyjet/ui/windows/GraphWindow.java | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java b/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java index 56b1438..950c744 100755 --- a/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java +++ b/core/src/zero1hd/polyjet/audio/AudioAnalyzer.java @@ -281,6 +281,7 @@ public class AudioAnalyzer { } public float getBassMaxValue() { + Gdx.app.debug("Analyzer", "Max Base Value: " + bassMaxValue); return bassMaxValue; } diff --git a/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java b/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java index 7ab49ca..e0a97bd 100755 --- a/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java +++ b/core/src/zero1hd/polyjet/ui/windows/BeatViewer.java @@ -40,7 +40,7 @@ public class BeatViewer extends Window { final Image bassBarFill = new Image(core.getDefaultSkin().getPatch("bar-fill")) { @Override public void act(float delta) { - if (music != null && data.getBassPeaks().get(songIndex) >= 1f) { + if (music != null && data.getBassPeaks().get(songIndex) != 0) { clearActions(); addAction(Actions.sequence(Actions.sizeTo(getWidth(), (data.getBassPeaks().get(songIndex)/data.getBassMaxValue())*bgBassBar.getHeight()), Actions.sizeTo(getWidth(), 0, 0.3f))); } @@ -59,7 +59,7 @@ public class BeatViewer extends Window { Image UMBarFill = new Image(core.getDefaultSkin().getPatch("bar-fill")) { @Override public void act(float delta) { - if (music != null && data.getUMPeaks().get(songIndex) >= 1f) { + if (music != null && data.getUMPeaks().get(songIndex) != 0) { clearActions(); addAction(Actions.sequence(Actions.sizeTo(getWidth(), (data.getUMPeaks().get(songIndex)/data.getUMMaxValue())*bgUMBar.getHeight()), Actions.sizeTo(getWidth(), 0f, 0.3f))); } @@ -77,7 +77,7 @@ public class BeatViewer extends Window { Image bassIndicator = new Image(lightOn) { @Override public void act(float delta) { - if (music != null && data.getBassPeaks().get(songIndex) >= 2) { + if (music != null && data.getBassPeaks().get(songIndex) != 0) { clearActions(); addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f))); } @@ -92,7 +92,7 @@ public class BeatViewer extends Window { Image UMIndicator = new Image(lightOn) { @Override public void act(float delta) { - if (music != null && data.getUMPeaks().get(songIndex) >= 1) { + if (music != null && data.getUMPeaks().get(songIndex) != 0) { clearActions(); addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f))); } @@ -105,7 +105,9 @@ public class BeatViewer extends Window { @Override public void act(float delta) { - songIndex = music.getReadIndex(); + if (music != null) { + songIndex = music.getReadIndex(); + } super.act(delta); } diff --git a/core/src/zero1hd/polyjet/ui/windows/GraphWindow.java b/core/src/zero1hd/polyjet/ui/windows/GraphWindow.java index a1e88bc..18e05c1 100755 --- a/core/src/zero1hd/polyjet/ui/windows/GraphWindow.java +++ b/core/src/zero1hd/polyjet/ui/windows/GraphWindow.java @@ -20,7 +20,9 @@ public class GraphWindow extends Window { @Override public void act(float delta) { - graph.setAudioDataIndex(audioData.getReadIndex()); + if (audioData != null) { + graph.setAudioDataIndex(audioData.getReadIndex()); + } super.act(delta); }