COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 02-15-2018, 10:20 PM   #1
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default (Un)SerializeState() both not called! [SOLVED]

I cannot determine why not!
My first IPlug project is saving restoring chunks just fine (once I discovered to
Code:
#define PLUG_DOES_STATE_CHUNKS 1
it solved the problem.) That was then...

This time on a new project I have made sure to:
-declare the methods in the plugin class.
Code:
  bool SerializeState(ByteChunk* pChunk);
  int UnserializeState(ByteChunk* pChunk, int startPos);
-define the functions in the class .cpp source.
Code:
bool Myplug::SerializeState(ByteChunk* pChunk)
{
	TRACE;
	IMutexLock lock(this);
	int plugVersion = GetEffectVersion(false);
	pChunk->Put(&plugVersion);
	DBGMSG("Save in chunk (version): %x", plugVersion);
	return IPlugBase::SerializeParams(pChunk);
}

int Myplug::UnserializeState(ByteChunk* pChunk, int startPos)
{
	TRACE;
	IMutexLock lock(this);
	int plugVersionInState;
	startPos = pChunk->Get(&plugVersionInState, startPos);
	DBGMSG("Recall from chunk (version): %x", plugVersionInState);
	return IPlugBase::UnserializeParams(pChunk, startPos);
}
-change PLUG_DOES_STATE_CHUNKS as above.

Is there anything else I need to do? Looking at my other project I can't see anything else. I have breakpoints and debug messages in both methods, so I'm sure that they're not happening.
Thanks for any suggestions

Last edited by Guod3; 02-17-2018 at 08:50 PM.
Guod3 is offline   Reply With Quote
Old 02-17-2018, 08:54 PM   #2
Guod3
Human being with feelings
 
Guod3's Avatar
 
Join Date: Jan 2008
Posts: 506
Default

It was fixed when I changed
Code:
 #define kNumPrograms 0
to
Code:
 #define kNumPrograms 1
Not totally sure of the logic here, I don't need "programs" (presets?) but do need to save plugin state information.
Guod3 is offline   Reply With Quote
Old 02-18-2018, 03:03 AM   #3
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Well, your plug-in's state does also include all its presets (for VST2 at least)... Maybe VST2 doesn't support zero presets, I can't remember (and I'm too lazy to check).
Tale is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.