package Allegro.Timers is
type A_Timer_Handler is
access procedure;
type A_Paramaterized_Timer_Handler is
access procedure( param : Address );
type A_Rest_Callback is
access procedure;
type Clock_Ticks is private;
function Get_Retrace_Count return Integer;
function Install_Int( proc : not null A_Timer_Handler;
millis : Integer ) return Integer;
function Install_Int_Ex( proc : not null A_Timer_Handler;
speed : Clock_Ticks ) return Integer;
function Install_Param_Int( proc : not null A_Paramaterized_Timer_Handler;
param : Address;
millis : Integer ) return Integer;
function Install_Param_Int_Ex( proc : not null A_Paramaterized_Timer_Handler;
param : Address;
speed : Clock_Ticks ) return Integer;
function Install_Timer return Integer;
procedure Remove_Int( proc : not null A_Timer_Handler );
procedure Remove_Param_Int( proc : not null A_Paramaterized_Timer_Handler;
param : Address );
procedure Remove_Timer;
procedure Rest( millis : Unsigned_32 );
procedure Rest_Callback( millis : Unsigned_32; callback : A_Rest_Callback );
function Msec_To_Ticks( x : Natural ) return Clock_Ticks;
function Secs_To_Ticks( x : Natural ) return Clock_Ticks;
function Bps_To_Ticks( x : Natural ) return Clock_Ticks;
function Bpm_To_Ticks( x : Natural ) return Clock_Ticks;
private
type Clock_Ticks is new Integer;
pragma Convention( C, A_Timer_Handler );
pragma Convention( C, A_Paramaterized_Timer_Handler );
pragma Convention( C, A_Rest_Callback );
pragma Import( C, Get_Retrace_Count, "get_retrace_count" );
pragma Import( C, Install_Int, "install_int" );
pragma Import( C, Install_Int_Ex, "install_int_ex" );
pragma Import( C, Install_Param_Int, "install_param_int" );
pragma Import( C, Install_Param_Int_Ex, "install_param_int_ex" );
pragma Import( C, Install_Timer, "install_timer" );
pragma Import( C, Remove_Int, "remove_int" );
pragma Import( C, Remove_Param_Int, "remove_param_int" );
pragma Import( C, Remove_Timer, "remove_timer" );
pragma Import( C, Rest, "rest" );
pragma Import( C, Rest_Callback, "rest_callback" );
end Allegro.Timers;