On Wed, May 25, 2011 at 1:12 PM, Leon Merten Lohse <[email protected]>wrote:
> Hello, > > I would like to suggest a few additions to the cdtext api. Unfortunately > this would mean to change how cdtext is stored internally. > > new public functions: > > /* these are useful for testing. Raw cdtext is less than 5K, thus very > portable. This enables us to test cdtext routines on different machines with > the exact same conditions, without having to send the physical disc. Raw > cdtext data can also be used by cdrecord to author a audio cd. cdda2wav also > creates a file audio.cdtext; which is exactly the same */ > > /* reads raw cdtext from disc and returns it in a malloc'ed char buffer */ > char * cdio_get_cdtext_raw(CdIo_t*); > // or int cdio_get_cdtext_raw(CdIo_t*, void*, int) > > /* inits a cdtext structure from raw cdtext data - useful for testing */ > bool cdio_init_cdtext_raw(CdIo_t*, void *); > > /* returns encoding of cdtext - "ASCII", "ISO-8859-1" or "SHIFT-JIS" */ > char * or CDTEXT_CHARSET cdtext_get_charset(cdtext_t*) > > /* returns language of the cdtext - i don't know if there is a single cd > that does not have this set to english */ > char * or CDTEXT_LANG cdtext_get_language(cdtext_t*) > > /* same as now. explanation follows */ > char * cdtext_get_track(cdtext_field_t*, const cdtext_t*) > > I would like to change cdtext_field_t from only storing the info for a > single track to store the cdtext for the whole disc. This would have two > benefits: > A. cleaner code. all the cdtext functionality could be in cdtext.c. Now > cdtext_set_field can be found in quite some files, and passed as an argument > to several functions. > B. easy storage of binary fields (like BLOCKSIZE which stores language, > encoding, a useful cdtext toc). Sure, we could just put it in one of the > fields now. That might result in ugly output though, if a user simply prints > all the fields. > > Another idea that came when I saw utf8.c was to convert all strings that > were read to utf8. But I do not know if that is necessary just to make live > easier for some potential freaks in deepest Japan. > > Want to get this out of my head :-) > What do you think? > Looks fine to me. This is the way progress is made. Someone gets an idea or is inspired to do something, then does it. The next release I believe has other API changes, so doing this in the current code base works that way as well. > > > Regards > Leon > >
