/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version: 1.3.21
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */


Class name: Convolver extends: Effect fields: swigCPtrForConvolver {

  Method [ pvtSetCPtr: newCPtr memoryOwn: newCMemoryOwn
    super pvtSetCPtr: (CslNI cslNI_SWIGConvolverToEffect: newCPtr) memoryOwn: newCMemoryOwn.
    swigCPtrForConvolver := newCPtr.
  ]

  Method [ getCPtrForConvolver
    ^swigCPtrForConvolver
  ]


  Method[ swigFinalize
    super swigFinalize.
    self delete.
  ]

  Method [ delete 
    (swigCMemoryOwn and:[ swigCPtrForConvolver ~~ 0 ]) ifTrue:[
      swigCMemoryOwn := false.
      CslNI cslNI_delete_Convolver: swigCPtrForConvolver.
    ].
    swigCPtrForConvolver := 0.
    super delete.
  ]

  Function[ getCPtr: obj
     obj isNil ifTrue:[^0].
     ^obj getCPtrForConvolver
  ]

  Function [ new
    ^self fromPointer: (CslNI cslNI_new_Convolver__SWIG_0) memoryOwn: true
  ]

  Function [ IRfilename: IRfilename
    ^self fromPointer: (CslNI cslNI_new_Convolver__SWIG_1: IRfilename asNullTermStringParameter) memoryOwn: true
  ]

  Function [ len: len impulseResp: impulseResp
    ^self fromPointer: (CslNI cslNI_new_Convolver__SWIG_2: len, (Buffer getCPtr: impulseResp)) memoryOwn: true
  ]

  Function [ len: len IRfilename: IRfilename
    ^self fromPointer: (CslNI cslNI_new_Convolver__SWIG_3: len, IRfilename asNullTermStringParameter) memoryOwn: true
  ]

  Function [ inbuf: inbuf
    ^self fromPointer: (CslNI cslNI_new_Convolver__SWIG_4: (Buffer getCPtr: inbuf)) memoryOwn: true
  ]

  Method [ initialize: buf 
    CslNI cslNI_Convolver_initialize: swigCPtrForConvolver with: (Buffer getCPtr: buf)
  ]

  Method [ setFilters: filterFFTs 
    CslNI cslNI_Convolver_setFilters: swigCPtrForConvolver with: (SwigTypePpfftwfcomplex getCPtr: filterFFTs)
  ]

  Method [ setInputf: inFFT 
    CslNI cslNI_Convolver_setInputf: swigCPtrForConvolver with: (SwigTypePfftwfcomplex getCPtr: inFFT)
  ]

  Method [ setMSampleBuffer: mSampleBuffer 
    CslNI cslNI_set_Convolver_mSampleBuffer: swigCPtrForConvolver with: (SwigTypePfloat getCPtr: mSampleBuffer)
  ]

  Method [ getMSampleBuffer 
    |cPtr|
    cPtr := CslNI cslNI_get_Convolver_mSampleBuffer: swigCPtrForConvolver .
    ^(cPtr == 0) ifTrue:[ nil ] ifFalse:[ SwigTypePfloat fromPointer: cPtr memoryOwn: false ]
  ]

  Method [ nextBuffer: outputBuffer outBufNum: outBufNum 
    CslNI cslNI_Convolver_nextBuffer: swigCPtrForConvolver with: (Buffer getCPtr: outputBuffer) with: outBufNum
  ]

}
