NewMusicEventIterator(_:_:)
Creates a new music event iterator.
Declaration
func NewMusicEventIterator(_ inTrack: MusicTrack, _ outIterator: UnsafeMutablePointer<MusicEventIterator?>) -> OSStatusParameters
- 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:
Obtain the current position using the MusicEventIteratorGetEventInfo(_:_:_:_:_:) function, and save the position.
Dispose of the music event iterator.
Create a new iterator.
Seek to the desired position using the MusicEventIteratorSeek(_:_:) function.
See Also
Iterating Over Music Events
DisposeMusicEventIterator(_:)MusicEventIteratorNextEvent(_:)MusicEventIteratorSeek(_:_:)MusicEventIteratorDeleteEvent(_:)MusicEventIteratorGetEventInfo(_:_:_:_:_:)MusicEventIteratorHasCurrentEvent(_:_:)MusicEventIteratorHasNextEvent(_:_:)MusicEventIteratorHasPreviousEvent(_:_:)MusicEventIteratorPreviousEvent(_:)MusicEventIteratorSetEventInfo(_:_:_:)MusicEventIteratorSetEventTime(_:_:)MusicEventIteratorMusicEventTypeExtendedNoteOnEventExtendedTempoEvent