Package net.paulhertz.pixelaudio.io
Class GestureGranularConfigIO
java.lang.Object
net.paulhertz.pixelaudio.io.GestureGranularConfigIO
JSON read/write support for GestureGranularConfig.Builder.
Filename convention suggestion:
gesture_001_softGranular_config.json
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic final classstatic final class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static ADSRParamsadsrFromJson(processing.data.JSONObject obj) private static processing.data.JSONObjectadsrToJson(ADSRParams env) fromJson(processing.data.JSONObject root) private static floatgetFloatOr(processing.data.JSONObject obj, String key, float fallback) private static Stringprivate static voidputIfPresent(processing.data.JSONObject obj, String key, String value) private static floatreflectFloat(Object target, String... candidates) private static voidrequireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion) static processing.data.JSONObjectstatic voidwrite(File file, GestureGranularConfig.Builder builder, GestureGranularConfigIO.Meta meta)
-
Field Details
-
FORMAT
- See Also:
-
VERSION
public static final int VERSION- See Also:
-
-
Constructor Details
-
GestureGranularConfigIO
private GestureGranularConfigIO()
-
-
Method Details
-
toJson
public static processing.data.JSONObject toJson(GestureGranularConfig.Builder b, GestureGranularConfigIO.Meta meta) -
write
public static void write(File file, GestureGranularConfig.Builder builder, GestureGranularConfigIO.Meta meta) throws IOException - Throws:
IOException
-
read
- Throws:
IOException
-
fromJson
-
adsrToJson
-
adsrFromJson
-
reflectFloat
-
getFloatOr
-
requireHeader
private static void requireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion) -
putIfPresent
-
nonNull
-