Skip to content

Update shuffle strategy and android auto behavior

Robert Stone requested to merge rhstone/vlc-android:new-shuffle-algo into master

Description

This MR adds functionality to use a more random source of integers for shuffling and launch android auto playlists, play-all-by-genre, and play-all-from-artist with a shuffled first track.

Motivation and Context

  • SecureRandom is used in lieu of Random to (theoretically) obtain a truly random number, instead of the pseudo-random output from Random, which is rather predictable.
  • For Android Auto users, a random first track is selected for playlists, the genre "play all button" and the artist "play all" button when shuffle is already enabled.
  • Genre and artist "play all" buttons will have a shuffle icon overlay when shuffle is already enabled.
  • The shuffle option in the album, genre, artist and playlist overflow menu now plays a random first song. Shuffle option is only shown when > 2 tracks are in the list.

How Has This Been Tested?

Tested via app UI and Android Auto.

Screenshots

no_shuffle

shuffle_all

Types of changes

  • Enhancement (non-breaking change which cleans up / improves existing functionality)

Checklist

  • I have read the CONTRIBUTING section of the README document.
Edited by Robert Stone

Merge request reports