Re: MIDIPacketListAdd and MIDITimeStamp
Re: MIDIPacketListAdd and MIDITimeStamp
- Subject: Re: MIDIPacketListAdd and MIDITimeStamp
- From: Kurt Revis <email@hidden>
- Date: Sun, 18 Aug 2002 13:27:59 -0700
Assuming that MIDISend doesn't just ignore my timestamps, what are
appropriate values? Or perhaps I need to set the timestamp to zero and
schedule things myself, perhaps with an NSTimer or something?
This is exactly what the timestamps are for! MIDISend will respect the
timestamp that you provide. If it's nonzero and in the future, it will
schedule the event to be sent at that time.
Use the routines in HostTime.h (in CoreAudio.framework) to get values
for a timestamp. For example, if you want to send an event in one
second, set a timestamp of (AudioGetCurrentHostTime() +
AudioConvertNanosToHostTime(1000000000)).
You can use a timestamp of zero and do the scheduling yourself, but it's
tricky. I highly recommend letting CoreMIDI do the scheduling for you,
whenever possible.
--
Kurt Revis
email@hidden
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.