Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Macro Language???
From: George Styles (george_at_ripnet.co.uk)
Date: 2003-12-02


Ive thought for some time that Rockbox should support little 'macros', ie,
text files containing lists of commands like 'Play x.mp3' load config
"a.cfg", set volume to 10, set shuffle on/off etc.

In fact, the existing .cfg files are pretty much like that now, except they
are limited to setting settings, and loading wps's etc.

If we were to add new commands to the .cfg files (like Play xxx etc), we
would have a simple macro language.

These text files could then be bound to keys, to provide a completely
configurable UI, eg. we could have /.rockbox/keymacros containing files like
PrevWPS.cfg (which would run when they pressed previous in the WPS)
NextWPS.cfg
Vol+WPS.cfg

and

PrevTree.cfg (which would run when they pressed previous in the treeview)

If these files were absent, it would behave like it does now.

That way, we can increase flexability by adding new commands to the macro
language

You could also have files for F1 F2 and F3 to allow custom actions on that.

thoughts? most of the code is already implemented in the savable configs
part, so all we would need to do would have a new function which checked if
a given file exists, and runs it if it does, returning true, or if it doesnt
it would return false, then then existing key handling code would just be

bool runMacro(char *macroName)
{
  ( This will see if macroName exists, and run it, returning true if it
does, otherwise return false )
}

if (! runMacro("PrevWPS"))
  doWhateverItDidBefore();

easy!

g

----- Original Message -----
From: "Mat Holton" <mathew.holton_at_surface-inspection.com>
To: <rockbox_at_cool.haxx.se>
Sent: Tuesday, December 02, 2003 10:49 AM
Subject: Re: a couple of questions about ver. 2.1

> I've allways been a firm believer in making everything configurable,
> either through a text file or menu settings. Probably best for something
like
> this to be done thorugh a text file.
>
>
>
> -----Original Message-----From: Linus Nielsen Feltzing <linus_at_haxx.se>To:
rockbox_at_cool.haxx.se <rockbox_at_cool.haxx.se>Sent: 02/12/2003 10:35Subject:
Re: a couple of questions about ver. 2.1Daniel Stenberg wrote:
>
> > In my eyes we can either get people complaining by doing like we do now
or we
>
> > can revert the off functionality and go back to get the people
complaining
>
> > like they did before...
>
>
> I have given this some thought, and I think the previous behaviour was
>
> better. It responded to the OFF button, and the sleep timer could enter
>
> the "charging" state (even though it didn't back then, but it could now).
>
>
> I vote for reimplementing the OFF reboot code, with the exception that
>
> we must handle it better for the flashed versions.
>
>
> Linus
>
> --------------------------------------------------------------------------
--------------------
>
> "Life's just a mood ring we're not allowed to see."
>
> They Might Be Giants.
>
> --------------------------------------------------------------------------
--------------------
>
> Surface Inspection Ltd
> www.surface-inspection.com
>



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa