Class PACurveMakerIO

java.lang.Object
net.paulhertz.pixelaudio.io.PACurveMakerIO

public final class PACurveMakerIO extends Object
JSON read/write support for PACurveMaker. Filename convention suggestion: gesture_001_gesture.json Used in the example sketch Bagatelle.
  • Field Details

  • Constructor Details

    • PACurveMakerIO

      private PACurveMakerIO()
  • Method Details

    • toJson

      public static processing.data.JSONObject toJson(PACurveMaker curve, PACurveMakerIO.Meta meta)
    • write

      public static void write(File file, PACurveMaker curve, PACurveMakerIO.Meta meta) throws IOException
      Throws:
      IOException
    • read

      public static PACurveMakerIO.Result read(File file) throws IOException
      Throws:
      IOException
    • fromJson

      public static PACurveMakerIO.Result fromJson(processing.data.JSONObject root)
    • pointsToJson

      private static processing.data.JSONArray pointsToJson(List<processing.core.PVector> points)
    • jsonToPoints

      private static ArrayList<processing.core.PVector> jsonToPoints(processing.data.JSONArray arr)
    • intsToJson

      private static processing.data.JSONArray intsToJson(int[] values)
    • jsonToIntsList

      private static ArrayList<Integer> jsonToIntsList(processing.data.JSONArray arr)
    • requireHeader

      private static void requireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion)
    • putIfPresent

      private static void putIfPresent(processing.data.JSONObject obj, String key, String value)
    • nonNull

      private static String nonNull(String value, String fallback)