Added CD-TEXT dump function.

This commit is contained in:
Svend Sorensen
2005-03-19 06:20:01 +00:00
parent e973893d2a
commit 5b34a8361e
4 changed files with 22 additions and 3 deletions

View File

@@ -306,7 +306,7 @@ void cd_track_dump (Track *track)
if (NULL != track->cdtext) {
printf("cdtext:\n");
/* cdtext_print(stdout, track->cdtext); */
cdtext_dump(track->cdtext, 1);
}
}
@@ -319,7 +319,7 @@ void cd_dump (Cd *cd)
printf("catalog: %s\n", cd->catalog);
if (NULL != cd->cdtext) {
printf("cdtext:\n");
/* cdtext_print(stdout, cd->cdtext); */
cdtext_dump(cd->cdtext, 0);
}
for (i = 0; i < cd->ntrack; ++i) {

View File

@@ -80,7 +80,7 @@ typedef struct Track Track;
Cd *cd_init ();
/* dump all info from CD structure
* in human readable format (for debugging
* in human readable format (for debugging)
*/
void cd_dump (Cd *cd);

View File

@@ -151,3 +151,16 @@ const char *cdtext_get_key (int pti, int istrack)
return key;
}
void cdtext_dump (Cdtext *cdtext, int istrack)
{
int pti;
char *value = NULL;
for (pti = 0; PTI_END != pti; pti++) {
if (NULL != (value = cdtext_get(pti, cdtext))) {
printf("%s: ", cdtext_get_key(pti, istrack));
printf("%s\n", value);
}
}
}

View File

@@ -62,4 +62,10 @@ char *cdtext_get (int pti, Cdtext *cdtext);
*/
const char *cdtext_get_key (int pti, int istrack);
/*
* dump all cdtext info
* in human readable format (for debugging)
*/
void cdtext_dump (Cdtext *cdtext, int istrack);
#endif