Function

MusicTrackCopyInsert

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

Declaration

OSStatus MusicTrackCopyInsert(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 in the destination music track, starting at the insertion point, are pushed later in time (that is, away from the start of the track) to make room for the inserted events.

The inSourceStartTime value must be less than the inSourceEndTime value.