Re: MIDITimeStamp
Re: MIDITimeStamp
- Subject: Re: MIDITimeStamp
- From: Geoff Pointer <email@hidden>
- Date: Thu, 02 Oct 2003 13:01:28 +0900
- Priority: normal
On Wed, 1 Oct 2003 09:27:03 +0100
Mark Woollard <email@hidden> asked:
>
Could someone elaborate on the details of the
MIDITimeStamp? What units are used?
HostTime is a 64 bit unsigned integer which is very simple to
manipulate arithmetically and is returned by
AudioGetCurrentHostTime(). AbsoluteTime is the exact same
value but is in a more complicated form that was used to
handle numbers bigger than 32 bit integers before there were
64 bit integers. It is two 32 bit integers in a struct. Both these
types can be typecast to each other.
UInt64 HostTimeValue = AudioGetCurrentHostTime();
UInt64 AbsTimeConvert;
AbsoluteTime AbsTimeValue = UpTime();
AbsoluteTime HostTimeConvert;
AbsTimeConvert = *(UInt64*)&AbsTimeValue;
HostTimeConvert = *(AbsoluteTime*)&HostTimeValue;
If you ever need to use a routine like MPDelayUntil you will
have to use an AbsoluteTime and the above conversions will
be useful. Otherwise working with HostTimes (UInt64) is much
more convenient as they can be used just like any other
integer and converting between them and nanosecond values
is easy using the functions in HostTime.h.
Cheers - Geoff %^>
_______________________________________________
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.