Package net.paulhertz.pixelaudio.example

# Class TutorialOneWindowBuffer.WindowedBuffer

java.lang.Object
net.paulhertz.pixelaudio.example.TutorialOneWindowBuffer.WindowedBuffer

Enclosing class:
  TutorialOneWindowBuffer

public class TutorialOneWindowBuffer.WindowedBuffer extends Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `private final float[]`
  `buffer`
  `private int`
  `hopSize`
  `private int`
  `index`
  `private final float[]`
  `window`
  `private final int`
  `windowSize`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WindowedBuffer(float[] buffer, int windowSize, int hopSize)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBufferSize()`
  Expose the underlying array size
  `int`
  `getHopSize()`
  Expose hop size
  `int`
  `getIndex()`
  Current buffer index
  `float[]`
  `gettWindowAtIndex(int idx)`
  Returns the window at a supplied index.
  `int`
  `getWindowSize()`
  Expose the reusable window array size
  `float[]`
  `nextWindow()`
  Returns the next window, advancing the read index by hopSize.
  `void`
  `reset()`
  Reset reader to start of buffer
  `void`
  `setHopSize(int hopSize)`
  `void`
  `setIndex(int index)`
  set current index

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### buffer

    private final float[] buffer

  - ### window

    private final float[] window

  - ### windowSize

    private final int windowSize

  - ### hopSize

    private int hopSize

  - ### index

    private int index

- ## Constructor Details

  - ### WindowedBuffer

    public WindowedBuffer(float[] buffer, int windowSize, int hopSize)

- ## Method Details

  - ### nextWindow

    public float[] nextWindow()
    Returns the next window, advancing the read index by hopSize. Wraps around the buffer as needed.

  - ### gettWindowAtIndex

    public float[] gettWindowAtIndex(int idx)
    Returns the window at a supplied index. Wraps around the buffer as needed. Updates current index and advances it by hopSize.

  - ### reset

    public void reset()
    Reset reader to start of buffer

  - ### getIndex

    public int getIndex()
    Current buffer index

  - ### setIndex

    public void setIndex(int index)
    set current index

  - ### getBufferSize

    public int getBufferSize()
    Expose the underlying array size

  - ### getWindowSize

    public int getWindowSize()
    Expose the reusable window array size

  - ### getHopSize

    public int getHopSize()
    Expose hop size

  - ### setHopSize

    public void setHopSize(int hopSize)