Rockbox Development > Feature Ideas

Additional functionality to %ss & display viewport for a duration of time

(1/1)

sockbox:
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.

JdGordon:
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.

sockbox:
A few more ideas with %ss...

- interpret entire lines including strings and white space with %ss

--- Code: ---%ss(0,-,%ia - %it)
--- End code ---

-  interpret %ss as string length if used in a conditional

--- Code: ---%if(%ss(0,-,%bl%pv),<,4)
# if battery level and volume string length is less than 4
--- End code ---

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.

Navigation

[0] Message Index

Go to full version