Class GestureSchedule

java.lang.Object
net.paulhertz.pixelaudio.schedule.GestureSchedule
All Implemented Interfaces:
PAGesture

public final class GestureSchedule extends Object implements PAGesture
Data container for a PAGesture with immutable points and times and an optional start time (in milliseconds).
  • Field Details

    • points

      public final List<processing.core.PVector> points
    • timesMs

      public final float[] timesMs
    • startTimeMs

      public long startTimeMs
  • Constructor Details

    • GestureSchedule

      public GestureSchedule(List<processing.core.PVector> points, float[] timesMs)
  • Method Details

    • getAllPoints

      public List<processing.core.PVector> getAllPoints()
      Description copied from interface: PAGesture
      Dense gesture points.
      Specified by:
      getAllPoints in interface PAGesture
    • getTimeOffsetsMs

      public float[] getTimeOffsetsMs()
      Description copied from interface: PAGesture
      Time offsets in ms, same length as getAllPoints(), first element typically 0.
      Specified by:
      getTimeOffsetsMs in interface PAGesture
    • getStartTimeMs

      public long getStartTimeMs()
      Description copied from interface: PAGesture
      Absolute start time (e.g. millis() when gesture began)
      Specified by:
      getStartTimeMs in interface PAGesture
    • setStartTimeMs

      public void setStartTimeMs(long startTimeMs)
    • size

      public int size()
      Specified by:
      size in interface PAGesture
    • durationMs

      public float durationMs()
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface PAGesture
    • normalizeTimesToStartAtZero

      public static float[] normalizeTimesToStartAtZero(float[] timesMs)
    • enforceNonDecreasing

      public static void enforceNonDecreasing(float[] t)