Hello!
I must be doing something obvious and simple wrong, but I’ve read the API regarding get/save state and looked through the forums and nothing has been able to solve my problem.
I am creating a distortion/delay plugin from some sample juce files I have found online. All of my parameters are communicating with the rest of my plugin correctly, yet when I close the gui window and reopen it, all of the parameters return to their default values EXCEPT for my feedbackD parameter which is functioning properly and recalling without a problem. I’m completely confused because my delayT, dryD, and wetD are setup exactly the same as my feedbackD parameter, but those parameters always recall to their default values.
I have been attempting to debug this problem for the past 3 days. My attempt to recreate this recall to default in the feedbackD parameter has not been successful. I’ve commented it out in every function that it is called in and I cannot simulate the same problem my other parameters are facing. I have also commented out my entire get/saveStateInformation functions and my feedbackD will still recall correctly. This just completely baffles me because I was under the impression that without those functions the host would not be able to recall the plugin to its former state.
Below are my state information functions in case anyone notices anything out of place. Also, here is a link to my source files (https://drive.google.com/folderview?id=0B0apODgduuOUeGFwdC1MTkpJSHc&usp=sharing)
Thanks in advance for any help you can provide this JUCE noob. If you need any additional information please let me know!
void TgcapstoneAudioProcessor::getStateInformation (MemoryBlock& destData)
{
// Outer XML element
XmlElement xml (“PLUGINSETTINGS”);
// add attributes to it
xml.setAttribute("delayOnOff", delayOnOff);
xml.setAttribute("delayT", delayT);
xml.setAttribute("dryD", dryD);
xml.setAttribute("wetD", wetD);
xml.setAttribute("feedbackD", feedbackD);
xml.setAttribute("distortionID", distortionID);
xml.setAttribute("gain", distortion);
copyXmlToBinary(xml, destData);
}
void TgcapstoneAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
ScopedPointer xmlState (getXmlFromBinary(data, sizeInBytes));
if (xmlState != 0)
{
// make sure that it's actually our type of XML object
if (xmlState->hasTagName("PLUGINSETTINGS"));
{
// pull out parameters
delayOnOff = (bool)xmlState->getIntAttribute("delayOnOff", delayOnOff);
delayT = (float)xmlState->getDoubleAttribute("delayT", delayT);
dryD = (float)xmlState->getDoubleAttribute("dryD", dryD);
wetD = (float)xmlState->getDoubleAttribute("wetD", wetD);
feedbackD = (float)xmlState->getDoubleAttribute("feedbackD", feedbackD);
distortionID = xmlState->getIntAttribute("distortionID", distortionID);
distortion = (float)xmlState->getDoubleAttribute("gain", distortion);
}
}
}