B4J Code Snippet Shuffle List for MP£

HI, was trying to implement a shuffle list feature in a small MP3 player, and didny have a clue how to. Found an example in B4A which DonManFred had done, and William Lancee helped me with the migration to B4A, just thought I'd put it B4J for info
 

Attachments

  • DITL MP3 Player.zip
    3.6 KB · Views: 100

William Lancee

Well-Known Member
Licensed User
Longtime User
Nice job. Unsolicited, but FYI there are many ways to select filenames that are more "elegant" than multiple if statements.
Check out Select..Case..End Select, as well as Maps and CreateMap. Also, if you see repeated code, it is good practice to find ways to shorten it.

Can the shuffle effect lead to a situation where by chance the customer hears the same item twice in a short time?
(When the playlist is reshuffled, you may want to check that it doesn't start with recently heard songs)
 
Last edited:

Colin Evans

Active Member
Licensed User
Longtime User
Cheers William, appreciate your comments, and yes I agree I hate repeated code, in my previous language (long time ago MSM / MUMPS) it was simple to code but I haven't tried Select Case etc but will endeavour to find out how they are coded
 
Top