feat: added settings to enable and disable ReplayGain

This commit is contained in:
antonio 2023-07-02 23:36:52 +02:00
parent 57bb51fb8d
commit feae1b8bdd
4 changed files with 36 additions and 0 deletions

View file

@ -31,6 +31,7 @@ object Preferences {
private const val PODCAST_SECTION_VISIBILITY = "podcast_section_visibility"
private const val RADIO_SECTION_VISIBILITY = "radio_section_visibility"
private const val MUSIC_DIRECTORY_SECTION_VISIBILITY = "music_directory_section_visibility"
private const val REPLAY_GAIN_MODE = "replay_gain_mode"
@JvmStatic
fun getServer(): String? {
@ -246,4 +247,9 @@ object Preferences {
fun isMusicDirectorySectionVisible(): Boolean {
return App.getInstance().preferences.getBoolean(MUSIC_DIRECTORY_SECTION_VISIBILITY, true)
}
@JvmStatic
fun getReplayGainMode(): String? {
return App.getInstance().preferences.getString(REPLAY_GAIN_MODE, "disabled")
}
}

View file

@ -141,4 +141,15 @@
<item>12</item>
<item>6</item>
</string-array>
<string-array name="replay_gain_titles">
<item>Disabled</item>
<item>Track preferred</item>
<item>Album preferred</item>
</string-array>
<string-array name="replay_gain_values">
<item>disabled</item>
<item>track</item>
<item>album</item>
</string-array>
</resources>

View file

@ -194,11 +194,13 @@
<string name="settings_podcast_summary">If enabled, show the podcast section.</string>
<string name="settings_radio">Show radio</string>
<string name="settings_radio_summary">If enabled, show the radio section.</string>
<string name="settings_replay_gain">Set replay gain mode</string>
<string name="settings_rounded_corner">Rounded corners</string>
<string name="settings_rounded_corner_summary">If enabled, sets a curvature angle for all rendered covers. The changes will take effect on restart.</string>
<string name="settings_rounded_corner_size">Corners size</string>
<string name="settings_rounded_corner_size_summary">Sets the magnitude of the curvature angle.</string>
<string name="settings_scan_title">Scan library</string>
<string name="settings_summary_replay_gain">Replay gain is a feature that allows you to adjust the volume level of audio tracks for a consistent listening experience. This setting is only effective if the track contains the necessary metadata.</string>
<string name="settings_summary_syncing">Returns the state of the play queue for this user. This includes the tracks in the play queue, the currently playing track, and the position within this track. The server must support this feature.</string>
<string name="settings_summary_transcoding">Priority given to the transcoding mode. If set to \"Direct play\" the bitrate of the file will not be changed.</string>
<string name="settings_sync_starred_tracks_for_offline_use_summary">If enabled, starred tracks will be downloaded for offline use.</string>
@ -206,6 +208,7 @@
<string name="settings_theme">Theme</string>
<string name="settings_title_data">Data</string>
<string name="settings_title_general">General</string>
<string name="settings_title_replay_gain">Replay Gain</string>
<string name="settings_title_syncing">Syncing</string>
<string name="settings_title_transcoding">Transcoding</string>
<string name="settings_title_ui">UI</string>

View file

@ -139,6 +139,22 @@
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/settings_title_replay_gain">
<Preference
app:selectable="false"
app:summary="@string/settings_summary_replay_gain" />
<ListPreference
app:defaultValue="disabled"
app:dialogTitle="@string/settings_replay_gain"
app:entries="@array/replay_gain_titles"
app:entryValues="@array/replay_gain_values"
app:key="replay_gain_mode"
app:title="@string/settings_replay_gain"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/settings_title_syncing">
<Preference
app:selectable="false"