[Mobile] set volume when track changes

This commit is contained in:
Anthony Calosa
2021-02-05 02:26:33 +08:00
parent 04fd9709ac
commit d5e1392ae7
5 changed files with 6 additions and 35 deletions

View File

@@ -194,12 +194,6 @@ public class SoundSystem {
changeBackgroundTrack();
}
public void adjustVolume(float value) {
if (currentTrack != null) {
currentTrack.setVolume(value);
}
}
public void changeBackgroundTrack() {
//ensure old track stopped and disposed of if needed
if (currentTrack != null) {
@@ -228,6 +222,7 @@ public class SoundSystem {
changeBackgroundTrack(); //change track when music completes on its own
}
});
currentTrack.setVolume(FModel.getPreferences().getPrefInt(FPref.UI_VOL_MUSIC)/100f);
} catch (final Exception ex) {
System.err.println("Unable to load music file: " + filename);
}