libpvf considered harmful?

Russell Nelson (nelson@desk.crynwr.com)
23 Jan 1997 05:11:18 -0000


I'm thinking about writing a tcl/tk program to play back audio files.
I'd really like to be able to use the libpvf functions, but they MUST
read and write files.  Wouldn't it be better if they were structured
so that they had two parameters?  One, an integer being the next
sample, and two, a pointer to a structure which described the next
thing to do?

You could construct a dataflow like this:

flowfromfile("/var/spool/voice/incoming/foo.rmd", initzyxel2pvf(
	initpvfspeed( 1.2, initpvf2lin( initfileoutput( "/dev/dsp" ))));

Each entry point into the flow would get called once with the next
item in its input.  Sometimes that would be a byte in the case of
zyxel2pvf, or a 16-bit pvf sample in the case of pvfspeed.  If you
wanted to be really clever, you could even return, as part of the
pointer to a structure that the various init* functions return, a data
type, so that you couldn't construct an inappropriate flow.

Yeah, I know, too much like object-oriented programming.  But it would
make libpvf into a truly useful library.

-- 
-russ <nelson@crynwr.com>    http://www.crynwr.com/~nelson
Crynwr Software sells network driver support    | PGP ok
521 Pleasant Valley Rd. | +1 315 268 1925 voice | Tired of sendmail's bugs?
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | Ask me about qmail tutorial