// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown // SPDX-License-Identifier: GPL-3.0-or-later #import "SizzleSession.h" NS_ASSUME_NONNULL_BEGIN /// Project bundles and whole-app backups (Android's ProjectBundleIo and BackupIo), /// both ZIP archives in Android's layouts. @interface SizzleSession (Files) /// The open song as a bundle (.szgz): project.szg, every sample its Sampler, /// SF2/XI, Grain Cloud and Wavetable slots use (samples/.wav) and /// samples/manifest.txt (`\t` per line). - (nullable NSData *)projectBundleData; /// Replace the open song with a bundle's: its samples are stored under their ids /// first, so the song finds them. Leaves the song alone if it isn't a bundle. - (BOOL)importProjectBundleData:(NSData *)data error:(NSError **)error; /// True for a ZIP archive (bundle or backup) rather than text. + (BOOL)isZipData:(NSData *)data; /// Toolbox [slot]'s MIDI mapping as .szm text (io/MidiMapIo: TYPE, NAME, one /// `parameter=CC` line each), or nil for an empty slot. - (nullable NSString *)midiMapTextOfSlot:(NSInteger)slot; /// Replace [slot]'s MIDI mapping with the .szm [text] (a CC another parameter used /// moves here). NO with [error] set when it isn't a mapping or is for another device. - (BOOL)importMidiMapText:(NSString *)text intoSlot:(NSInteger)slot error:(NSError **)error; /// Remove setting [key] from [slot] (a cleared MIDI mapping). - (void)removeValueOfSlot:(NSInteger)slot key:(NSString *)key; /// Everything Sizzle keeps: Documents/songs, themes, presets and samples, the /// autosaved song, and [settings] as settings.txt. The open song is autosaved first. - (nullable NSData *)backupDataWithSettings:(NSString *)settings; /// Restore a backup: it is unpacked aside first and only swapped in once it looks /// like one, so a wrong file can't destroy anything. The restored autosave becomes /// the open song. Returns the backup's settings text ("" if it has none), or nil. - (nullable NSString *)restoreBackupData:(NSData *)data error:(NSError **)error; @end NS_ASSUME_NONNULL_END