2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
9 #include <proto/exec.h>
11 #include "camd_intern.h"
14 /*****************************************************************************
18 AROS_LH1(ULONG
, QuerySysEx
,
21 AROS_LHA(struct MidiNode
*, midinode
, A0
),
24 struct CamdBase
*, CamdBase
, 28, Camd
)
27 Returns the number of bytes remaining in the current sys/ex message.
30 midinode - pointer to MidiNode
33 Remaining bytes in sys/ex message. 0 is returned if the last
34 message read from GetMidi() wasn't a sys/ex message.
44 SkipSysEx(), GetSysEx()
50 2001-01-12 ksvalast first created
51 2005-06-30 Lyle Hazelwood fixed sum to include EOX byte
52 2006-01-28 fixed wraparound bug (buffer overflow)
54 *****************************************************************************/
58 struct MyMidiNode
*mymidinode
=(struct MyMidiNode
*)midinode
;
62 if(mymidinode
->lastreadstatus
!=0xf0) return 0;
64 ObtainSemaphore(&mymidinode
->sysexsemaphore2
);
66 if(mymidinode
->sysex_nextis0
==TRUE
){
67 ReleaseSemaphore(&mymidinode
->sysexsemaphore2
);
71 sysex
=mymidinode
->sysex_read
;
76 if(sysex
== mymidinode
->sysex_end
)
77 sysex
= mymidinode
->sysex_start
;
80 ReleaseSemaphore(&mymidinode
->sysexsemaphore2
);