unit iz_squall;

interface
uses
  windows, iz_types, squall;

type
  IZSquall = class
    constructor Create();
    destructor Destroy();
    function  Load( SampleName : PChar) : integer;
    procedure Play( id, loop, vol : integer );
    procedure Stop( id : integer );
  end;

var
  eSquall : IZSquall;
  sndFon : uint;

implementation

constructor IZSquall.Create();
begin
  if ( SQUALL_Init( 0 ) < 0 ) then
  begin
    Squall_Free();
    Destroy();
  end;
end;

destructor IZSquall.Destroy();
begin
  SQUALL_Free();
end;

function IZSquall.Load( SampleName : PChar) : int;
begin
 Result := SQUALL_Sample_LoadFile( SampleName, 1, 0 );
 if Result < 0 then Result := High(int);
end;

procedure IZSquall.Play( id, loop, vol : integer );
begin
  SQUALL_Sample_Play( id, loop, vol, 1 );
end;

procedure IZSquall.Stop( id : integer );
begin
  SQUALL_Sample_Stop( {Samples[}id{]} );
end;

end.
