Support and General Use > Theming and Appearance Customization
New tag %ft grab a line of text from a file
Bilgus:
Work in progress
%ft(filename, line)
https://gerrit.rockbox.org/r/c/rockbox/+/6143
Get a line of text from a file and display it in the wps
Comments welcome
iPodVT:
--- Quote from: Bilgus on December 03, 2024, 02:14:04 PM ---Work in progress
%ft(filename, line)
https://gerrit.rockbox.org/r/c/rockbox/+/6143
Get a line of text from a file and display it in the wps
Comments welcome
--- End quote ---
It works perfectly for me on both ipod6g and ipodvideo, for everything I tried. I made a four line text file, and tested it for each line. I also tried some out of bounds line numbers and they produced an empty string (at least apparently - nothing was displayed from the calls with those bad line numbers). I also tried with and without a newline/CR for the last line and it worked properly both with and without. I guessed that the line numbers would be zero-based and that proved to be the case. I didn't do extensive stress testing, e.g. very long lines of text. Please let me know of any specific such testing you'd like me to try.
I hope others will find this useful. Although the 'player name' config setting fulfilled my need/desire to be able to cache a displayable unique name for each individual device, this text file implementation is better because now instead of having to hard code a unique config setting for each player, they can all share the same generic config file and just have their own unique text file of line delimited data, which is much easier to maintain.
Thanks very much for providing this great new feature.
Dook:
This seems like a really exciting addition to the theme spec, looking forward to trying it out soon. Immediately I'm thinking about the possibility of using a text file as a theme-specific config file that users can edit, possibly helping to eliminate the amount of variants required for themes.
Bilgus:
Dook, exactly how I hoped y'all would use it!
I have this ready if you can build your own feel free otherwise let me know your devices and I'll get you some builds
Bilgus:
iPodVT most of the issues I found were around the line_alternator stuff and timeout %t()text1;text2;text3
I think I have that worked out
now if line or file doesn't exist it becomes a #COMMENT as far as the engine is concerned as that makes the logic easier
its pretty well ready unless some bug comes up..
text len is limited to 320 chars sizeof(MAX_PATH)
should handle utf8 as well
Ill be removing the playername setting once we are satisfied with this..
Navigation
[0] Message Index
[#] Next page
Go to full version