DWORD WINAPI MidiRemoveTrackEvents ( HANDLE hSequence, WORD wTrack, QWORD qwFirst, QWORD qwLast, DWORD dwFormat );
This function removes the events inside the specified range from a track.
MIDI_INDEX
for ordinal positions or MIDI_TICKS
for tick positions.Returns the new number of events of the sequence or zero if an error occurred. The reasons for an error are an invalid sequence handle, an invalid track index or an invalid event range or range format.
MidiRemoveTrackEvents may be slow. Try to reduce its utilization. The example below shows two ways of truncating a track:
HANDLE Sequence; // Slower method MidiOpen("test1.mid", NO_DEVICE, &Sequence); MidiRemoveTrackEvents(Sequence, 0, 0, MidiTrackGet(Sequence, 0, EVENT_COUNT)-1, MIDI_INDEX); MidiClose(Sequence); // Faster method MidiOpen("test1.mid", NO_DEVICE, &Sequence); MidiRemoveTrack(Sequence, 0); MidiInsertTrack(Sequence, 0); MidiClose(Sequence);
Released in November 19th, 2003
Updated in April 29th, 2004
Property of Breno de Lima Sarmento
Home page: http://www27.brinkster.com/brels
E-mail: [email protected]
ICQ: 78977999 ()