minor aesthetic change; pcm obtainer tweaked;

This commit is contained in:
Harrison Deng 2018-09-04 04:59:43 -05:00
parent ec82f3a5ee
commit 1f1025dcce
2 changed files with 5 additions and 5 deletions

View File

@ -110,8 +110,8 @@ public class PCMObtainer implements Observer, PCMSystem {
private boolean synchronizeBufferWithPlayback() { private boolean synchronizeBufferWithPlayback() {
int bufferPos = calcBufferPosition(); int bufferPos = calcBufferPosition();
if (bufferPos <= playingBuffer.limit() && bufferPos >= 0) {
synchronized (this) { synchronized (this) {
if (bufferPos <= playingBuffer.limit() && bufferPos >= 0) {
playingBuffer.position(bufferPos); playingBuffer.position(bufferPos);
windowsRead = (int) ((mc.getCurrentPosition() * sampleRate) / windowSize); windowsRead = (int) ((mc.getCurrentPosition() * sampleRate) / windowSize);
return true; return true;

View File

@ -56,9 +56,9 @@ public class MainPage extends Page implements Observer {
dhv.setPosition(0, (int) ((getHeight() - dhv.getHeight())/2f)); dhv.setPosition(0, (int) ((getHeight() - dhv.getHeight())/2f));
title = new Image(assetManager.get("title.png", Texture.class)); title = new Image(assetManager.get("title.png", Texture.class));
title.setScale((getHeight()/3f - 14)/title.getHeight()); title.setScale((getHeight()/3f)/title.getHeight());
if (title.getWidth()*title.getScaleX() > getWidth() - 30) { if (title.getWidth()*title.getScaleX() > getWidth() - getWidth()*0.075f) {
title.setScale((getWidth() - 30)/title.getWidth()*getScaleX()); title.setScale((getWidth()*(1f-0.075f))/title.getWidth()*getScaleX());
} }
title.setPosition((getWidth()-title.getWidth()*title.getScaleX())/2f, (getHeight()-title.getHeight()*title.getScaleY())/2f); title.setPosition((getWidth()-title.getWidth()*title.getScaleX())/2f, (getHeight()-title.getHeight()*title.getScaleY())/2f);
addActor(title); addActor(title);