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

"Martijn Sipkema" <[email protected]> Sat, 31 Jan 2004 19:00:35 +0100
Newsgroups gmane.os.openbeos.midi
Message-ID <002001c3e824$20372f20$161b14ac@boromir>
>> Please take a look at it and let me know if coding style and variable
>> names are okay.
[...]
> Although I wonder why you declared all local variables "static," since
> that doesn't seem to be necessary, judging from your code.

It won't work without the static, but it won't work correctly with them
either; it is not a good idea to store state in static variables. Perhaps
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 the state. This allows correct parsing of more than one stream
from a single application.

--ms