Re: MIDI parser source (bytestream->MIDI messages)

Christian Packmann <[email protected]> Sun, 01 Feb 2004 13:36:18 +0100
Newsgroups gmane.os.openbeos.midi
Message-ID <[email protected]>
Martijn Sipkema wrote:
> > Although I wonder why you declared all local variables "static," sinc=
e=20
>=20
> It won't work without the static, but it won't work correctly with them=
=20
> either; it is not a good idea to store state in static variables. Perha=
ps=20
> you only included the static variables to demonstrate the parser...
>
> You need to have the parser be a member function of a class that holds=20
> the state. This allows correct parsing of more than one stream from a=20
> single application.

You're right of course. I just haven't advanced to the state where I can=20
worry about such petty things as multiple instances of the code. :) But=20
thanks for pointing this out, I may have overlooked this... I'm doing too=
=20
much coding these days. ;)

Bye,
Chris