cleaned up some code in visualizer
This commit is contained in:
parent
abf3028cfb
commit
874ef52bb9
@ -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);
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user