State Saving

State saving allows your app to provide workspace configuration information that can be stored, recalled and shared by users when saving or loading an Audiobus preset.

This allows users to save and share their entire workspaces, across all the apps they are using.

If you're not familiar with Audiobus presets and state saving, here're two videos explaining each:

To support state saving, you need to implement the ABAudiobusControllerStateIODelegate protocol, and identify your State IO delegate to the Audiobus controller via its stateIODelegate property.

The State IO delegate protocol consists of two methods: one which is invoked when a preset is being saved, audiobusStateDictionaryForCurrentState , and one which is invoked when a preset is being loaded, loadStateFromAudiobusStateDictionary:responseMessage: .

You use the former to provide Audiobus with a dictionary of keys and values that represent your app's current state. The latter provides you with the same keys and values you provided when the preset was saved, which you use to restore that state. If there was a problem restoring the state (for example, the state relies on functionality accessible only via an In-App Purchase, or content that hasn't been downloaded yet), you may return a message that will be displayed to the user within Audiobus.

What data you provide via this system is up to you: you can provide NSData blobs, NSStrings, and any other Property List types (see Apple's About Property Lists documentation).

For example: a synth app should save current patch settings. An effects app should save the parameters. A multi-track recorder app may choose to save the current project, including the audio tracks. A sampler should save the loaded audio samples.

We currently require that you do not return data larger than 20MB. Any audio data in presets should preferably be in a compressed format. We previously asked developers working with the 2.0 SDK version not to save MIDI settings information: we have since relaxed this requirement, and we now allow MIDI settings to be saved, such as a set of active MIDI connections.

State saving is a very new feature that will undergo further evolution as we see what users and developers are doing with it. Consequently, these guidelines may change over time. If you have feedback, let us know on the developer forums!.