Added a new output option, -X, which generates XML
output for easy parsing by other programs. Output
looks like this:
<id3v1>
<file>/path/to/mp3/filename.mp3</file>
<artist>Artist Name </artist> /* note id3v1
includes all 30 chars */
<title>Title </title>
...etc...
</id3v1>
<id3v2>
<file>/path/to/mp3/filename.mp3</file>
<TRCK>18</TRCK>
<TIT2>Title</TIT2>
...etc...
</id3v2>
The rfc822 argument is passed to ListTag, but does not
appear to be used.
I changed the name of this argument to "outstyle" and
am passing one of the following values: (0 = normal; 1
= rfc822; 2 = xml) to:
o ListTag(int argc, char *argv[], int optind, int
outstyle)
o PrintInformation(char *sFileName, const ID3_Tag
&myTag, int outstyle)
o PrintID3v1Tag(char *sFileName, int outstyle)
At that point, PrintInformation and PrintID3v1Tag just
use a different output. The changes to
PrintInformation (for ID3v2 tags) are very simple,
allow future updates with little difficulty.
The changes to PrintID3v1Tag are also simple, but
appear large as I created a new output block for the
XML portion. Looking at the diff it should become clear.
Potential improvement:
o Possibly use an enum for the output styles, and then
replace my if (outstyle != 2) or if (outstyle == 2)
with if (outstyle == xml) for clarity. I did not know
the best place to put this enum and so I didn't do it
already.
Patch against id3v2 0.1.11, adds -X for XML output