1
{==================================================================================================
2
File: CoreAudio/HostTime.h
4
Contains: Routines for accessing the host's time base
6
Version: Technology: Mac OS X
9
Copyright: (c) 1985-2005 by Apple Computer, Inc., all rights reserved.
11
==================================================================================================}
13
{ Pascal Translation: Gale R Paeper, <gpaeper@empirenet.com>, 2006 }
16
Modified for use with Free Pascal
18
Please report any bugs to <gpc@microbizz.nl>
29
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
30
{$setc GAP_INTERFACES_VERSION := $0200}
32
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
33
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
36
{$ifc defined CPUPOWERPC and defined CPUI386}
37
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
39
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
40
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
43
{$ifc not defined __ppc__ and defined CPUPOWERPC}
48
{$ifc not defined __i386__ and defined CPUI386}
54
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
55
{$error Conflicting definitions for __ppc__ and __i386__}
58
{$ifc defined __ppc__ and __ppc__}
59
{$setc TARGET_CPU_PPC := TRUE}
60
{$setc TARGET_CPU_X86 := FALSE}
61
{$elifc defined __i386__ and __i386__}
62
{$setc TARGET_CPU_PPC := FALSE}
63
{$setc TARGET_CPU_X86 := TRUE}
65
{$error Neither __ppc__ nor __i386__ is defined.}
67
{$setc TARGET_CPU_PPC_64 := FALSE}
69
{$ifc defined FPC_BIG_ENDIAN}
70
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
71
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
72
{$elifc defined FPC_LITTLE_ENDIAN}
73
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
74
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
76
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
78
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
79
{$setc CALL_NOT_IN_CARBON := FALSE}
80
{$setc OLDROUTINENAMES := FALSE}
81
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
82
{$setc OPAQUE_UPP_TYPES := TRUE}
83
{$setc OTCARBONAPPLICATION := TRUE}
84
{$setc OTKERNEL := FALSE}
85
{$setc PM_USE_SESSION_APIS := TRUE}
86
{$setc TARGET_API_MAC_CARBON := TRUE}
87
{$setc TARGET_API_MAC_OS8 := FALSE}
88
{$setc TARGET_API_MAC_OSX := TRUE}
89
{$setc TARGET_CARBON := TRUE}
90
{$setc TARGET_CPU_68K := FALSE}
91
{$setc TARGET_CPU_MIPS := FALSE}
92
{$setc TARGET_CPU_SPARC := FALSE}
93
{$setc TARGET_OS_MAC := TRUE}
94
{$setc TARGET_OS_UNIX := FALSE}
95
{$setc TARGET_OS_WIN32 := FALSE}
96
{$setc TARGET_RT_MAC_68881 := FALSE}
97
{$setc TARGET_RT_MAC_CFM := FALSE}
98
{$setc TARGET_RT_MAC_MACHO := TRUE}
99
{$setc TYPED_FUNCTION_POINTERS := TRUE}
100
{$setc TYPE_BOOL := FALSE}
101
{$setc TYPE_EXTENDED := FALSE}
102
{$setc TYPE_LONGLONG := TRUE}
103
uses MacTypes,CoreAudioTypes;
107
//==================================================================================================
108
//#pragma mark Theory of Operation
112
This collection of functions provides access to the host's time base. It also provides
113
discriptive information about the time base and translations to and from nanoseconds.
118
@functiongroup HostTime
122
@function AudioGetCurrentHostTime
123
@abstract Gets the current host time.
124
@result A UInt64 containing the current host time.
126
function AudioGetCurrentHostTime: UInt64; external name '_AudioGetCurrentHostTime';
127
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
130
@function AudioGetHostClockFrequency
131
@abstract Gets the number of ticks per second in the host time base.
132
@result A Float64 containing the number of ticks per second in the host time base.
134
function AudioGetHostClockFrequency: Float64; external name '_AudioGetHostClockFrequency';
135
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
138
@function AudioGetHostClockMinimumTimeDelta
139
@abstract Gets the smallest number of ticks that two succeeding values will ever differ.
141
@result A UInt32 containing the smallest number of ticks that two succeeding values will
144
function AudioGetHostClockMinimumTimeDelta: UInt32; external name '_AudioGetHostClockMinimumTimeDelta';
145
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
148
@function AudioConvertHostTimeToNanos
149
@abstract Convert the given host time into a time in nanoseconds.
151
A UInt64 containing the host time to convert.
152
@result A UInt64 containining the converted host time.
154
function AudioConvertHostTimeToNanos( inHostTime: UInt64 ): UInt64; external name '_AudioConvertHostTimeToNanos';
155
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
158
@function AudioConvertNanosToHostTime
159
@abstract Convert the given nanosecond time into a host time.
161
A UInt64 containing the nanosecond time to convert.
162
@result A UInt64 containining the converted nanosecond time.
164
function AudioConvertNanosToHostTime( inNanos: UInt64 ): UInt64; external name '_AudioConvertNanosToHostTime';
165
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)