Skip to content
Snippets Groups Projects
Commit f794ffbe authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Duncan McNamara
Browse files

Add a "force shuffling" audio control setting

Fixe's #2675
parent 8ece1989
No related branches found
Tags 3.2.0-b1
1 merge request!1546Add a "force shuffling" audio control setting
Pipeline #265069 passed with stage
in 21 minutes and 43 seconds
......@@ -483,6 +483,8 @@
<string name="resume_playback_summary">Stay in pause otherwise</string>
<string name="blurred_cover_background_title">Blurred cover background</string>
<string name="blurred_cover_background_summary">Blurred cover in audio player background</string>
<string name="force_shuffle_title">Force shuffle</string>
<string name="force_shuffle_summary">Force shuffling when launching a playback</string>
<string name="network_caching_popup">This value must be between 0 and 60000 ms</string>
<string name="quit">Quit and restart application</string>
<string name="restart_message">Changes will take effect once application has restarted.\n\nRestart now?</string>
......
......@@ -88,6 +88,7 @@ const val KEY_VIDEO_LONG_JUMP_DELAY = "video_long_jump_delay"
const val KEY_VIDEO_DOUBLE_TAP_JUMP_DELAY = "video_double_tap_jump_delay"
const val KEY_AUDIO_JUMP_DELAY = "audio_jump_delay"
const val KEY_AUDIO_LONG_JUMP_DELAY = "audio_long_jump_delay"
const val KEY_AUDIO_FORCE_SHUFFLE = "audio_force_shuffle"
// AudioPlayer
......
......@@ -24,6 +24,13 @@
android:summary="%ss"
android:defaultValue="20"/>
<CheckBoxPreference
app:singleLineTitle="false"
android:defaultValue="false"
android:key="audio_force_shuffle"
android:summary="@string/force_shuffle_summary"
android:title="@string/force_shuffle_title"/>
</androidx.preference.PreferenceScreen>
......@@ -191,6 +191,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
service.onMediaListChanged()
service.showNotification()
}
if (settings.getBoolean(KEY_AUDIO_FORCE_SHUFFLE, false) && !shuffling && canShuffle()) shuffle()
}
@Volatile
......@@ -863,6 +864,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
}
mediaList.addEventListener(this)
addUpdateActor.trySend(Unit)
if (settings.getBoolean(KEY_AUDIO_FORCE_SHUFFLE, false) && !shuffling && canShuffle()) shuffle()
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment