MidiClearSeq


Frees the content of a sequence. MidiClearSeq de-allocates all the events of the given sequence, consequently this sequence becomes empty.

pascal void    MidiClearSeq (MidiSeqPtr s);

s
a MidiSeqPtr,is a pointer on a sequence whose events are to be freed.


Suppress all but the first event of a sequence.


void ClearAllButFirst (MidiSeqPtr s)
{
    MidiEvPtr e;
    
    if (s && First(s))            /* Check a non empty sequence */
    {
        e = MidiCopyEv(First(s));/* make a copy of the first event */
        MidiClearSeq(s);    /* clear the content of the sequence  */
        MidiAddSeq(s, e);    /* add the event to the empty sequence */
    }
}
        

a sequence consist of a header of 4 pointers. The first one points to the first event of the sequence. The second one points to the last event. The other two pointers are reserved for future extensions and must be NIL. In an empty sequence, the pointers to the first and last events are NIL.