with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLBGsound_Interface is

   procedure Initialize (This : in out IHTMLBGsound_Type) is
   begin
      Set_IID (This, IID_IHTMLBGsound);
   end Initialize;

   function Pointer (This : IHTMLBGsound_Type)
     return Pointer_To_IHTMLBGsound
   is
   begin
      return To_Pointer_To_IHTMLBGsound (Address (This));
   end Pointer;

   procedure Attach (This    : in out IHTMLBGsound_Type;
                     Pointer : in     Pointer_To_IHTMLBGsound)
   is
   begin
      Attach (This, GNATCOM.IInterface.To_Pointer_To_IUnknown
              (Pointer.all'Address));
   end Attach;

   procedure Put_src
     (This : IHTMLBGsound_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_src
         (Pointer (This),
          p));

      if Free then
               GNATCOM.IInterface.Free (p);
      
      end if;

   end Put_src;

   function Get_src
     (This : IHTMLBGsound_Type)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_src
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_src;

   procedure Put_loop
     (This : IHTMLBGsound_Type;
      p    : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_loop
         (Pointer (This),
          p));

      if Free then
               GNATCOM.IInterface.Free (p);
      
      end if;

   end Put_loop;

   function Get_loop
     (This : IHTMLBGsound_Type)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_loop
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_loop;

   procedure Put_volume
     (This : IHTMLBGsound_Type;
      p    : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_volume
         (Pointer (This),
          p));

      if Free then
               GNATCOM.IInterface.Free (p);
      
      end if;

   end Put_volume;

   function Get_volume
     (This : IHTMLBGsound_Type)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_volume
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_volume;

   procedure Put_balance
     (This : IHTMLBGsound_Type;
      p    : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_balance
         (Pointer (This),
          p));

      if Free then
               GNATCOM.IInterface.Free (p);
      
      end if;

   end Put_balance;

   function Get_balance
     (This : IHTMLBGsound_Type)
     return GNATCOM.Types.VARIANT
   is
       RetVal : aliased GNATCOM.Types.VARIANT;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_balance
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_balance;

end MSHTML.IHTMLBGsound_Interface;

