Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: sockbox on March 25, 2012, 02:37:24 PM

Title: Additional functionality to %ss & display viewport for a duration of time
Post by: sockbox on March 25, 2012, 02:37:24 PM
I'd like to be able to grab a substring from right to left. Currently this is only possible to read a substring from left to right. A single dash, -, can specify the end of a string, or length of a string. A negative one, -1, can be used to specify the first character at the end of a string, and so forth. A negative string length could grab from right to left.

example.
%ss(-,-3,%it) # read the last 3 characters in the title tag

Also I'd like to be able to specify the amount of time to display a viewport after keypress. Similar to the %mv(t) option which does something for t amount of time when the volume is changed. Ultimately I'd like to display a viewport for a specified amount of time during and after playing, pausing, fast forwarding, rewinding, or placing the player on hold.

Title: Re: Additional functionality to %ss & display viewport for a duration of time
Post by: JdGordon on March 27, 2012, 08:30:17 AM
I know gevearts has been talking about negative values for %ss, but im bored so if its only a 5min fix i'll do that now. - EDIT: in
b2202a3

For the second part, you need to use %Tl(timeout) or %Tl(button label, timeout) to do what you want.

Have a look at https://github.com/saint-lascivious/RaaA-CabbieV2 how he does the popup viewports.
Title: Re: Additional functionality to %ss & display viewport for a duration of time
Post by: sockbox on April 01, 2012, 01:48:48 PM
A few more ideas with %ss...

- interpret entire lines including strings and white space with %ss
Code: [Select]
%ss(0,-,%ia - %it)
-  interpret %ss as string length if used in a conditional
Code: [Select]
%if(%ss(0,-,%bl%pv),<,4)
# if battery level and volume string length is less than 4

Why not extend the %Tl tag for use on non-touch screens? The functionality is already there, just map the virtual buttons to actual buttons.