Help with automatic selection

Discuss your Lua playlist, album art and interface scripts.
emo_apostolov
New Cone
New Cone
Posts: 2
Joined: 16 Mar 2019 07:09

Help with automatic selection

Postby emo_apostolov » 16 Mar 2019 07:17

Hello! I need some help. I would like to make a script for a simple playlist in VLC where the first file is loaded randomly from folder "A", then the second one randomly from folder "B", then loop from beginning and load different files from the folders. The problem is that the VLC expand the folders and plays all the files in them. How can I make a script for automatic selection?
Another idea would be the player to play an element from all files according to certain criteria in the metadata such as artist, lenght or genre but I think the first idea would be far more easy to do.
Please help :)
Greetings!

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Help with automatic selection

Postby mederi » 18 Mar 2019 14:25

You could write an extension that would do the advaced shuffle. Check some extensions https://addons.videolan.org that can read and shuffle a playlist (Shuffle Playlist, Sampler PG) and mix playlists (WIP collection: Mix playlists).

emo_apostolov
New Cone
New Cone
Posts: 2
Joined: 16 Mar 2019 07:09

Re: Help with automatic selection

Postby emo_apostolov » 21 Mar 2019 07:29

Hello! I can't write the extension of my own, that's why I am asking for help here. My general idea is:
1. Read all files from folder A, then play a random file from folder A.
2. Read all files from folder B, then play a random file from folder B.
3. Go to start.

mederi
Big Cone-huna
Big Cone-huna
Posts: 1951
Joined: 15 Mar 2011 16:38
VLC version: 2.0.8
Operating System: Windows Vista/XP

Re: Help with automatic selection

Postby mederi » 26 Mar 2019 14:37

1. Read VLC playlist: folder A => list A, folder B => list B
2. Shuffle lists
3. Mix lists (AxB) => list AB
4. Play list AB
Advanced random playback - perhaps it is possible to jump to a next item in VLC playlist according to AB list (input_changed() and meta_changed() functions, vlc.playlist.goto( id )).
Advanced shuffle is simpler and possible for sure - just add AB list into VLC playlist and start to play it or reorder original VLC playlist (vlc.playlist.move( id_item, id_where )).


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 4 guests