1) cdtext objects are no longer associated with a track but with the disc.
2) - cdio_get_cdtext no longer takes track as an argument - cdtext_get, cdtext_get_const, cdtext_set require track argument 3) Language, Genre, Genre Code and Encoding Fields are now properly parsed and stored in the cdtext object 4) Added public function cdio_get_cdtext_raw to extract the binary CD-Text 5) Added CDTEXTFILE keyword logic in cue sheet parser. Parses binary/raw CD-Text files 6) Added cdtext_genre2str to convert genre code 7) altered the example programs, test drivers, cdda-player and cd-info to work with these changes 8) Added test case 9) A few smaller changes A disc either holds CD-Text for all the tracks or does not hold any. Therefore a CD-Text object for the whole disc seems more natural to me. It also enables us to store global fields, like genre, encoding, language. Patch was tested on GNU/Linux 32 bit running Gentoo.
This commit is contained in:
@@ -409,8 +409,7 @@ _cddb_log_handler (cddb_log_level_t level, const char message[])
|
||||
#endif
|
||||
|
||||
static void
|
||||
print_cdtext_track_info(CdIo_t *p_cdio, track_t i_track, const char *psz_msg) {
|
||||
cdtext_t *p_cdtext = cdio_get_cdtext(p_cdio, i_track);
|
||||
print_cdtext_track_info(cdtext_t *p_cdtext, track_t i_track, const char *psz_msg) {
|
||||
|
||||
if (NULL != p_cdtext) {
|
||||
cdtext_field_t i;
|
||||
@@ -418,23 +417,28 @@ print_cdtext_track_info(CdIo_t *p_cdio, track_t i_track, const char *psz_msg) {
|
||||
printf("%s\n", psz_msg);
|
||||
|
||||
for (i=0; i < MAX_CDTEXT_FIELDS; i++) {
|
||||
if (p_cdtext->field[i]) {
|
||||
printf("\t%s: %s\n", cdtext_field2str(i), p_cdtext->field[i]);
|
||||
if (cdtext_get_const(i, i_track, p_cdtext)) {
|
||||
printf("\t%s: %s\n", cdtext_field2str(i), cdtext_get_const(i, i_track, p_cdtext));
|
||||
}
|
||||
}
|
||||
}
|
||||
cdtext_destroy(p_cdtext);
|
||||
}
|
||||
|
||||
static void
|
||||
print_cdtext_info(CdIo_t *p_cdio, track_t i_tracks, track_t i_first_track) {
|
||||
track_t i_last_track = i_first_track+i_tracks;
|
||||
cdtext_t *p_cdtext = cdio_get_cdtext(p_cdio);
|
||||
|
||||
if(NULL == p_cdtext) {
|
||||
printf("No CD-TEXT on Disc.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
print_cdtext_track_info(p_cdio, 0, "\nCD-TEXT for Disc:");
|
||||
print_cdtext_track_info(p_cdtext, 0, "\nCD-TEXT for Disc:");
|
||||
for ( ; i_first_track < i_last_track; i_first_track++ ) {
|
||||
char msg[50];
|
||||
sprintf(msg, "CD-TEXT for Track %2d:", i_first_track);
|
||||
print_cdtext_track_info(p_cdio, i_first_track, msg);
|
||||
print_cdtext_track_info(p_cdtext, i_first_track, msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user