@@ -29,6 +29,7 @@ public final class PlayerConfiguration {
2929 // Audio
3030 public final AudioQuality preferredQuality ;
3131 public final boolean enableNormalisation ;
32+ public final boolean useAlbumGain ;
3233 public final float normalisationPregain ;
3334 public final boolean autoplayEnabled ;
3435 public final int crossfadeDuration ;
@@ -52,11 +53,12 @@ public final class PlayerConfiguration {
5253 // Local files
5354 public final File localFilesPath ;
5455
55- private PlayerConfiguration (AudioQuality preferredQuality , boolean enableNormalisation , float normalisationPregain , boolean autoplayEnabled , int crossfadeDuration , boolean preloadEnabled ,
56+ private PlayerConfiguration (AudioQuality preferredQuality , boolean enableNormalisation , boolean useAlbumGain , float normalisationPregain , boolean autoplayEnabled , int crossfadeDuration , boolean preloadEnabled ,
5657 AudioOutput output , String outputClass , Object [] outputClassParams , File outputPipe , File metadataPipe , String [] mixerSearchKeywords , boolean logAvailableMixers , int releaseLineDelay ,
5758 int initialVolume , int volumeSteps , boolean bypassSinkVolume , File localFilesPath ) {
5859 this .preferredQuality = preferredQuality ;
5960 this .enableNormalisation = enableNormalisation ;
61+ this .useAlbumGain = useAlbumGain ;
6062 this .normalisationPregain = normalisationPregain ;
6163 this .autoplayEnabled = autoplayEnabled ;
6264 this .crossfadeDuration = crossfadeDuration ;
@@ -83,6 +85,7 @@ public final static class Builder {
8385 // Audio
8486 private AudioQuality preferredQuality = AudioQuality .NORMAL ;
8587 private boolean enableNormalisation = true ;
88+ private boolean useAlbumGain = false ;
8689 private float normalisationPregain = 3.0f ;
8790 private boolean autoplayEnabled = true ;
8891 private int crossfadeDuration = 0 ;
@@ -119,6 +122,11 @@ public Builder setEnableNormalisation(boolean enableNormalisation) {
119122 return this ;
120123 }
121124
125+ public Builder setUseAlbumGain (boolean useAlbumGain ) {
126+ this .useAlbumGain = useAlbumGain ;
127+ return this ;
128+ }
129+
122130 public Builder setNormalisationPregain (float normalisationPregain ) {
123131 this .normalisationPregain = normalisationPregain ;
124132 return this ;
@@ -207,7 +215,7 @@ public Builder setLocalFilesPath(File localFilesPath) {
207215
208216 @ Contract (value = " -> new" , pure = true )
209217 public @ NotNull PlayerConfiguration build () {
210- return new PlayerConfiguration (preferredQuality , enableNormalisation , normalisationPregain , autoplayEnabled , crossfadeDuration , preloadEnabled ,
218+ return new PlayerConfiguration (preferredQuality , enableNormalisation , useAlbumGain , normalisationPregain , autoplayEnabled , crossfadeDuration , preloadEnabled ,
211219 output , outputClass , outputClassParams , outputPipe , metadataPipe , mixerSearchKeywords , logAvailableMixers , releaseLineDelay ,
212220 initialVolume , volumeSteps , bypassSinkVolume , localFilesPath );
213221 }
0 commit comments