No worries Sean. This is still just the skeleton of the plug, so there’s not a lot of state information - but you should get the idea OK:
void HyperdriveAudioProcessor::deSerialiseStateInformation(ScopedPointer<XmlElement> xmlState)
{
// make sure that it's actually our type of XML object..
if (xmlState->hasTagName ("MYPLUGINSETTINGS"))
{
// ok, now pull out our parameters..
lastUIWidth = xmlState->getIntAttribute ("uiWidth", lastUIWidth);
lastUIHeight = xmlState->getIntAttribute ("uiHeight", lastUIHeight);
XmlElement* xmlChild[HYPERDRIVE_numPrograms];
for (int i = 0; i<HYPERDRIVE_numPrograms; ++i) {
xmlChild[i] = xmlState->getChildByName ("ProgramState_" + String(i+1));
if (xmlChild[i]!=0)
{
programName[i] = xmlChild[i]->getStringAttribute ("ProgramName", programName[i]);
drive[i] = (float) xmlChild[i]->getDoubleAttribute ("Drive", drive[i]);
attack[i] = (float) xmlChild[i]->getDoubleAttribute ("Attack", attack[i]);
release[i] = (float) xmlChild[i]->getDoubleAttribute ("Release", release[i]);
}
}
}
}
void HyperdriveAudioProcessor::deSerialiseStateInformationAndNotify(ScopedPointer<XmlElement> xmlState)
{
deSerialiseStateInformation(xmlState);
// Notify host of changes to parameters
sendParamChangeMessageToListeners (driveParam, param2Float(driveParam, drive[currentProgram]));
sendParamChangeMessageToListeners (attackParam, param2Float(attackParam, attack[currentProgram]));
sendParamChangeMessageToListeners (releaseParam, param2Float(releaseParam, release[currentProgram]));
}