replaygain pre-amp configuration support

This commit is contained in:
Adrian Ulrich 2013-05-01 11:05:05 +02:00
parent 79902cfcf1
commit 510f352192
4 changed files with 19 additions and 0 deletions

View File

@ -160,6 +160,7 @@ THE SOFTWARE.
<string name="replaygain_track_summary">Play all tracks at equal loudness</string>
<string name="replaygain_album_title">Enable album Replay Gain</string>
<string name="replaygain_album_summary">Preserve album dynamics</string>
<string name="replaygain_bump_title">Replay Gain Pre-amp</string>
<string name="notifications">Notifications</string>
<string name="notification_mode_title">Notification Mode</string>

View File

@ -33,4 +33,19 @@ THE SOFTWARE.
android:title="@string/replaygain_album_title"
android:summary="@string/replaygain_album_summary"
android:defaultValue="false" />
<ch.blinkenlights.android.vanilla.SeekBarPreference
android:key="replaygain_bump"
android:negativeButtonText="@null"
android:dialogLayout="@layout/shake_pref"
android:title="@string/replaygain_bump_title"
android:defaultValue="75" />
<EditTextPreference
android:enabled="false"
android:title="Note"
android:summary="Android does not allow Vanilla Music to raise the volume
to >100%. Setting the Pre-amp to a high value may cause issues if you are listening to 'quiet' music.
\nRecommended values are:\n-> -3dB for silent/classical music\n-> +3dB for post-2000 recordings"
/>
</PreferenceScreen>

View File

@ -59,4 +59,5 @@ public class PrefKeys {
public static final String VISIBLE_EXTRA_INFO = "visible_extra_info";
public static final String ENABLE_TRACK_REPLAYGAIN = "enable_track_replaygain";
public static final String ENABLE_ALBUM_REPLAYGAIN = "enable_album_replaygain";
public static final String REPLAYGAIN_BUMP = "replaygain_bump";
}

View File

@ -76,6 +76,8 @@ public class SeekBarPreference extends DialogPreference implements SeekBar.OnSee
{
if ("shake_threshold".equals(getKey())) {
return String.valueOf(value / 10.0f);
} else if("replaygain_bump".equals(getKey())) {
return String.format("%+.1fdB", 2*(value-75)/10.0);
} else {
return String.format("%d%% (%+.1fdB)", value, 20 * Math.log10(Math.pow(value / 100.0, 3)));
}