Nicolas Pennequin
720cfe3954
Improve clearing of pictures in conditional constructs. This fixes improper clearing of pictures used in several conditionals or in nested conditionals (FS#7856).
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15663 a1c6a512-1295-4272-9138-f99709370657
2007-11-18 15:32:45 +00:00
Nicolas Pennequin
31f76116f1
Make the WPS parser stricter with invalid parameter lists. It will now reject them instead of ignoring them (this includes the second parameter to %m|x|, which is invalid and now causes a failure). Also change the debugging code in order to allow more precise error messages, including the faulty token's index and description. Finally, add a few missing token description and fine-tune the #ifdefs.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15624 a1c6a512-1295-4272-9138-f99709370657
2007-11-14 22:02:41 +00:00
Nicolas Pennequin
f554e00b61
Allow setting a margin on a non-scrolling line by using %m|margin| instead of %s|margin|. This allows to easily place dynamic info next to album art.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15610 a1c6a512-1295-4272-9138-f99709370657
2007-11-14 00:45:04 +00:00
Dave Chapman
f6ef46b73f
FS#8135 - add an optional "left margin" parameter to the %s WPS tag - e.g. %s|100|. This patch uses parts of the scroll-margins patch (FS#2954), but is much smaller, only offers a left-margin, and only affects the WPS code.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15604 a1c6a512-1295-4272-9138-f99709370657
2007-11-12 21:34:01 +00:00
Nicolas Pennequin
8537cbf091
Add detection for a previously ignored error case: a conditional token is present but no conditional start token (e.g. "%?C%al|>"). This would cause an inifnite loop in the displaying code. Thanks to markun for making the mistake and reporting it ;)
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15598 a1c6a512-1295-4272-9138-f99709370657
2007-11-12 18:43:38 +00:00
Nicolas Pennequin
81dedee7d0
Various album art improvements:
...
* Make the album art display tag static instead of dynamic, making it be drawn less often, which is good.
* Add the possibility of clearing the album art bitmap instead of drawing it, and use this abaility when the display tag is inside a conditional construct.
* Add the album art display tag to wps_debug.c.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15592 a1c6a512-1295-4272-9138-f99709370657
2007-11-12 01:31:42 +00:00
Nicolas Pennequin
9d4bed7ff0
Album art support. Based on FS#3045, but heavily modified to adapt to MoB and for cleanness.
...
The cover pictures are loaded from external bitmaps. JPEG and embedded art are not supported. The pictures will only be drawn on the main display. There is no resizing but it is possible to specify the WPS bitmap size in the bitmap names (e.g. cover.100x100.bmp).
The bitmaps are stored in the main buffer and read directly from there. Currently, duplicate bitmaps will simply be present several times in the buffer, but this will be improved.
To enable for a target, #define HAVE_ALBUMART in its config file.
For more information, see the wiki page: http://www.rockbox.org/wiki/AlbumArt .
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15572 a1c6a512-1295-4272-9138-f99709370657
2007-11-11 12:29:37 +00:00
Dan Everton
eecfe9f1cb
Add support for grouping tags. From FS#7362.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14242 a1c6a512-1295-4272-9138-f99709370657
2007-08-08 10:19:56 +00:00
Dan Everton
f4a61f0c4a
Add support for parsing the disc number tag from metadata and use of it in the database. Patch originally from FS#4961 with some minor tweaks by me.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14154 a1c6a512-1295-4272-9138-f99709370657
2007-08-03 10:00:42 +00:00
Nicolas Pennequin
29407cbe80
Implement feature request FS#7476: Add a "song progress percentage" WPS tag (%px) that can be used in a conditional to create custom progress meters.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13987 a1c6a512-1295-4272-9138-f99709370657
2007-07-25 14:14:47 +00:00
Marianne Arnold
74aabc8381
Make the '%mh' wps tag (to indicate keylock status) available on the Archos targets as well.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13716 a1c6a512-1295-4272-9138-f99709370657
2007-06-25 20:54:11 +00:00
Brandon Low
9a550524af
Make RTC tags display hyphens instead of nothing on non-rtc targets. This makes WPSs that use RTC tags look decent again with the new separated RTC tag style
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13639 a1c6a512-1295-4272-9138-f99709370657
2007-06-16 20:33:30 +00:00
Nicolas Pennequin
887b31c01a
Add some more explicit defines for my previous commit.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13561 a1c6a512-1295-4272-9138-f99709370657
2007-06-05 14:57:07 +00:00
Nicolas Pennequin
b5f4d90b4b
Make the bitmap loading code handle the progressbar and backdrop bitmaps in a slightly more generic way. This hopefully simplifies the code a bit and should make adding special bitmaps less painful.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13560 a1c6a512-1295-4272-9138-f99709370657
2007-06-05 10:42:41 +00:00
Dave Chapman
f0d4fc6c6b
Commit my patch from FS#7179 - a standalone command-line checkwps tool. To build, just type "make checkwps" in tools and run it with "checkwps wpsname.wps".
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13517 a1c6a512-1295-4272-9138-f99709370657
2007-05-29 19:00:36 +00:00
Nicolas Pennequin
392d07902f
Oops, next file info should be dynamic.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13456 a1c6a512-1295-4272-9138-f99709370657
2007-05-21 14:04:38 +00:00
Nicolas Pennequin
5cc98efddc
Add %fk and %Fk WPS tags : (next) file audio frequency in KHz (rewrite of FS#6393 to adapt it to the tokenizer).
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13455 a1c6a512-1295-4272-9138-f99709370657
2007-05-21 13:41:43 +00:00
Nicolas Pennequin
aa220d5acd
Trim a bunch of long lines and fix an infinite loop and buffer overrun in the impossible case that a WPS line ends with a litteral string but without a newline char (wps_parser.c:774).
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13306 a1c6a512-1295-4272-9138-f99709370657
2007-05-02 17:51:01 +00:00
Nicolas Pennequin
378a140ae2
Add a check for unclosed conditionals at the end of the WPS parsing in case we didn't reach the end of the file. Also a few minor other changes.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13303 a1c6a512-1295-4272-9138-f99709370657
2007-05-02 11:39:46 +00:00
Peter D'Hoye
3494b2118b
FS #7093 by Dave Hooper: prevent crash when loading too many/long static strings in the wps
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13302 a1c6a512-1295-4272-9138-f99709370657
2007-05-01 23:36:15 +00:00
Nicolas Pennequin
7e6af1532b
Better handling of strings in the WPS parser by detecting duplicates to avoid having two copies of the same string in the string buffer.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13295 a1c6a512-1295-4272-9138-f99709370657
2007-04-30 14:08:58 +00:00
Nicolas Pennequin
1cf2ec38b1
Change some ifdefs for the recent backdrop changes (fixes the yellow builds) and move the backdrop files.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13265 a1c6a512-1295-4272-9138-f99709370657
2007-04-25 22:08:00 +00:00
Nicolas Pennequin
7fdfa56454
Add backdrop support for LCD remotes with depth > 1-bit. Only WPS backdrops, but the groundwork is laid for main backdrops too (all that's really needed are menus to set/clear them).
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13263 a1c6a512-1295-4272-9138-f99709370657
2007-04-25 21:44:56 +00:00
Nicolas Pennequin
2a2b8d8a82
Make bitmaps use the right format in a RWPS and prevent a backdrop tag in a RWPS from clearing the main display's backdrop. This also allows future backdrop support for LCD remotes by making the parsing code aware of whether the display for a WPS is a remote or not.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13261 a1c6a512-1295-4272-9138-f99709370657
2007-04-25 13:09:56 +00:00
Nicolas Pennequin
6ac306a515
Add a new commandline switch to the simulator: "--debugwps". It enables printing of advanced (and very verbose) WPS debugging information. Also make the debugging code a bit cleaner.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13257 a1c6a512-1295-4272-9138-f99709370657
2007-04-24 23:58:57 +00:00
Nicolas Pennequin
d7fd989319
WPS Parser: On parse failure, print a (hopefully) useful error message with line number (sim only).
...
Also the debug code is still disabled but now in a nicer way.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13251 a1c6a512-1295-4272-9138-f99709370657
2007-04-24 00:57:04 +00:00
Nicolas Pennequin
814d402d4c
More strict WPS parsing and displaying code. If there are errors, WPS loading will fail and the default WPS will be displayed.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13236 a1c6a512-1295-4272-9138-f99709370657
2007-04-21 19:31:46 +00:00
Michael Sevakis
26d242ae65
General housekeeping: Make plugin buffer functions take size_t * instead of int * to match the parameter type of the buffer functions called in the core. Get rid of unsafe int * <==> size_t * casting. Use ssize_t where int was used and size_t where unsigned int was used in the buffer calls to not alter signedness in the plugins. No API version change since it should only be an issue for 64-bit sim builds.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13233 a1c6a512-1295-4272-9138-f99709370657
2007-04-21 18:38:25 +00:00
Miika Pekkarinen
f53a8f8cd4
Added autoscore tag (%ra) to wps.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13169 a1c6a512-1295-4272-9138-f99709370657
2007-04-15 15:46:46 +00:00
Miika Pekkarinen
1c0f41447a
Reverted FS#6949 as we have a strict policy against anonymous contributions.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13168 a1c6a512-1295-4272-9138-f99709370657
2007-04-15 15:38:08 +00:00
Miika Pekkarinen
3c6e46ce64
FS#6949 - WPS tag for database autoscore. Author wanted to remain anonymous.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13164 a1c6a512-1295-4272-9138-f99709370657
2007-04-15 13:50:07 +00:00
Nicolas Pennequin
2e1169bdda
* Make the WPS parser close open conditionals on new sublines and comments as well as new lines.
...
* Make the displaying code check for invalid conditional constructs in order to avoid some rare cases of infinite looping.
* Make the WPS parser check that it doesn't read more strings than it can.
* Increase the string buffer size (from 512 to 1024, to accomodate the TextBox WPS which uses a lot of unicode characters).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13162 a1c6a512-1295-4272-9138-f99709370657
2007-04-15 02:59:34 +00:00
Nicolas Pennequin
32bd59d4f7
Better error checking for the image display tag (%xdn). Should prevent problems with the former crossfeed tag (%xd) when used in a conditional construct.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13158 a1c6a512-1295-4272-9138-f99709370657
2007-04-14 16:20:33 +00:00
Nicolas Pennequin
2ea39db310
FS#7020. Make the behaviour of '#' more consistent. It now requires escaping by a '%' to be displayed. If it is not escaped, the following text will be interpreted as a comment (including the newline character).
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13140 a1c6a512-1295-4272-9138-f99709370657
2007-04-13 11:43:10 +00:00
Nicolas Pennequin
27cbf6bcea
* Add the crossfade (%xf) WPS tag
...
* Avoid eating the whole line when unsuccessfully parsing a %x or %xl tag. This will prevent unknown tags starting with %x from making the line disappear.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13127 a1c6a512-1295-4272-9138-f99709370657
2007-04-12 16:15:34 +00:00
Nicolas Pennequin
536c5d9e74
RTC tags for the WPS: Accept FS#6998 and FS#7001 by Alexander Levin with changes by me. CUSTOM WPS FILES NEED TO BE UPDATED !
...
The RTC tags are now atomic, i.e. instead of using one tag with the format (e.g. %cd m yc), we use several separate tags, one for each value (e.g. %cd %cm %cy).
Also, %cP produces an uppercase AM/PM indicator and %cp a lowercase one, which is the opposite from what they did before.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13093 a1c6a512-1295-4272-9138-f99709370657
2007-04-10 13:37:08 +00:00
Nicolas Pennequin
cda89411b0
Accept FS#7000 by Dave Hooper: Fix scrolling line behaviour for dynamic tags (e.g. when a line with info about the next track didn't scroll) and fix some incorrect refreshing flags.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13081 a1c6a512-1295-4272-9138-f99709370657
2007-04-09 14:06:38 +00:00
Nicolas Pennequin
9ce77aa554
Skip leading UTF8 BOM if present. Fixes the first line of the WPS not being understood as a comment when it is one.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13074 a1c6a512-1295-4272-9138-f99709370657
2007-04-08 15:02:26 +00:00
Nicolas Pennequin
ef5cfb4e58
Oops, this shouldn't have been removed (fix red).
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13066 a1c6a512-1295-4272-9138-f99709370657
2007-04-08 04:12:55 +00:00
Nicolas Pennequin
07696c10b1
FS#6991. Patch by Alexander Levin, modified by me:
...
* Reorganisation of the WPS data structure with line and subline structs. This allows us to use sublines more sparingly, so it should save some memory. Also it removes the need for the "End Of Line" token. Overall, the data structure and the code are simplified and gain in clarity.
* Some code improvements and added comments.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13065 a1c6a512-1295-4272-9138-f99709370657
2007-04-08 04:01:06 +00:00
Nicolas Pennequin
87e77ba466
This time I hope I got it right! Basically, remove what the previous commit about subline timeouts added and make the values be computed by a special function at display time. This should bring complete compatibility with the previous code.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13047 a1c6a512-1295-4272-9138-f99709370657
2007-04-06 16:43:07 +00:00
Nicolas Pennequin
3954a51311
Better handling of subline timeout values : All values are set to the default before another value is found by the parser. No more
...
resetting to the default value at displaying time (this caused problems especially noticeable on the DancePuffDuo WPS). Changing
the values with conditionals is still possible but only strictly positive tiemout values are accepted now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13045 a1c6a512-1295-4272-9138-f99709370657
2007-04-06 14:18:07 +00:00
Nicolas Pennequin
9cf8960c85
* Fix the bug where subline separators were read as part of a string.
...
* Some cosmetic code changes, no other functional change (add a comment and rename some variables).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13034 a1c6a512-1295-4272-9138-f99709370657
2007-04-05 14:09:59 +00:00
Dan Everton
86c0e3a4ca
Rearrange struct wps_tag to avoid padding. Hopefully save some bytes.
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13033 a1c6a512-1295-4272-9138-f99709370657
2007-04-05 10:21:49 +00:00
Nicolas Pennequin
29e18caacf
Allow subline timeout values to be changed dynamically in the WPS (e.g. by using conditionals).
...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13026 a1c6a512-1295-4272-9138-f99709370657
2007-04-05 02:44:01 +00:00
Nicolas Pennequin
830a3a4720
* Make some private variables 'static'.
...
* Fix the pitch tag and allow it to be used on all targets except the Archos Player.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13020 a1c6a512-1295-4272-9138-f99709370657
2007-04-04 15:47:51 +00:00
Nicolas Pennequin
ab90d58801
Introducing the WPS tokenizer !
...
When a WPS file is loaded, it is parsed to an array of tokens, which allows more efficient displaying. More info on the tracker entry : FS #6862 .
The parsing code is completely independant and is all in wps_parser.c. The displaying part stays in gwps-common.c.
Debugging code is provided (with the right ifdefs) and is disabled by default.
Overall, the code should be easier to read and maintain. Adding new WPS tags is made quite trivial.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13019 a1c6a512-1295-4272-9138-f99709370657
2007-04-04 14:41:40 +00:00