with Events;
pragma Elaborate_All( Events );
package Events.Audio is
type Play_Music_Event is new Event with private;
type A_Play_Music_Event is access all Play_Music_Event'Class;
PLAY_MUSIC_ID : constant Event_Id := To_Event_Id( "Play_Music" );
function Get_Music_Name( this : not null access Play_Music_Event'Class ) return String;
pragma Postcondition( Get_Music_Name'Result'Length > 0 );
type Play_Sound_Event is new Event with private;
type A_Play_Sound_Event is access all Play_Sound_Event'Class;
PLAY_SOUND_ID : constant Event_Id := To_Event_Id( "Play_Sound" );
function Get_Sound_Name( this : not null access Play_Sound_Event'Class ) return String;
pragma Postcondition( Get_Sound_Name'Result'Length > 0 );
type Stop_Music_Event is new Event with private;
type A_Stop_Music_Event is access all Stop_Music_Event'Class;
STOP_MUSIC_ID : constant Event_Id := To_Event_Id( "Stop_Music" );
procedure Queue_Play_Music( name : String );
pragma Precondition( name'Length > 0 );
procedure Queue_Play_Sound( name : String );
pragma Precondition( name'Length > 0 );
procedure Queue_Stop_Music;
private
type Play_Sound_Event is new Event with
record
name : Unbounded_String;
end record;
procedure Construct( this : access Play_Sound_Event; name : String );
pragma Precondition( name'Length > 0 );
function To_String( this : access Play_Sound_Event ) return String;
type Play_Music_Event is new Event with
record
name : Unbounded_String;
end record;
procedure Construct( this : access Play_Music_Event; name : String );
pragma Precondition( name'Length > 0 );
function To_String( this : access Play_Music_Event ) return String;
type Stop_Music_Event is new Event with null record;
end Events.Audio;