[vorbis-dev] Reading OGG embedded in a pack file
lourens at rainbowdesert.net
Thu May 6 01:08:45 PDT 2004
On Thu 6 May 2004 09:10, Andre Krause wrote:
> Seems as it would be a very good idea to supply some sort of
> helper function that takes a filepointer (from an archive for
> example) or a pointer to memory and a start- and end - offsets to
> the positions where the ogg in that archive / memblocks starts /
> ends and creates the necessary callback functions. For passionate
> c programmers like you ogg develprs, callbacks seem to be the
> most natural thing to solve such problems, but for beginner
> programmers or hobby game programmers its always a big barrier to
> start coding such. Ok, argument would be not to bloat the api,
> but whats the use of a lean api, when people who wish to use ogg
> in their programs first must start long threads or fiddle around
> be themselves to get an idea whats going wrong and why ogg
> behaves so strange at first sight.
Give a man a fish...
Function pointers are a part of the C language, and they're a good
solution in this case. If you don't understand them, you should
educate yourself, or use a different language.
Otherwise, where does it end? Take C++. You could argue that
templates are hard to understand, so they shouldn't be used. And
ofcourse there is someone who doesn't understand object oriented
programming, so perhaps we should do away with those pesky class
things as well. Splitting things up in functions can also be
difficult, so perhaps we should just write everything in one big
main() function. And structured programming is hard too, so let's
just use a lot of GOTOs.
Okay, this is an extreme example ofcourse, but I think that teaching
people a language feature they don't understand is more useful than
just not using it. Of course it's not up to me to tell anyone what
to do, so if you want to write such a wrapper go right ahead. I
just think that the real problem isn't with the API.
GPG public key: http://home.student.utwente.nl/l.e.veen/lourens.key
--- >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