Commit ec000500 authored by Thomas Guillem's avatar Thomas Guillem

VLCOptions: don't use any equalizer by default

parent 0ff43431
......@@ -132,7 +132,7 @@ public class EqualizerFragment extends AppCompatDialogFragment implements Playba
}
allSets.add(newPresetName);
mEqualizer = VLCOptions.getEqualizerSetFromSettings(context);
mEqualizer = VLCOptions.getEqualizerSetFromSettings(context, true);
// on/off
binding.equalizerButton.setChecked(VLCOptions.getEqualizerEnabledState(context));
......
......@@ -202,9 +202,7 @@ public class VLCOptions {
media.addOption(":start-paused");
}
@MainThread
public static MediaPlayer.Equalizer getEqualizerSetFromSettings(Context context) {
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
private static MediaPlayer.Equalizer getEqualizerSetFromSettings(SharedPreferences pref) {
final float[] bands = Preferences.getFloatArray(pref, "equalizer_values");
if (bands != null && pref.contains("equalizer_enabled")) {
final int bandCount = MediaPlayer.Equalizer.getBandCount();
......@@ -220,6 +218,19 @@ public class VLCOptions {
return MediaPlayer.Equalizer.createFromPreset(0);
}
@MainThread
public static MediaPlayer.Equalizer getEqualizerSetFromSettings(Context context, boolean force) {
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
if (!force && !pref.getBoolean("equalizer_enabled", false))
return null;
return getEqualizerSetFromSettings(pref);
}
@MainThread
public static MediaPlayer.Equalizer getEqualizerSetFromSettings(Context context) {
return getEqualizerSetFromSettings(context, false);
}
@MainThread
public static String getEqualizerNameFromSettings(Context context) {
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment