Re: Midi2 handling of SysEx data
"Martijn Sipkema" <[email protected]> Sun, 1 Feb 2004 14:22:31 +0100
| Newsgroups | gmane.os.openbeos.midi |
|---|---|
| Message-ID | <003301c3e8c6$72c86450$161b14ac@boromir> |
>> I'm working on some SexEx Send/Receive tools, and found out that SysEx
>> data handled by Midi2 gets the first and last bytes stripped off.
>
> The OpenBeOS Midi2 kit works exactly like the BeOS R5 kit in that regar=
d.
> Which means we can't change that.
>
> However, you can override the Data() hook to look for a sysex yourself.
The
> data buffer that is passed to Data() does include the control bytes (at
> least 0xF0, but not necessarily 0xF7). You would do something like this=
:
>
> void MyConsumer::Data(.....)
> {
> if (atomic && data[0] =3D=3D B_SYS_EX_START)
> {
> // do your thing
> }
> else
> {
> // let superclass handle it
> BMidiLocalConsumer::Data(.....);
> }
>}
One thing I never quite understood is the 'atomic' flag. IIRC the MIDI
message callbacks are only called for data with atomic =3D=3D true, as yo=
u
are doing here also. For large SysEx messages it would make sense to
send them non-atomically, but this causes them to be ignored by most
(probably all) applications...
--ms