1. with Events; 
  2.  
  3. pragma Elaborate_All( Events ); 
  4.  
  5. package Events.Audio is 
  6.  
  7.     type Play_Music_Event is new Event with private; 
  8.     type A_Play_Music_Event is access all Play_Music_Event'Class; 
  9.  
  10.     PLAY_MUSIC_ID : constant Event_Id := To_Event_Id( "Play_Music" ); 
  11.  
  12.     function Get_Music_Name( this : not null access Play_Music_Event'Class ) return String; 
  13.     pragma Postcondition( Get_Music_Name'Result'Length > 0 ); 
  14.  
  15.     ---------------------------------------------------------------------------- 
  16.  
  17.     type Play_Sound_Event is new Event with private; 
  18.     type A_Play_Sound_Event is access all Play_Sound_Event'Class; 
  19.  
  20.     PLAY_SOUND_ID : constant Event_Id := To_Event_Id( "Play_Sound" ); 
  21.  
  22.     function Get_Sound_Name( this : not null access Play_Sound_Event'Class ) return String; 
  23.     pragma Postcondition( Get_Sound_Name'Result'Length > 0 ); 
  24.  
  25.     ---------------------------------------------------------------------------- 
  26.  
  27.     type Stop_Music_Event is new Event with private; 
  28.     type A_Stop_Music_Event is access all Stop_Music_Event'Class; 
  29.  
  30.     STOP_MUSIC_ID : constant Event_Id := To_Event_Id( "Stop_Music" ); 
  31.  
  32.     ---------------------------------------------------------------------------- 
  33.  
  34.     procedure Queue_Play_Music( name : String ); 
  35.     pragma Precondition( name'Length > 0 ); 
  36.  
  37.     procedure Queue_Play_Sound( name : String ); 
  38.     pragma Precondition( name'Length > 0 ); 
  39.  
  40.     procedure Queue_Stop_Music; 
  41.  
  42. private 
  43.  
  44.     type Play_Sound_Event is new Event with 
  45.         record 
  46.             name : Unbounded_String; 
  47.         end record; 
  48.  
  49.     procedure Construct( this : access Play_Sound_Event; name : String ); 
  50.     pragma Precondition( name'Length > 0 ); 
  51.  
  52.     function To_String( this : access Play_Sound_Event ) return String; 
  53.  
  54.     ---------------------------------------------------------------------------- 
  55.  
  56.     type Play_Music_Event is new Event with 
  57.         record 
  58.             name : Unbounded_String; 
  59.         end record; 
  60.  
  61.     procedure Construct( this : access Play_Music_Event; name : String ); 
  62.     pragma Precondition( name'Length > 0 ); 
  63.  
  64.     function To_String( this : access Play_Music_Event ) return String; 
  65.  
  66.     ---------------------------------------------------------------------------- 
  67.  
  68.     type Stop_Music_Event is new Event with null record; 
  69.  
  70. end Events.Audio;