[Extension] Playlist randomizer
Posted: 03 Apr 2012 20:11
Recently I have read following post: Re: Playlist - randomize order in Feature Requests section.
I have thought that it could be possible to make some simple extension for this. I have checked VLC's Lua README file and found appropriate function that I could need:.sort() and .clear() work. Now I would like to ask you to help me to find out, how to read the whole playlist using the .get() function. How to read all playlist items (id, path, name) and temporarily store them in a table (array)?
I have tried this:It does not work. Any idea?
Thanks.
--- EDIT (10.4.2012) ---
topic's new title: "VLC Extension: Playlist randomizer"
old one: "How to read all playlist items?"
I have thought that it could be possible to make some simple extension for this. I have checked VLC's Lua README file and found appropriate function that I could need:
Code: Select all
vlc.playlist.sort('random')
vlc.playlist.get( [what, [tree]] )
vlc.playlist.clear()
vlc.playlist.enqueue( ... )
I have tried this:
Code: Select all
items=vlc.playlist.get()
vlc.msg.info(tostring(items.path))
for idx, details in ipairs(items) do
vlc.msg.info(idx.."-"..details.id)
vlc.msg.info(idx.."-"..details.path)
end
Thanks.
--- EDIT (10.4.2012) ---
topic's new title: "VLC Extension: Playlist randomizer"
old one: "How to read all playlist items?"