MidiAvailEv


Gives a pointer to the first event at the head of the reception FIFO, without extracting it. MidiAvailEv can be used if an application wants to test the first event in its reception FIFO, without processing it.

pascal     MidiEvPtr        MidiAvailEv (short refnum) ; 

refNum
a 16-bit integer, it is the reference number of the application.

The result is a MidiEvPtr, a pointer to the first event in the reception FIFO, or NIL if the reception FIFO is empty.


A function that calculates for how long events have been waiting in the reception FIFO.


long CalculateWaitTime (short refNum)
{
    MidiEvPtr    e;

    if (e = MidiAvailEv (refNum))
        return MidiGetTime() - Date(e);
    else
        return 0;
}

as the event is still in the reception FIFO it must not be destroyed or transmitted. It can just be tested or duplicated.