help with MusicTrackCopyInsert
help with MusicTrackCopyInsert
- Subject: help with MusicTrackCopyInsert
- From: gary <email@hidden>
- Date: Fri, 27 May 2005 16:30:52 +0900
Hi,
Im trying to copy a range of midi events from one track in sequenceA
to another in sequenceB
with the code below (minus the error handling), but the contents of the
destination track
are always empty - can anyone suggest where im going wrong?
thanks for any help,
Gary
MusicPlayer mplayer;
MusicSequence sequenceA;
MusicSequence sequenceB;
NewMusicPlayer(&mplayer);
NewMusicSequence(&sequenceA);
NewMusicSequence(&sequenceB);
FSPathMakeRef ((const UInt8*)argv[1], &fsRef, 0);
FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL, &fsSpec, NULL);
MusicSequenceLoadSMF(sequenceA, &fsSpec);
MusicPlayerSetSequence(mplayer, sequenceA);
// source track
MusicTrack strack;
MusicTimeStamp trackLength;
MusicTimeStamp start = 0.0;
UInt32 propsize = sizeof(MusicTimeStamp);
MusicSequenceGetIndTrack(sequenceA, 0, &strack);
MusicTrackGetProperty(strack,
kSequenceTrackProperty_TrackLength,&trackLength, &propsize);
CAShow(strack);
// destination track
MusicTrack ctrack;
MusicSequenceNewTrack(sequenceB, &ctrack);
MusicSequenceGetIndTrack(sequenceB, 0, &ctrack);
MusicTrackCopyInsert(strack, start, trackLength, ctrack, start);
CAShow(ctrack);
result:
SequenceTrack @500F8B0
NumEvents:1
0.000: MetaEvent:54
0: C0 00 00 00 00 .....
SequenceTrack @50A60D0
NumEvents:0
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden