[vorbis-dev] Reading tags (again)...

Michael Smith msmith at labyrinth.net.au
Mon Nov 12 17:57:16 PST 2001



>
>1) An example isn't an excuse for not having API documentation.  I'm not 
>trying to be ungrateful or to whine, it would just be nice if since you guys 
>went to the trouble to write the library functions that there's some nice API 
>documentation so that people can easily use your work.

The problem with comment writing isn't the lack of API documentation 
(those bits of the API aren't well documented, but they're pretty easy),
it's just that doing what you want is pretty complex. 

>
>2) If the library calls aren't "accessible" enough to be used by end 
>programmers then it would seem that there needs to be another layer of 
>abstraction in the libraries.  

Yes. This is what vcedit IS - a layer of abstraction over the libraries
for doing comment editing. Several applications use it as such. I 
certainly wouldn agree that the libvorbis and libogg APIs are too low-level
for this sort of application programming, which is precisely WHY I made
this available under a license which makes it widely usable. 

>
>3) I may write a C++ wrapper to the libraries that allows for some more 
>advanced features.  Or, rather some more simple features that do advanced 
>things.  I would like to be able to write something like this:
>
> OggVorbisFile ovFile("foo.ogg");
> OggVorbisComment ovComment(ovFile);
> ovComment.update("artist","Miles Davis");
> ovComment.write();
> ovFile.close();

Without being C++, the 'API' that vcedit provides is basically this, though
it doesn't use vorbisfile at all (that's inappropriate, as vorbisfile is
purely for decoding). With a bit of memory-allocation housekeeping omitted
for clarity, it amounts to this:

FILE *file = fopen("foo.ogg", "r");
...
vcedit_open(state,file);
comments = vcedit_comments(state);

... /* Use the standard libvorbis comment functions to edit this
       structure, such as vorbis_comment_add_tag(). */
vcedit_write(state, outputfile);

Writing a C++ wrapper around this to work like what you gave above
would be at most a few minutes work.

Michael

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list