Abstracting file access in TagLib
wheeler at kde.org
Fri Dec 8 00:49:24 CET 2006
On Friday 08 December 2006 0:05, William Pitcock wrote:
> Well, writing a stream class would be trivial; the main issue is that
> TagLib::File is mostly non-virtual. If TagLib::File were made virtual,
> then there would be little problems. The main issue at present is that
> TagLib::File isn't as abstractable enough to support a VFS layer. I'll
> write a patch to make it work in an abstractable manner soon, I suppose.
It's been on a tentative sometime-in-the-distant-future TODO for a (as of yet
unplanned) TagLib 2.0, but I have no idea when that will happen. This also
isn't as easy as described:
TagLib::File being made virtual wouldn't do it because there are a lot of
subclasses that derive from it. Also adding virtual methods would break
Also, many interesting streams don't provide random access, so the stream
class would really need to have an API for its capabilities and all reading
operations adjusted to account for those.
Really there needs to be a separate stream class which is passed in to the
File constructor and is used for reading the metadata.
Of course, if you've got very specific requirements, you can naturally just
built TagLib inside of your project with whatever changes that you need.
The first principle is that you must not fool yourself and you are the easiest
person to fool.
More information about the taglib-devel