• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
help with MusicTrackCopyInsert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: help with MusicTrackCopyInsert
      • From: William Stewart <email@hidden>
  • Prev by Date: Notify AU parameter change to host
  • Next by Date: about changing inNumberFrames in renderer callbacks
  • Previous by thread: Re: Notify AU parameter change to host
  • Next by thread: Re: help with MusicTrackCopyInsert
  • Index(es):
    • Date
    • Thread