/* ----------------------------------------------------------------------------
 * 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: RingBuffer extends: UnitGenerator fields: swigCPtrForRingBuffer {

  Method [ pvtSetCPtr: newCPtr memoryOwn: newCMemoryOwn
    super pvtSetCPtr: (CslNI cslNI_SWIGRingBufferToUnitGenerator: newCPtr) memoryOwn: newCMemoryOwn.
    swigCPtrForRingBuffer := newCPtr.
  ]

  Method [ getCPtrForRingBuffer
    ^swigCPtrForRingBuffer
  ]


  Method[ swigFinalize
    super swigFinalize.
    self delete.
  ]

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

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

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

  Function [ numChannels: numChannels numFrames: numFrames
    ^self fromPointer: (CslNI cslNI_new_RingBuffer__SWIG_1: numChannels, numFrames) memoryOwn: true
  ]

  Method [ setMCurrentWriteFrame: mCurrentWriteFrame 
    CslNI cslNI_set_RingBuffer_mCurrentWriteFrame: swigCPtrForRingBuffer with: mCurrentWriteFrame
  ]

  Method [ getMCurrentWriteFrame 
    ^CslNI cslNI_get_RingBuffer_mCurrentWriteFrame: swigCPtrForRingBuffer 
  ]

  Method [ setMBuffer: mBuffer 
    CslNI cslNI_set_RingBuffer_mBuffer: swigCPtrForRingBuffer with: (Buffer getCPtr: mBuffer)
  ]

  Method [ getMBuffer 
    |cPtr|
    cPtr := CslNI cslNI_get_RingBuffer_mBuffer: swigCPtrForRingBuffer .
    ^(cPtr == 0) ifTrue:[ nil ] ifFalse:[ Buffer fromPointer: cPtr memoryOwn: false ]
  ]

  Method [ setMTap: mTap 
    CslNI cslNI_set_RingBuffer_mTap: swigCPtrForRingBuffer with: (RingBufferTap getCPtr: mTap)
  ]

  Method [ getMTap 
    |cPtr|
    cPtr := CslNI cslNI_get_RingBuffer_mTap: swigCPtrForRingBuffer .
    ^(cPtr == 0) ifTrue:[ nil ] ifFalse:[ RingBufferTap fromPointer: cPtr memoryOwn: false ]
  ]

  Method [ seekTo: position 
    ^CslNI cslNI_RingBuffer_seekTo: swigCPtrForRingBuffer with: position
  ]

  Method [ setLoopStart: frame 
    CslNI cslNI_RingBuffer_setLoopStart: swigCPtrForRingBuffer with: frame
  ]

  Method [ setLoopEnd: frame 
    CslNI cslNI_RingBuffer_setLoopEnd: swigCPtrForRingBuffer with: frame
  ]

  Method [ nextBuffer: outputBuffer 
    CslNI cslNI_RingBuffer_nextBuffer: swigCPtrForRingBuffer with: (Buffer getCPtr: outputBuffer)
  ]

  Method [ writeBuffer: inputBuffer 
    CslNI cslNI_RingBuffer_writeBuffer__SWIG_0: swigCPtrForRingBuffer with: (Buffer getCPtr: inputBuffer)
  ]

  Method [ sumIntoBuffer: inputBuffer 
    CslNI cslNI_RingBuffer_sumIntoBuffer__SWIG_0: swigCPtrForRingBuffer with: (Buffer getCPtr: inputBuffer)
  ]

  Method [ destructiveNextBuffer: outputBuffer 
    CslNI cslNI_RingBuffer_destructiveNextBuffer: swigCPtrForRingBuffer with: (Buffer getCPtr: outputBuffer)
  ]

  Method [ writeBuffer: inputBuffer bufNum: bufNum 
    CslNI cslNI_RingBuffer_writeBuffer__SWIG_1: swigCPtrForRingBuffer with: (Buffer getCPtr: inputBuffer) with: bufNum
  ]

  Method [ sumIntoBuffer: inputBuffer bufNum: bufNum 
    CslNI cslNI_RingBuffer_sumIntoBuffer__SWIG_1: swigCPtrForRingBuffer with: (Buffer getCPtr: inputBuffer) with: bufNum
  ]

}
