Function

MusicTrackMerge

Copies a range of events from one music track and merges them into another music track.

Declaration

OSStatus MusicTrackMerge(MusicTrack inSourceTrack, MusicTimeStamp inSourceStartTime, MusicTimeStamp inSourceEndTime, MusicTrack inDestTrack, MusicTimeStamp inDestInsertTime);

Parameters

inSourceTrack

The music track that you want to copy events from.

inSourceStartTime

The start time, in beats, for the range of music track events that you want to copy from the source track.

inSourceEndTime

The end time, in beats, for the range of music track events that you want to copy from the source track.

inDestTrack

The music track that you want to add events to.

inDestInsertTime

The insertion point, in beats, in the destination music track for the copied events.

Return Value

A result code.

Discussion

The events inserted into the destination music track are merged with existing events in that track. The events in the destination track that existed prior to calling this function remain in place.

The inSourceStartTime value must be less than the inSourceEndTime value.