Package net.paulhertz.pixelaudio.io

# Class GestureGranularConfigIO

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

public final class GestureGranularConfigIO extends Object
JSON read/write support for GestureGranularConfig.Builder. Filename convention suggestion: gesture_001_softGranular_config.json

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `GestureGranularConfigIO.InstrumentType`
  `static final class`
  `GestureGranularConfigIO.Meta`
  `static final class`
  `GestureGranularConfigIO.Result`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `FORMAT`
  `static final int`
  `VERSION`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `private`
  `GestureGranularConfigIO()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `private static ADSRParams`
  `adsrFromJson(processing.data.JSONObject obj)`
  `private static processing.data.JSONObject`
  `adsrToJson(ADSRParams env)`
  `static GestureGranularConfigIO.Result`
  `fromJson(processing.data.JSONObject root)`
  `private static float`
  `getFloatOr(processing.data.JSONObject obj, String key, float fallback)`
  `private static String`
  `nonNull(String value, String fallback)`
  `private static void`
  `putIfPresent(processing.data.JSONObject obj, String key, String value)`
  `static GestureGranularConfigIO.Result`
  `read(File file)`
  `private static float`
  `reflectFloat(Object target, String... candidates)`
  `private static void`
  `requireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion)`
  `static processing.data.JSONObject`
  `toJson(GestureGranularConfig.Builder b, GestureGranularConfigIO.Meta meta)`
  `static void`
  `write(File file, GestureGranularConfig.Builder builder, GestureGranularConfigIO.Meta meta)`

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

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

- ## Field Details

  - ### FORMAT

    public static final String FORMAT
    See Also:
      - Constant Field Values

  - ### VERSION

    public static final int VERSION
    See Also:
      - Constant Field Values

- ## 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

    public static GestureGranularConfigIO.Result read(File file) throws IOException
    Throws:
      `IOException`

  - ### fromJson

    public static GestureGranularConfigIO.Result fromJson(processing.data.JSONObject root)

  - ### adsrToJson

    private static processing.data.JSONObject adsrToJson(ADSRParams env)

  - ### adsrFromJson

    private static ADSRParams adsrFromJson(processing.data.JSONObject obj)

  - ### reflectFloat

    private static float reflectFloat(Object target, String... candidates)

  - ### getFloatOr

    private static float getFloatOr(processing.data.JSONObject obj, String key, float fallback)

  - ### 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)