Rockbox Technical Forums

Support and General Use => Plugins/Viewers => Topic started by: mlind on June 03, 2009, 05:18:14 AM

Title: Use of LUA?
Post by: mlind on June 03, 2009, 05:18:14 AM
Hi
I noticed the addition of a viewer for LUA files.
So LUA is a scripting laguage, ok.

But what use can we expect to have of it?
How advanced operations can be done by LUA on Rockbox?
Access the filesystem? Play audio?

What lua files can I find (on the net) and use on my Rockboxed DAP?

/M
Title: Re: Use of LUA?
Post by: safetydan on June 03, 2009, 05:46:38 AM
You're unlikely to be able to just download random .lua files from the internets and have them work on Rockbox. While some of the standard Lua API is available, quite a lot isn't. There's also Rockbox specific screen drawing and button access functions you need to use.

The purpose of the Lua plugin (at least for me) is to give people an easier way to write plugins for Rockbox. It should (eventually) be able to do everything you could do by writing a plugin in C.
Title: Re: Use of LUA?
Post by: mlind on June 03, 2009, 12:28:43 PM
Ok. Thanks for your answer.
Title: Re: Use of LUA?
Post by: animatorgeek on June 16, 2009, 10:00:34 PM
My immediate curiosity has to do with how much you can interact with the UI through LUA.  For instance, could I create a script that sets various recording options, goes to the recording screen, and immediately starts recording?  The reason I thought of this was because I always feel kind of awkward getting my player set up to record.  It would be great if I could just click on the "record voice" script instead of having to go in, set the right AGC, select the internal mic, go to the record screen, and start it recording.

Of course, if you could do this stuff, you could also do lots of other stuff, automating whatever you want in the player.
Title: Re: Use of LUA?
Post by: safetydan on June 16, 2009, 10:04:43 PM
It doesn't quite work that way unfortunately. The things that LUA can do is the same as plugins. So at the moment a plugin couldn't do that so LUA scripts can't do that. The idea with LUA is to just lower the barrier to entry for writing plugins.

Scripting the UI is a possibility for future enhancement, but it's not likely to happen soon.
Title: Re: Use of LUA?
Post by: Thecoolgman on June 19, 2009, 10:56:20 PM
I wish you could customize the GUI like WPS's.