will not reload everytime minimized; minor visualizer tweaks; fixed non shuffle out of bounds issue; progress on analysis page

This commit is contained in:
2018-01-15 15:55:51 -06:00
parent 36eb547943
commit da76c05435
5 changed files with 30 additions and 14 deletions

View File

@@ -68,8 +68,6 @@ public class Mp3Manager implements MusicManager {
channels = mp3File.getAudioHeader().getChannels().equals("Mono") ? 1:2;
sampleCount = MathUtils.round(Float.valueOf((float) (sampleRate*durationInSeconds))) * channels;
//Rounding error probably?
sampleCount += readWindowSize*2;
} catch (IOException | TagException | ReadOnlyFileException | InvalidAudioFrameException e) {
e.printStackTrace();
}

View File

@@ -75,6 +75,12 @@ public class MusicListController extends Observable implements OnCompletionListe
} else {
currentPlaybackID++;
}
if (currentPlaybackID >= musicList.getTotal()) {
currentPlaybackID = 0;
} else if (currentPlaybackID < 0) {
currentPlaybackID = musicList.getTotal()-1;
}
loadMusic();
play();
}

View File

@@ -22,6 +22,7 @@ public class AnalysisPage extends Page {
private Label diffModPercentLabel, heltModPercentLabel, speeModPercentLabel;
private Label progressLabel;
private TextButton confirmButton;
public AnalysisPage(Skin skin, AssetManager assets) {
setTextureBackground(assets.get("gradients.atlas", TextureAtlas.class).findRegion("red-round"));
table = new Table();
@@ -75,6 +76,9 @@ public class AnalysisPage extends Page {
public void changed(ChangeEvent event, Actor actor) {
confirmed = true;
confirmButton.setDisabled(true);
speedModifierSlider.setDisabled(true);
healthModifierSlider.setDisabled(true);
difficultyModifierSlider.setDisabled(true);
}
});
@@ -85,6 +89,10 @@ public class AnalysisPage extends Page {
}
public void processSong(MusicManager mm) {
confirmButton.setDisabled(false);
speedModifierSlider.setDisabled(false);
healthModifierSlider.setDisabled(false);
difficultyModifierSlider.setDisabled(false);
aa = new AudioAnalyzer(mm);
aa.start();
}