cleaned up some code in visualizer

This commit is contained in:
Harrison Deng 2018-04-15 14:18:35 -05:00
parent abf3028cfb
commit 874ef52bb9
3 changed files with 1 additions and 10 deletions

View File

@ -93,10 +93,6 @@ public class RhythmBullet extends Game {
getrRHandler().setResolution(getPrefs().getInteger("screen-width"), getPrefs().getInteger("screen-height"));
Gdx.app.debug("Prelaunch Debug Info", "\ncurrent window size: "
+ Gdx.graphics.getWidth() + "x" + Gdx.graphics.getHeight() +"\n"
+ "Pixel density (PPI): " + Gdx.graphics.getDensity());
queueAssets();
setScreen(initialScreen);

View File

@ -120,7 +120,7 @@ public class HorizontalVisualizer implements Disposable {
public void setMM(MusicManager mm) {
maxAvgHeight = 0;
currentAvg = 0;
float validBins = (2200/((mm.getSampleRate()/2)/((mm.getReadWindowSize()/2)+1)));
float validBins = (4200/((mm.getSampleRate()/2)/((mm.getReadWindowSize()/2)+1)));
Gdx.app.debug("Visualizer", "valid frequency bins " + validBins);
binsPerBar = MathUtils.round((validBins/barCount));
barHeights = new float[barCount];

View File

@ -103,11 +103,6 @@ public class DesktopVisualizer extends MusicManagerFFT implements Visualizer {
private int updateBufferPosition() {
int pos = (int) ((alGetSourcef(sourceID, AL11.AL_SAMPLE_OFFSET))-buffer.limit()-mm.getChannelCount()*mm.getReadWindowSize());
readWindowIndex = mm.getPlaybackIndexPosition()-1;
if (pos < 0) {
buffer.position(0);
} else {
buffer.position(pos);
}
return pos;
}