Package net.paulhertz.pixelaudio.io

# Class AudioBrushSessionIO

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

public final class AudioBrushSessionIO extends Object
Session manifest writer/reader for brush sets. Suggested filename: bagatelle_rehearsalSet_session.json Used in the example sketch `Bagatelle`.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `AudioBrushSessionIO.BrushAdapter<B>`
  `static interface`
  `AudioBrushSessionIO.BrushFactory<B>`
  `static final class`
  `AudioBrushSessionIO.BrushRecord`
  `static final class`
  `AudioBrushSessionIO.SessionData<B>`
  `static final class`
  `AudioBrushSessionIO.SessionMeta`

- ## Field Summary

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

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `private static String`
  `nonBlank(String value, String fallback)`
  `private static void`
  `putIfPresent(processing.data.JSONObject obj, String key, String value)`
  `static <B> AudioBrushSessionIO.SessionData<B>`
  `readSession(File sessionFile, AudioBrushSessionIO.BrushFactory<B> factory)`
  `private static String`
  `relativize(File baseDir, File target)`
  `private static void`
  `requireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion)`
  `private static String`
  `safeId(String id)`
  `private static String`
  `sessionStem(File sessionFile)`
  `static <B> void`
  `writeSession(File sessionFile, List<B> brushes, AudioBrushSessionIO.BrushAdapter<B> adapter, AudioBrushSessionIO.SessionMeta meta, String gestureDirName, String configDirName)`

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

  - ### AudioBrushSessionIO

    private AudioBrushSessionIO()

- ## Method Details

  - ### writeSession

    public static <B> void writeSession(File sessionFile, List<B> brushes, AudioBrushSessionIO.BrushAdapter<B> adapter, AudioBrushSessionIO.SessionMeta meta, String gestureDirName, String configDirName) throws IOException
    Throws:
      `IOException`

  - ### readSession

    public static <B> AudioBrushSessionIO.SessionData<B> readSession(File sessionFile, AudioBrushSessionIO.BrushFactory<B> factory) throws IOException
    Throws:
      `IOException`

  - ### sessionStem

    private static String sessionStem(File sessionFile)

  - ### relativize

    private static String relativize(File baseDir, File target)

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

  - ### safeId

    private static String safeId(String id)

  - ### nonBlank

    private static String nonBlank(String value, String fallback)