continued revisions on creative stage and analysis

This commit is contained in:
Harrison Deng 2017-05-26 11:45:10 -05:00
parent 59647b97f1
commit 17049220c2
3 changed files with 11 additions and 6 deletions

View File

@ -281,6 +281,7 @@ public class AudioAnalyzer {
} }
public float getBassMaxValue() { public float getBassMaxValue() {
Gdx.app.debug("Analyzer", "Max Base Value: " + bassMaxValue);
return bassMaxValue; return bassMaxValue;
} }

View File

@ -40,7 +40,7 @@ public class BeatViewer extends Window {
final Image bassBarFill = new Image(core.getDefaultSkin().getPatch("bar-fill")) { final Image bassBarFill = new Image(core.getDefaultSkin().getPatch("bar-fill")) {
@Override @Override
public void act(float delta) { public void act(float delta) {
if (music != null && data.getBassPeaks().get(songIndex) >= 1f) { if (music != null && data.getBassPeaks().get(songIndex) != 0) {
clearActions(); clearActions();
addAction(Actions.sequence(Actions.sizeTo(getWidth(), (data.getBassPeaks().get(songIndex)/data.getBassMaxValue())*bgBassBar.getHeight()), Actions.sizeTo(getWidth(), 0, 0.3f))); 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")) { Image UMBarFill = new Image(core.getDefaultSkin().getPatch("bar-fill")) {
@Override @Override
public void act(float delta) { public void act(float delta) {
if (music != null && data.getUMPeaks().get(songIndex) >= 1f) { if (music != null && data.getUMPeaks().get(songIndex) != 0) {
clearActions(); clearActions();
addAction(Actions.sequence(Actions.sizeTo(getWidth(), (data.getUMPeaks().get(songIndex)/data.getUMMaxValue())*bgUMBar.getHeight()), Actions.sizeTo(getWidth(), 0f, 0.3f))); 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) { Image bassIndicator = new Image(lightOn) {
@Override @Override
public void act(float delta) { public void act(float delta) {
if (music != null && data.getBassPeaks().get(songIndex) >= 2) { if (music != null && data.getBassPeaks().get(songIndex) != 0) {
clearActions(); clearActions();
addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f))); addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f)));
} }
@ -92,7 +92,7 @@ public class BeatViewer extends Window {
Image UMIndicator = new Image(lightOn) { Image UMIndicator = new Image(lightOn) {
@Override @Override
public void act(float delta) { public void act(float delta) {
if (music != null && data.getUMPeaks().get(songIndex) >= 1) { if (music != null && data.getUMPeaks().get(songIndex) != 0) {
clearActions(); clearActions();
addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f))); addAction(Actions.sequence(Actions.alpha(1f), Actions.fadeOut(0.15f)));
} }
@ -105,7 +105,9 @@ public class BeatViewer extends Window {
@Override @Override
public void act(float delta) { public void act(float delta) {
songIndex = music.getReadIndex(); if (music != null) {
songIndex = music.getReadIndex();
}
super.act(delta); super.act(delta);
} }

View File

@ -20,7 +20,9 @@ public class GraphWindow extends Window {
@Override @Override
public void act(float delta) { public void act(float delta) {
graph.setAudioDataIndex(audioData.getReadIndex()); if (audioData != null) {
graph.setAudioDataIndex(audioData.getReadIndex());
}
super.act(delta); super.act(delta);
} }