Commit graph

13 commits

Author SHA1 Message Date
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
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
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
49cf05cb91 Hopefully fix the 64-bit warning.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13171 a1c6a512-1295-4272-9138-f99709370657
2007-04-15 22:11:53 +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
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
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
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