Add support for USLT (Unsychronised lyrics/text transcription) and SYLT (Synchronised lyrics/text).
For USLT it would be enough to add it just to the text pair in the v2 struct, but this way information are lost (language).
For SYLT the v2 struct needs to be expanded, from my point of view as a user, I find it nice to have a sorted list by time offset with the following info:
* timeoffset
* content type (lyric, trivia, event etc)
* text
I did a quick hack to support USLT through the comments section in the v2 struct. The comments list then holds both COMM and USLT tags. Because of this you can not use the v2->comment field as it may point to a USLT content.
Can not say for sure it is without side effects, but I have not seen any.
See attached files for changes.
Changes in id3.c to add USLT content to v2 comment list
Logged In: YES
user_id=470743
Originator: NO
OK, we will code proper support for both tags for a future release.
Open questions are how/if to normalize the timestamps, which could be given in frames or milliseconds in ID3v2, and if libmpg123 really should try to sort the entries.
I tend to using input file samples as basis, and perhaps offering a long/off_t mpg123_ms() to convert that to time in milliseconds, or also double mpg123_seconds() for generic conversion, as people like the values they get from mpg123_position, which I marked as endangered for removal becuase it doesn't look that nice to me (is a very mpg123 specific hack/leftover).
For the sorting... that potentally needs some effort... will the user of libmpg123 really always want to have the lib go through a sorting algorithm when querying ID3?
Considering that any sane encoding folks should store the stuff sorted to begin with...
Logged In: NO
If its not sorted, the user has always to check every entry just to be sure to get the most accurate entry.
If it is sorted, you can simply go from the start until you reach the entry which has a time stamp beyond current song playtime. Then take the entry before to get current entry which contains lyric to present.
As said, normally they are sorted by the person who adds the lyric, so the sort should be always not necessary and C function qsort is fast enough, as there seldom more than 100 entries I think.
I finally added something resembling your patch for USLT...
Difference: I found it more appropriate to add the field to the texts list, not comments.
Rationale is that in this list you have to look at the ID anyway to distinguish items, while the comments all have COMM and the extras all have TXXX .
Can you verify that it works with the current snapshot:
http://mpg123.org/snapshot
I didn't have time this year to add the SLYT thing... but it's not forgotten.