Implement playback speed in replays.

This commit is contained in:
Pavel Kolchev
2015-04-02 19:38:45 +03:00
parent 5f3ce74c64
commit d8425197a7
8 changed files with 105 additions and 9 deletions

View File

@@ -279,13 +279,13 @@ public class MusicController {
* Plays the current track.
* @param loop whether or not to loop the track
*/
public static void play(float pitch, boolean loop) {
public static void play(boolean loop) {
if (trackExists()) {
trackEnded = false;
if (loop)
player.loop();
else
player.play(pitch, 1f);
player.play();
}
}
@@ -297,6 +297,14 @@ public class MusicController {
SoundStore.get().setMusicVolume((isTrackDimmed()) ? volume * dimLevel : volume);
}
/**
* Sets the music pitch.
* @param pitch [0, ..]
*/
public static void setPitch(float pitch) {
SoundStore.get().setMusicPitch(pitch);
}
/**
* Returns whether or not the current track has ended.
*/