I need some assistance to get this work properly.
I'm using chunks to store some arbitrary data beside the normal params. This worked fine so far in AU/VST and AAX builds. But it turns out that as soon as i add any parameter to my SerializeState() the ProTools compare is messed up.
For testing purpose I stripped it down to just implementing this in my .cpp
Code:
bool MyPlug::SerializeState(ByteChunk* pChunk)
{
IMutexLock lock(this);
//pChunk->Put(&test); /* test declared as double in .h */
return IPlugBase::SerializeParams(pChunk);
}
int MyPlug::UnserializeState(ByteChunk* pChunk, int startPos)
{
IMutexLock lock(this);
//startPos = pChunk->Get(&test, startPos);
return IPlugBase::UnserializeParams(pChunk, startPos);
}
bool MyPlug::CompareState(const unsigned char* incomingState, int startPos)
{
bool isEqual = true;
//startPos = sizeof(double);
isEqual &= IPlugBase::CompareState(incomingState, startPos);
return isEqual;
}
As long as the lines are commented out everything works fine. Just serializing that one double makes the Compare button always lit. Seems like the startPos for IPlugBase::CompareState points to a wrong position?
However i can't get it work. What am i doing wrong?