tresult PLUGIN_API IPlugVST3Plugin::setEditorState(IBStream* state) { TRACE; WDL_MutexLock lock(&mMutex); ByteChunk chunk; SerializeState(&chunk); // to get the size if (chunk.Size() > 0) { state->read(chunk.GetBytes(), chunk.Size()); UnserializeState(&chunk, 0); int32 savedBypass = 0; if (state->read (&savedBypass, sizeof (int32)) != kResultOk) { return kResultFalse; } mIsBypassed = (bool) savedBypass; RedrawParamControls(); return kResultOk; } return kResultFalse; }
AAX_Result IPlugAAX::SetChunk(AAX_CTypeID chunkID, const AAX_SPlugInChunk * iChunk ) { TRACE; if (chunkID == GetUniqueID()) { ByteChunk IPlugChunk; IPlugChunk.PutBytes(iChunk->fData, iChunk->fSize); int pos = 0; //GetIPlugVerFromChunk(&IPlugChunk, &pos); pos = UnserializeState(&IPlugChunk, pos); for (int i = 0; i< NParams(); i++) { SetParameterNormalizedValue(mParamIDs.Get(i)->Get(), GetParam(i)->GetNormalized() ); } RedrawParamControls(); //TODO: what about icontrols not linked to params how do they get redrawn - setdirty via UnserializeState()? mNumPlugInChanges++; // necessary in order to cause CompareActiveChunk() to get called again and turn off the compare light return AAX_SUCCESS; } return AAX_ERROR_INVALID_CHUNK_ID; }
tresult PLUGIN_API IPlugVST3::setEditorState(IBStream* state) { ByteChunk chunk; SerializeState(&chunk); if (chunk.Size() >= 0) { state->read(chunk.GetBytes(), chunk.Size()); UnserializeState(&chunk, 0); RedrawParamControls(); return kResultOk; } return kResultFalse; }