Positions a music event iterator at the next event on a music track.


OSStatus MusicEventIteratorNextEvent(MusicEventIterator inIterator);



The music event iterator to reposition.

Return Value

A result code.


Use this function to increment the position of a music event iterator forward through a music track’s events.

If an iterator is at the final event of a track when you call this function, the iterator then moves beyond the final event. You can detect if the iterator is beyond the final event by calling the MusicEventIteratorHasCurrentEvent function.

The following code snippet illustrates how to use a music event iterator to proceed forward along a music track, from the start:

// Create a new iterator, which automatically points at the first event
// on the iterator's music track.
bool hasCurrentEvent;
MusicEventIteratorHasCurrentEvent (myIterator, &hasCurrentEvent);
while (hasCurrentEvent) {
        // do work here
    MusicEventIteratorNextEvent (myIterator);
    MusicEventIteratorHasCurrentEvent (myIterator, &hasCurrentEvent);

See Also