Added CD-TEXT dump function.
This commit is contained in:
4
lib/cd.c
4
lib/cd.c
@@ -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) {
|
||||
|
||||
2
lib/cd.h
2
lib/cd.h
@@ -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);
|
||||
|
||||
|
||||
13
lib/cdtext.c
13
lib/cdtext.c
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user