diff --git a/core/src/zero1hd/rhythmbullet/audio/visualizer/MirrorVisualizer.java b/core/src/zero1hd/rhythmbullet/audio/visualizer/MirrorVisualizer.java index 2136671..0414585 100755 --- a/core/src/zero1hd/rhythmbullet/audio/visualizer/MirrorVisualizer.java +++ b/core/src/zero1hd/rhythmbullet/audio/visualizer/MirrorVisualizer.java @@ -17,7 +17,7 @@ public class MirrorVisualizer { rectCoordRot = new Vector2(); } - protected void setup(Sprite[] bars, float xPos, float yPos, float rotation) { + public void setup(Sprite[] bars, float xPos, float yPos, float rotation) { this.bars = new Sprite[bars.length]; this.xPos = (int) xPos; this.yPos = (int) yPos; diff --git a/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java b/core/src/zero1hd/rhythmbullet/audio/visualizer/MusicManagerFFT.java similarity index 58% rename from core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java rename to core/src/zero1hd/rhythmbullet/audio/visualizer/MusicManagerFFT.java index 08e9cea..43052d3 100755 --- a/core/src/zero1hd/rhythmbullet/audio/visualizer/VisualizerCore.java +++ b/core/src/zero1hd/rhythmbullet/audio/visualizer/MusicManagerFFT.java @@ -8,21 +8,14 @@ import com.badlogic.gdx.utils.Disposable; import edu.emory.mathcs.jtransforms.fft.FloatFFT_1D; import zero1hd.rhythmbullet.audio.MusicManager; -public class VisualizerCore implements Disposable { +public class MusicManagerFFT implements Disposable { protected MusicManager mm; private FloatFFT_1D fft; - protected float width, height; - protected float xPos, yPos; - protected int barCount; private boolean calc; private ReentrantLock lock; protected float[] audioPCM; - public VisualizerCore(int width, int height, int x, int y) { - this.height = height; - this.width = width; - this.xPos = x; - this.yPos = y; + public MusicManagerFFT() { lock = new ReentrantLock(); } @@ -56,36 +49,6 @@ public class VisualizerCore implements Disposable { public void dispose() { } - public void setxPos(float xPos) { - this.xPos = xPos; - } - - public void setyPos(float yPos) { - this.yPos = yPos; - } - - public void setWidth(float width) { - this.width = width; - } - - public void setHeight(float height) { - this.height = height; - } - - public float getxPos() { - return xPos; - } - public float getyPos() { - return yPos; - } - - public float getWidth() { - return width; - } - public float getHeight() { - return height; - } - public MusicManager getMm() { return mm; } diff --git a/core/src/zero1hd/rhythmbullet/audio/visualizer/BasicVisualizer.java b/desktop/src/zero1hd/rhythmbullet/desktop/audio/visualizer/HorizontalVisualizer.java similarity index 64% rename from core/src/zero1hd/rhythmbullet/audio/visualizer/BasicVisualizer.java rename to desktop/src/zero1hd/rhythmbullet/desktop/audio/visualizer/HorizontalVisualizer.java index c66b467..72977a1 100755 --- a/core/src/zero1hd/rhythmbullet/audio/visualizer/BasicVisualizer.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/audio/visualizer/HorizontalVisualizer.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.audio.visualizer; +package zero1hd.rhythmbullet.desktop.audio.visualizer; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; @@ -12,8 +12,9 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import zero1hd.rhythmbullet.audio.MusicManager; +import zero1hd.rhythmbullet.audio.visualizer.MirrorVisualizer; -public class BasicVisualizer extends VisualizerCore { +public class HorizontalVisualizer extends Visualizer { private Pixmap pixmap; private Texture barTexture; private int barWidth; @@ -30,14 +31,23 @@ public class BasicVisualizer extends VisualizerCore { private boolean reverse; private float maxAvgHeight; private float currentAvg; + private int barCount; + private float width, height, x, y; - public BasicVisualizer() { - super(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()/2, 0, 0); + public HorizontalVisualizer() { + super(); mirrors = new Array<>(); pixmap = new Pixmap(2, 2, Format.RGBA8888); pixmap.setColor(Color.WHITE); pixmap.fill(); barCount = 70; + + width = Gdx.graphics.getWidth(); + height = Gdx.graphics.getHeight()/2f; + x = 0; + y = 0; + + smoothRange = 3; angleRot = new Vector2(MathUtils.cosDeg(rotation), MathUtils.sinDeg(rotation)); bars = new Sprite[barCount]; @@ -65,41 +75,43 @@ public class BasicVisualizer extends VisualizerCore { } public void update(float delta) { - //Averaging bins together - for (int i = 0; i < barCount; i++) { - float barHeight = 0; - for (int j = 0; j < binsPerBar; j++) { - barHeight += Math.abs(audioPCM[j+i*binsPerBar +1]); - } - barHeight /= binsPerBar; - barHeight *= barHeightMultiplier; - barHeights[i] = barHeight; - } - currentAvg = 0; - for (int i = 0; i < barCount; i++) { - int avg = 0; - //Averaging the bars - for (int range = 0; range < smoothRange; range++) { - if (i+range < barCount) { - avg += barHeights[i+range]; + if (mm != null) { + //Averaging bins together + for (int i = 0; i < barCount; i++) { + float barHeight = 0; + for (int j = 0; j < binsPerBar; j++) { + barHeight += Math.abs(audioPCM[j+i*binsPerBar +1]); } - if (i-range >= 0) { - avg += barHeights[i-range]; + barHeight /= binsPerBar; + barHeight *= barHeightMultiplier; + barHeights[i] = barHeight; + } + currentAvg = 0; + for (int i = 0; i < barCount; i++) { + int avg = 0; + //Averaging the bars + for (int range = 0; range < smoothRange; range++) { + if (i+range < barCount) { + avg += barHeights[i+range]; + } + if (i-range >= 0) { + avg += barHeights[i-range]; + } + } + avg /= smoothRange*2; + barHeights[i] = avg; + currentAvg += barHeights[i]; + if (bars[i].getHeight() > barHeights[i]) { + bars[i].setSize(barWidth, bars[i].getHeight() - (15f*delta*(bars[i].getHeight()-barHeights[i]))); + } else { + bars[i].setSize(barWidth, bars[i].getHeight() + (20f*delta*(barHeights[i] - bars[i].getHeight()))); } } - avg /= smoothRange*2; - barHeights[i] = avg; - currentAvg += barHeights[i]; - if (bars[i].getHeight() > barHeights[i]) { - bars[i].setSize(barWidth, bars[i].getHeight() - (15f*delta*(bars[i].getHeight()-barHeights[i]))); - } else { - bars[i].setSize(barWidth, bars[i].getHeight() + (20f*delta*(barHeights[i] - bars[i].getHeight()))); + currentAvg /= barHeights.length; + if (currentAvg > maxAvgHeight) { + maxAvgHeight = currentAvg; } } - currentAvg /= barHeights.length; - if (currentAvg > maxAvgHeight) { - maxAvgHeight = currentAvg; - } } @Override @@ -134,9 +146,9 @@ public class BasicVisualizer extends VisualizerCore { bars[i].setRotation(rotation); } if (reverse) { - bars[bars.length-i-1].setPosition(xPos + barSpace*angleRot.x, yPos + barSpace*angleRot.y); + bars[bars.length-i-1].setPosition(x + barSpace*angleRot.x, y + barSpace*angleRot.y); } else { - bars[i].setPosition(xPos + barSpace*angleRot.x, yPos + barSpace*angleRot.y); + bars[i].setPosition(x + barSpace*angleRot.x, y + barSpace*angleRot.y); } for (int mirrorIndex = 0; mirrorIndex < mirrors.size; mirrorIndex++) { mirrors.get(mirrorIndex).position(i, barWidth, spaceBetweenBars); @@ -181,9 +193,9 @@ public class BasicVisualizer extends VisualizerCore { public void addMirrorVisualizer(MirrorVisualizer mirror) { updatePositionInfo(); - mirror.setup(bars, xPos, yPos, rotation); + mirror.setup(bars, x, y, rotation); mirrors.add(mirror); - setxPos(((getWidth() - getActualWidth())/2f)); + x = (int) (((width - getActualWidth())/2f)); } public void removeMirrorVisualizer(MirrorVisualizer mirror) { @@ -221,4 +233,36 @@ public class BasicVisualizer extends VisualizerCore { public int getSpaceBetweenBars() { return spaceBetweenBars; } + + public void setX(float x) { + this.x = x; + } + + public float getX() { + return x; + } + + public void setY(float y) { + this.y = y; + } + + public float getY() { + return y; + } + + public void setWidth(float width) { + this.width = width; + } + + public float getWidth() { + return width; + } + + public void setHeight(float height) { + this.height = height; + } + + public float getHeight() { + return height; + } } diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/Visualizer.java b/desktop/src/zero1hd/rhythmbullet/desktop/audio/visualizer/Visualizer.java similarity index 52% rename from desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/Visualizer.java rename to desktop/src/zero1hd/rhythmbullet/desktop/audio/visualizer/Visualizer.java index 46e536e..24302ac 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/Visualizer.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/audio/visualizer/Visualizer.java @@ -1,218 +1,126 @@ -package zero1hd.rhythmbullet.desktop.graphics.ui.components; - -import static org.lwjgl.openal.AL10.*; - -import java.nio.ByteBuffer; -import java.nio.ShortBuffer; - -import org.lwjgl.openal.AL11; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.backends.lwjgl.audio.OpenALMusic; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.Batch; -import com.badlogic.gdx.scenes.scene2d.ui.Widget; -import com.badlogic.gdx.utils.Disposable; -import com.badlogic.gdx.utils.reflect.ClassReflection; -import com.badlogic.gdx.utils.reflect.Field; -import com.badlogic.gdx.utils.reflect.ReflectionException; - -import zero1hd.rhythmbullet.audio.MusicManager; -import zero1hd.rhythmbullet.audio.visualizer.BasicVisualizer; - -public class Visualizer extends Widget implements Disposable { - private BasicVisualizer vis; - private boolean updatePositioning = true; - private boolean mmSet; - private MusicManager mm; - private ShortBuffer playingBuffer; - private ShortBuffer compareBuffer; - private ShortBuffer buffer; - private int sourceID; - private float visRefreshRate; - private float timer; - private int readWindowIndex; - public Visualizer() { - vis = new BasicVisualizer(); - - try { - Field bufferField = ClassReflection.getDeclaredField(OpenALMusic.class, "tempBuffer"); - bufferField.setAccessible(true); - buffer = ((ByteBuffer) bufferField.get(null)).asShortBuffer().asReadOnlyBuffer(); - } catch (IllegalArgumentException | SecurityException | ReflectionException e) { - e.printStackTrace(); - Gdx.app.debug("Visualizer reflection", "Failed attempt at retrieving tempBuffer field."); - Gdx.app.exit(); - } - - } - - @Override - public void draw(Batch batch, float parentAlpha) { - vis.render(batch, parentAlpha); - super.draw(batch, parentAlpha); - } - - @Override - public void act(float delta) { - if (mm != null && mm.isFinishedLoading() && !mmSet) { - vis.setMM(mm); - visRefreshRate = mm.getReadWindowSize()/mm.getSampleRate(); - mmSet = true; - Gdx.app.debug("Visualizer", "\nsample count: " + mm.getSampleCount() - + "\nDuration in seconds: " + mm.getDuration() + - "\nSample rate: " + mm.getSampleRate() + - "\nRefresh rate: " + visRefreshRate); - } - - vis.update(delta); - updateVisualizerProperties(); - if (updatePositioning) { - vis.updatePositionInfo(); - vis.setxPos((getWidth() - vis.getActualWidth())/2f); - } - if (mmSet) { - if (timer >= visRefreshRate) { - timer = 0; - calcPCMData(); - vis.calculate(delta); - } else { - timer += delta; - } - } - super.act(delta); - } - - public void calcPCMData() { - short chanVal; - int bufferPosOffset = 0; - if (mm.playbackIndexUpdate() != readWindowIndex) { - bufferPosOffset = updateBufferPosition(); - if (bufferPosOffset < 0 && playingBuffer.limit()+bufferPosOffset > 0) { - playingBuffer.position(playingBuffer.limit()+bufferPosOffset); - } - } - - for (int sid = 0; sid < vis.getAudioPCM().length && sid < buffer.remaining(); sid++) { - for (int channel = 0; channel < mm.getChannelCount(); channel ++) { - if (playingBuffer.position() < playingBuffer.limit()) { - if (vis.getAudioPCM()[sid] < (chanVal = playingBuffer.get())) { - vis.getAudioPCM()[sid] = chanVal; - } - } else { - if (vis.getAudioPCM()[sid] < (chanVal = buffer.get())) { - vis.getAudioPCM()[sid] = chanVal; - } - } - } - vis.getAudioPCM()[sid] /= Short.MAX_VALUE+1f; - } - readWindowIndex++; - - - //Take down original buffer position so we don't need to sync again after... - int originalPos = buffer.position(); - - //Begin comparison - buffer.rewind(); - if (compareBuffer.compareTo(buffer) != 0) { - bufferChanged(); - - - //Begin copying current buffer to the comparison buffer - compareBuffer.clear(); - compareBuffer.put(buffer); - compareBuffer.flip(); - } - - //Reset buffer to proper position. - buffer.position(originalPos); - } - - private void bufferChanged() { - playingBuffer.clear(); - playingBuffer.put(compareBuffer); - } - - 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; - } - - public void setMM(MusicManager mm) { - try { - Field sourceIDField = ClassReflection.getDeclaredField(OpenALMusic.class, "sourceID"); - sourceIDField.setAccessible(true); - sourceID = (int) sourceIDField.get(mm.getMusic()); - } catch (ReflectionException e) { - e.printStackTrace(); - } - int originalPos = buffer.position(); - - playingBuffer = ShortBuffer.allocate(buffer.capacity()); - buffer.rewind(); - playingBuffer.put(buffer); - playingBuffer.flip(); - - compareBuffer = ShortBuffer.allocate(buffer.capacity()); - buffer.rewind(); - compareBuffer.put(buffer); - compareBuffer.flip(); - - buffer.position(originalPos); - this.mm = mm; - mmSet = false; - } - - @Override - public void setColor(Color color) { - vis.setColor(color); - super.setColor(color); - } - - @Override - public void setColor(float r, float g, float b, float a) { - vis.setColor(r, g, b, a); - super.setColor(r, g, b, a); - } - - public void updateVisualizerProperties() { - vis.setHeight(getHeight()); - vis.setWidth(getWidth()); - vis.setxPos(getX()); - vis.setyPos(getY()); - vis.setRotation(getRotation()); - } - - public void setUpdatePositioning(boolean updatePositioning) { - updateVisualPosition(); - this.updatePositioning = updatePositioning; - } - - public void updateVisualPosition() { - updateVisualizerProperties(); - vis.updatePositionInfo(); - vis.setxPos(((vis.getWidth() - vis.getActualWidth())/2f)); - vis.updatePositionInfo(); - } - - public boolean isUpdatePositioning() { - return updatePositioning; - } - - public BasicVisualizer getVis() { - return vis; - } - - @Override - public void dispose() { - vis.dispose(); - } - -} +package zero1hd.rhythmbullet.desktop.audio.visualizer; + +import static org.lwjgl.openal.AL10.alGetSourcef; + +import java.nio.ByteBuffer; +import java.nio.ShortBuffer; + +import org.lwjgl.openal.AL11; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.backends.lwjgl.audio.OpenALMusic; +import com.badlogic.gdx.utils.reflect.ClassReflection; +import com.badlogic.gdx.utils.reflect.Field; +import com.badlogic.gdx.utils.reflect.ReflectionException; + +import zero1hd.rhythmbullet.audio.MusicManager; +import zero1hd.rhythmbullet.audio.visualizer.MusicManagerFFT; + +public class Visualizer extends MusicManagerFFT { + private ShortBuffer playingBuffer; + private ShortBuffer compareBuffer; + private ShortBuffer buffer; + private int sourceID; + private int readWindowIndex; + + public Visualizer() { + super(); + try { + Field bufferField = ClassReflection.getDeclaredField(OpenALMusic.class, "tempBuffer"); + bufferField.setAccessible(true); + buffer = ((ByteBuffer) bufferField.get(null)).asShortBuffer().asReadOnlyBuffer(); + } catch (IllegalArgumentException | SecurityException | ReflectionException e) { + e.printStackTrace(); + Gdx.app.debug("Visualizer reflection", "Failed attempt at retrieving tempBuffer field."); + Gdx.app.exit(); + } + } + + public void calcPCMData() { + short chanVal; + int bufferPosOffset = 0; + if (mm.playbackIndexUpdate() != readWindowIndex) { + bufferPosOffset = updateBufferPosition(); + if (bufferPosOffset < 0 && playingBuffer.limit()+bufferPosOffset > 0) { + playingBuffer.position(playingBuffer.limit()+bufferPosOffset); + } + } + + for (int sid = 0; sid < getAudioPCM().length && sid < buffer.remaining(); sid++) { + for (int channel = 0; channel < mm.getChannelCount(); channel ++) { + if (playingBuffer.position() < playingBuffer.limit()) { + if (getAudioPCM()[sid] < (chanVal = playingBuffer.get())) { + getAudioPCM()[sid] = chanVal; + } + } else { + if (getAudioPCM()[sid] < (chanVal = buffer.get())) { + getAudioPCM()[sid] = chanVal; + } + } + } + getAudioPCM()[sid] /= Short.MAX_VALUE+1f; + } + readWindowIndex++; + + + //Take down original buffer position so we don't need to sync again after... + int originalPos = buffer.position(); + + //Begin comparison + buffer.rewind(); + if (compareBuffer.compareTo(buffer) != 0) { + bufferChanged(); + + + //Begin copying current buffer to the comparison buffer + compareBuffer.clear(); + compareBuffer.put(buffer); + compareBuffer.flip(); + } + + //Reset buffer to proper position. + buffer.position(originalPos); + } + + private void bufferChanged() { + playingBuffer.clear(); + playingBuffer.put(compareBuffer); + } + + 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; + } + + public void setMM(MusicManager mm) { + try { + Field sourceIDField = ClassReflection.getDeclaredField(OpenALMusic.class, "sourceID"); + sourceIDField.setAccessible(true); + sourceID = (int) sourceIDField.get(mm.getMusic()); + } catch (ReflectionException e) { + e.printStackTrace(); + } + int originalPos = buffer.position(); + + playingBuffer = ShortBuffer.allocate(buffer.capacity()); + buffer.rewind(); + playingBuffer.put(buffer); + playingBuffer.flip(); + + compareBuffer = ShortBuffer.allocate(buffer.capacity()); + buffer.rewind(); + compareBuffer.put(buffer); + compareBuffer.flip(); + + buffer.position(originalPos); + this.mm = mm; + + super.setMM(mm); + } +} diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/HorizontalVisualizerWidget.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/HorizontalVisualizerWidget.java new file mode 100755 index 0000000..9dab8b6 --- /dev/null +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/HorizontalVisualizerWidget.java @@ -0,0 +1,110 @@ +package zero1hd.rhythmbullet.desktop.graphics.ui.components; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.scenes.scene2d.ui.Widget; +import com.badlogic.gdx.utils.Disposable; + +import zero1hd.rhythmbullet.audio.MusicManager; +import zero1hd.rhythmbullet.desktop.audio.visualizer.HorizontalVisualizer; + +public class HorizontalVisualizerWidget extends Widget implements Disposable { + private HorizontalVisualizer vis; + private boolean updatePositioning = true; + private MusicManager mm; + private boolean initialLoad; + private float visRefreshRate; + private float timer; + public HorizontalVisualizerWidget() { + vis = new HorizontalVisualizer(); + } + + @Override + public void draw(Batch batch, float parentAlpha) { + vis.render(batch, parentAlpha); + super.draw(batch, parentAlpha); + } + + @Override + public void act(float delta) { + if (mm != null && mm.isFinishedLoading() && !initialLoad) { + visRefreshRate = mm.getReadWindowSize()/mm.getSampleRate(); + Gdx.app.debug("Visualizer", "\nsample count: " + mm.getSampleCount() + + "\nDuration in seconds: " + mm.getDuration() + + "\nSample rate: " + mm.getSampleRate() + + "\nRefresh rate: " + visRefreshRate); + vis.setMM(mm); + initialLoad = true; + } + + if (updatePositioning) { + vis.updatePositionInfo(); + vis.setX((getWidth() - vis.getActualWidth())/2f); + } + + vis.update(delta); + updateVisualizerProperties(); + if (mm != null && initialLoad) { + if (timer >= visRefreshRate) { + timer = 0; + vis.calcPCMData(); + vis.calculate(delta); + } else { + timer += delta; + } + } + super.act(delta); + } + + public void setMM(MusicManager mm) { + initialLoad = false; + this.mm = mm; + } + + @Override + public void setColor(Color color) { + vis.setColor(color); + super.setColor(color); + } + + @Override + public void setColor(float r, float g, float b, float a) { + vis.setColor(r, g, b, a); + super.setColor(r, g, b, a); + } + + public void updateVisualizerProperties() { + vis.setHeight(getHeight()); + vis.setWidth(getWidth()); + vis.setX(getX()); + vis.setY(getY()); + vis.setRotation(getRotation()); + } + + public void setUpdatePositioning(boolean updatePositioning) { + updateVisualPosition(); + this.updatePositioning = updatePositioning; + } + + public void updateVisualPosition() { + updateVisualizerProperties(); + vis.updatePositionInfo(); + vis.setX(((vis.getWidth() - vis.getActualWidth())/2f)); + vis.updatePositionInfo(); + } + + public boolean isUpdatePositioning() { + return updatePositioning; + } + + public HorizontalVisualizer getVis() { + return vis; + } + + @Override + public void dispose() { + vis.dispose(); + } + +} diff --git a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/TitleBarVisualizer.java b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/TitleBarVisualizer.java index b2bb169..0cc30b3 100755 --- a/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/TitleBarVisualizer.java +++ b/desktop/src/zero1hd/rhythmbullet/desktop/graphics/ui/components/TitleBarVisualizer.java @@ -19,7 +19,7 @@ import com.badlogic.gdx.utils.Disposable; import zero1hd.rhythmbullet.audio.visualizer.MirrorVisualizer; public class TitleBarVisualizer extends Group implements Disposable { - private Visualizer visual; + private HorizontalVisualizerWidget visual; private MirrorVisualizer visual2; private Texture bgTexture; private Image bg; @@ -32,7 +32,7 @@ public class TitleBarVisualizer extends Group implements Disposable { private float particleLimitTime; public TitleBarVisualizer(AssetManager assets) { if (assets == null) throw new NullPointerException("TitleBarVisualizer requires assets manager... ITS NULL YOU FOOL"); - visual = new Visualizer(); + visual = new HorizontalVisualizerWidget(); visual.getVis().setSpaceBetweenBars(visual.getVis().getBarWidth()- 2); addActor(visual); @@ -110,7 +110,7 @@ public class TitleBarVisualizer extends Group implements Disposable { super.draw(batch, parentAlpha); } - public Visualizer getHvisual() { + public HorizontalVisualizerWidget getHvisual() { return visual; }