Next track on trackEnded

(but checks trackended every update...)
Continue playing while minimized(does not fix moving)
start from preview time in songMenu on repeat
This commit is contained in:
fd
2015-03-07 13:29:29 -05:00
parent cf6e87f6f2
commit 11b5c41b46
4 changed files with 13 additions and 4 deletions

View File

@@ -70,8 +70,9 @@ public class MusicController {
* @param osu the OsuFile to play
* @param loop whether or not to loop the track
* @param preview whether to start at the preview time (true) or beginning (false)
* @param reset plays at the preview time even if it has the same preview time as the last
*/
public static void play(final OsuFile osu, final boolean loop, final boolean preview) {
public static void play(final OsuFile osu, final boolean loop, final boolean preview, final boolean reset) {
// new track: load and play
if (lastOsu == null || !osu.audioFilename.equals(lastOsu.audioFilename)) {
reset();
@@ -94,7 +95,7 @@ public class MusicController {
}
// new track position: play at position
else if (osu.previewTime != lastOsu.previewTime)
else if (osu.previewTime != lastOsu.previewTime || reset)
playAt(osu.previewTime, loop);
lastOsu = osu;
@@ -282,7 +283,7 @@ public class MusicController {
public static void playThemeSong() {
OsuFile osu = Options.getOsuTheme();
if (osu != null) {
play(osu, true, false);
play(osu, true, false, false);
themePlaying = true;
}
}