Function

NewMusicEventIterator(_:_:)

Creates a new music event iterator.

Declaration

func NewMusicEventIterator(_ inTrack: MusicTrack, _ outIterator: UnsafeMutablePointer<MusicEventIterator?>) -> OSStatus

Parameters

inTrack

The music track to iterate over.

outIterator

On output, the newly created music event iterator.

Return Value

A result code.

Discussion

A newly-created music event iterator points at the first event on the music track specified in the inTrack parameter.

If you edit a music track after associating it with a music event iterator, you must discard iterator and create a new one. Perform the following steps after editing the track:

  1. Obtain the current position using the MusicEventIteratorGetEventInfo(_:_:_:_:_:) function, and save the position.

  2. Dispose of the music event iterator.

  3. Create a new iterator.

  4. Seek to the desired position using the MusicEventIteratorSeek(_:_:) function.

See Also