MusicEventIteratorPreviousEvent(_:)
Positions a music event iterator at the previous event on a music track.
Declaration
func MusicEventIteratorPreviousEvent(_ inIterator: MusicEventIterator) -> OSStatusParameters
- inIterator:
The music event iterator to reposition.
Return Value
A result code.
Discussion
Use this function to decrement a music event iterator, moving it backward through a music track’s events.
If an iterator is at the first event of a track when you call this function, the iterator position remains unchanged and this function returns an error.
The following code snippet illustrates how to use a music event iterator to proceed backward along a music track, from the end:
// Points iterator just beyond the final event on its music track
MusicEventIteratorSeek (myIterator, kMusicTimeStamp_EndOfTrack);
bool hasPreviousEvent;
MusicEventIteratorHasPreviousEvent (myIterator, &hasPreviousEvent);
while (hasPreviousEvent) {
MusicEventIteratorPreviousEvent (myIterator);
// do work here
MusicEventIteratorHasPreviousEvent (myIterator, &hasPreviousEvent);
}See Also
Iterating Over Music Events
NewMusicEventIterator(_:_:)DisposeMusicEventIterator(_:)MusicEventIteratorNextEvent(_:)MusicEventIteratorSeek(_:_:)MusicEventIteratorDeleteEvent(_:)MusicEventIteratorGetEventInfo(_:_:_:_:_:)MusicEventIteratorHasCurrentEvent(_:_:)MusicEventIteratorHasNextEvent(_:_:)MusicEventIteratorHasPreviousEvent(_:_:)MusicEventIteratorSetEventInfo(_:_:_:)MusicEventIteratorSetEventTime(_:_:)MusicEventIteratorMusicEventTypeExtendedNoteOnEventExtendedTempoEvent