User input with lua script

Discuss your Lua playlist, album art and interface scripts.
joelones
New Cone
New Cone
Posts: 8
Joined: 12 Oct 2013 16:40

User input with lua script

Postby joelones » 10 Nov 2013 17:57

I have a script that I place in the ..share/lua/sd.. directory, I'm assuming these are referred to as interface scripts, no? In any case, I would simply like this script to prompt the user to enter a specific date.

Is this at all possible? Googling around suggests that this is not possible but only with extension scripts, can someone please confirm?

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: User input with lua script

Postby mederi » 10 Nov 2013 18:13

"/lua/sd/" directory is for VLC Lua servives discovery scripts. Interface scripts are in "/lua/intf/". Dialog box is available in extension scripts stored in "/lua/extensions/".

joelones
New Cone
New Cone
Posts: 8
Joined: 12 Oct 2013 16:40

Re: User input with lua script

Postby joelones » 10 Nov 2013 18:46

I would like the extension to populate the playlist view, like how I have an SD script doing now. Is that possible?

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: User input with lua script

Postby mederi » 10 Nov 2013 19:09

Try to run sd script as an extension script. SD Lua module is probably available also in extensions. Just add activate() and deactivate() functions and call main() sd function in activate() one:

Code: Select all

function activate() main() end function deactivate() end

joelones
New Cone
New Cone
Posts: 8
Joined: 12 Oct 2013 16:40

Re: User input with lua script

Postby joelones » 10 Nov 2013 20:47

Thanks for the reply mederi,

my sd segfaults when I try to convert it to an extension script:

Code: Select all

[0x10399da50] main access debug: using access module "access_http" [0x1002bf070] main stream debug: Using stream method for AStream* [0x1002bf070] main stream debug: starting pre-buffering [0x1002bf070] main stream debug: received first data after 0 ms [0x1002bf070] main stream debug: pre-buffering done 1024 bytes in 0s - 83333 KiB/s [0x1002e2ff0] main xml debug: looking for xml module matching "any": 1 candidates [0x1002e2ff0] main xml debug: using xml module "xml" [0x1002e80d0] main xml reader debug: looking for xml reader module matching "any": 1 candidates [0x1002e80d0] main xml reader debug: using xml reader module "xml" Segmentation fault: 11
http://pastebin.com/TahZMhw6

joelones
New Cone
New Cone
Posts: 8
Joined: 12 Oct 2013 16:40

Re: User input with lua script

Postby joelones » 11 Nov 2013 16:13

I guess the reason why it's dumping is cause I need to use "vlc.sd.add_node" but that method is not available with an extension?

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: User input with lua script

Postby mederi » 12 Nov 2013 12:44

I haven't worked with sd script yet. I've just briefly had a look at the sd structure. If the simple conversion of sd script to extension is not possible, then it is possible to parse xml in an extension to feed a list widget with particular entries in a custom dialog box and to have a button to expand/collapse/play selected items in the "tree structure" there. Playlist is also capable of tree structure, but I am not too sure about it, because it is all about folders and files, isn't it? Perhaps you could file a feature request (https://trac.videolan.org/vlc) to ask developers to enable dialog boxes for sd scripts if it makes sense.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 10 guests