«« The id3v2 Frames Hierarchy ClassCastExceptions are Useless? »»
blog header image
jid3rL with FramesGroup

Here's an update to my earlier post, An Intro to jid3rL. The classes and constructors have changed to:

Tag2(Version version)
Tag2Header(Version version, Tag2HeaderFlags flags, int tagLength)
Tag2HeaderFlags(Version version, byte flags)

abstract Tag2ExtendedHeader(int paddingLength, byte[] crc)
Tag2ExtendedHeaderPoint3(int paddingLength, byte[] crc)

abstract FrameHeader(String id, int frameLength)
FrameHeaderPoint2(String id, int frameLength)
FrameHeaderPoint3(String id, int frameLength)

Language(String code, String description)
Version(byte code, String description)

abstract Frame(Version version, String id)
TextInformationFrame(Version version, String id, EncodedString information)
CommentsFrame(Version version, String id, TextEncoding encoding, Language language, String description, String text)
UniqueFileIdentifierFrame(Version version, String id, String ownerIdentifier, byte[] identifier)
UserDefinedLinkFrame(Version version, String id, EncodedString description, String url)

UnsupportedFrame(Version version, String id, byte[] payload)

FramesGroup()
Hierarchy()

abstract Id3v2Segment()

TextEncoding(byte code, String desc)
EncodedString(TextEncoding encoding, String text)
EncodedString(TextEncoding encoding, byte[] buffer)

ByteArrayTools()

Colour legend

public class
package visible class
private constructor

Keep in mind that the green (public) classes are the only ones accessible to users of the library. This is a update of the older explanation of these classes, which you might want to read first.

I made the two "constant" classes I talked about last time. These types of classes are used because Java doesn't have enumerations -- yet. They limit the range of input on a parameter and simplify testing. Those two classes are Version and Language.

There are only three Version instances: 2.2, 2.3 and 2.4. The byte used in the private constructor are just the minor version numbers 2, 3 and 4. The Language class has contants for all 500 or so languages in ISO-639-2. Yes, it took quite a bit of tedious/brainless typing to make this class! To improve readability I didn't capitalize the Language constants, so English is Language.English. Language is only used in CommentsFrame so far.

Before I fixed my flag reading code I thought I was going to have to read id3v2 tag extended headers. Turns out the test files I have don't have extended headers but I'm going to save this work anyway.

To simplify the Tag2 class I took all of the frame-related methods out of it and made a new class: FramesGroup. FramesGroup uses the Hierarchy class I blogged about yesterday to organize frames. Tag2 only has one FramesGroup.

Posted at August 10, 2004 at 06:58 AM EST
Last updated August 10, 2004 at 06:58 AM EST
Comments

Do you have any plans for making this lib more visible? Like putting part / all of it on something like sourceforge / freshmeat?

I think that will be the best way to get more people to use your lib, which is critical to keeping it alive / improving it.

What are your plans?

» Posted by: Jim at August 11, 2004 10:28 AM

I'll release it on the AudioMan site in its own area. I want to be able to control the development tools I use, and I can do that better on my own site.

If, however, I close the site I'll submit the code to sourceforge so that everyone can still get it. If I decide to stop maintaining it, I can also transfer ownership to someone else.

I'm going to release the code and library soon, under the LGPL.

» Posted by: Ryan at August 11, 2004 10:42 AM

"To improve readability I didn't capitalize the Language constants, so English is Language.English."

didn't or did?

» Posted by: dru at August 25, 2004 10:53 PM
Google
 
Search scope: Web ryanlowe.ca