1. with Allegro.Digital_Samples;           use Allegro.Digital_Samples; 
  2.  
  3. -- Allegro 4.4.2 - Audio stream routines 
  4. package Allegro.Audio_Streams is 
  5.  
  6.     type Audiostream is private; 
  7.     type A_Audiostream is access all Audiostream; 
  8.  
  9.     type Bits_Type is ( Eight_Bits, Sixteen_Bits ); 
  10.     for Bits_Type use (Eight_Bits => 8, Sixteen_Bits => 16); 
  11.     for Bits_Type'Size use Integer'Size; 
  12.  
  13.     ---------------------------------------------------------------------------- 
  14.  
  15.     procedure Free_Audio_Stream_Buffer( stream : A_Audiostream ); 
  16.  
  17.     function Get_Audio_Stream_Buffer( stream : not null A_Audiostream ) return Address; 
  18.  
  19.     function Play_Audio_Stream( len    : Natural; 
  20.                                 bits   : Bits_Type; 
  21.                                 stereo : Integer; 
  22.                                 freq   : Integer; 
  23.                                 vol    : Volume_Type; 
  24.                                 pan    : Pan_Type ) return A_Audiostream; 
  25.  
  26.     procedure Stop_Audio_Stream( stream : in out A_Audiostream ); 
  27.  
  28. private 
  29.  
  30.     type Audiostream is 
  31.         record 
  32.             voice    : Integer;        -- the voice we are playing on 
  33.             samp     : A_Sample;       -- the sample we are using 
  34.             len,                       -- buffer length 
  35.             bufcount,                  -- number of buffers per sample half 
  36.             bufnum,                    -- current refill buffer 
  37.             active   : Integer;        -- which half is currently playing 
  38.             locked   : Address;        -- the locked buffer 
  39.         end record; 
  40.     pragma Convention( C, Audiostream ); 
  41.  
  42.     ---------------------------------------------------------------------------- 
  43.  
  44.     pragma Import( C, Free_Audio_Stream_Buffer, "free_audio_stream_buffer" ); 
  45.     pragma Import( C, Get_Audio_Stream_Buffer, "get_audio_stream_buffer" ); 
  46.     pragma Import( C, Play_Audio_Stream, "play_audio_stream" ); 
  47.  
  48. end Allegro.Audio_Streams;