Package net.paulhertz.pixelaudio.io
Class AudioBrushSessionIO
java.lang.Object
net.paulhertz.pixelaudio.io.AudioBrushSessionIO
Session manifest writer/reader for brush sets.
Suggested filename:
bagatelle_rehearsalSet_session.json
Used in the example sketch
Bagatelle.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic final classstatic final classstatic final class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Stringprivate static voidputIfPresent(processing.data.JSONObject obj, String key, String value) static <B> AudioBrushSessionIO.SessionData<B>readSession(File sessionFile, AudioBrushSessionIO.BrushFactory<B> factory) private static Stringrelativize(File baseDir, File target) private static voidrequireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion) private static Stringprivate static StringsessionStem(File sessionFile) static <B> voidwriteSession(File sessionFile, List<B> brushes, AudioBrushSessionIO.BrushAdapter<B> adapter, AudioBrushSessionIO.SessionMeta meta, String gestureDirName, String configDirName)
-
Field Details
-
FORMAT
- See Also:
-
VERSION
public static final int VERSION- See Also:
-
-
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
-
relativize
-
requireHeader
private static void requireHeader(processing.data.JSONObject header, String expectedFormat, int expectedVersion) -
putIfPresent
-
safeId
-
nonBlank
-