# Recalling properties using setStateInformation

**URL:** https://forum.foleysfinest.com/t/recalling-properties-using-setstateinformation/101
**Category:** PluginGuiMagic
**Created:** [16 February 2022 08:35 UTC](https://forum.foleysfinest.com/t/recalling-properties-using-setstateinformation/101 "2022-02-16T08:35:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![David](https://forum.foleysfinest.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://forum.foleysfinest.com/u/David)
#### Post date: [16 February 2022 08:35 UTC](https://forum.foleysfinest.com/t/recalling-properties-using-setstateinformation/101/1 "2022-02-16T08:35:02Z")

</div>

What’s the correct way to reload non audio properties during plugin init? Currently, `getStateInformation` and `setStateInformation` will only take care of the audio parameters. What do I do if I have an audio file that should be loaded when the plugin starts?  
During a session I can handle this using `APVTS.state`. It works well even when changing presets. But during the `StateInformation` functions I believe that `APVTS.state` is being dumped into the GUI value tree or something similar, and all of `APVTS.state`’s properties are lost.

---

<div class="post-metadata">

### Author: ![daniel](https://forum.foleysfinest.com/user_avatar/forum.foleysfinest.com/daniel/32/5_2.png) [@daniel](https://forum.foleysfinest.com/u/daniel)
#### Post date: [16 February 2022 14:50 UTC](https://forum.foleysfinest.com/t/recalling-properties-using-setstateinformation/101/2 "2022-02-16T14:50:55Z")

</div>

The APVTS.state is still there, and there is an easy way to access it (btw. regardless if you use the APVTS or you don’t).  
The magicState has a method to access the tree and properties:

```auto
magicState.getProperty ("analyser:input");

```

This will create a ValueTree with type “analyser” and returns a property “input” as reference that you can set. You can nest the ValueTrees as deep as you want, the last portion is the property, the ones before are the ValueTree names of the parents.

The nice thing about it is you can use the same property in the GUI, they will appear e.g. in toggles, in CSS classes that can be switched using those properties or in Labels.

An example is here:

> <https://github.com/ffAudio/PluginGuiMagic/blob/main/examples/EqualizerExample/Source/PluginProcessor.cpp#L176>

There is a callback you can override that will run after setStateInformation where you can attach listeners to those properties.

Let me know if that works for your use case.
