Package net.paulhertz.pixelaudio.io
Class PACurveMakerIO
java.lang.Object
net.paulhertz.pixelaudio.io.PACurveMakerIO
JSON read/write support for PACurveMaker.
Filename convention suggestion:
gesture_001_gesture.json
Used in the example sketch
Bagatelle.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PACurveMakerIO.ResultfromJson(processing.data.JSONObject root) private static processing.data.JSONArrayintsToJson(int[] values) jsonToIntsList(processing.data.JSONArray arr) private static ArrayList<processing.core.PVector>jsonToPoints(processing.data.JSONArray arr) private static Stringprivate static processing.data.JSONArraypointsToJson(List<processing.core.PVector> points) private static voidputIfPresent(processing.data.JSONObject obj, String key, String value) static PACurveMakerIO.Resultprivate static voidrequireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion) static processing.data.JSONObjecttoJson(PACurveMaker curve, PACurveMakerIO.Meta meta) static voidwrite(File file, PACurveMaker curve, PACurveMakerIO.Meta meta)
-
Field Details
-
FORMAT
- See Also:
-
VERSION
public static final int VERSION- See Also:
-
-
Constructor Details
-
PACurveMakerIO
private PACurveMakerIO()
-
-
Method Details
-
toJson
-
write
public static void write(File file, PACurveMaker curve, PACurveMakerIO.Meta meta) throws IOException - Throws:
IOException
-
read
- Throws:
IOException
-
fromJson
-
pointsToJson
-
jsonToPoints
-
intsToJson
private static processing.data.JSONArray intsToJson(int[] values) -
jsonToIntsList
-
requireHeader
private static void requireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion) -
putIfPresent
-
nonNull
-