COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 07-22-2009, 01:42 PM   #1
DukeRoodee
Human being with feelings
 
Join Date: Jul 2009
Posts: 20
Default load sample bank on startup ?

Hello :-)

i´ve developed a sample player w/ some special features for my needs and am currently looking for a framework to build a GUI around it. I found IPlug, which looks very promising. I could also build and test the example project and everything looks straight-forward, so for me IPlug is the best choice at the moment.
There is one thing i´d like to know / understand.
Imagine I load a sample bank at runtime (using the IFileSelectorControl).
Somehow i want the host to keep the information (=file name of the sample bank), so that i can automatically load it on restart (of the corresponding project, of course).
How do i make that ? There is a good parameter handing between host and plugin, serialisation and deserialisation of parameters (so the host can save/reset everything on startup if i understand this right) ... but all the parameters are basically numerical values. I can impossibly code a whole filename with path into a double or so.
Some ideas how i could implement this ?

thanks & best regards
Rudi
DukeRoodee is offline   Reply With Quote
Old 07-23-2009, 01:28 AM   #2
DukeRoodee
Human being with feelings
 
Join Date: Jul 2009
Posts: 20
Default

After a few hours of investigation i think i found the solution.

I´ll have to override the

virtual bool SerializeState(ByteChunk* pChunk)
virtual int UnserializeState(ByteChunk* pChunk, int startPos)

methods and store/readout my filenames in/from the ByteChunk using

inline int PutStr(const char* str)
inline int GetStr(WDL_String* pStr, int startPos)

right ? :-)
DukeRoodee is offline   Reply With Quote
Old 07-23-2009, 08:50 AM   #3
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

I haven't actually done in, but I think you're right.

You also need to set plugDoesChunks=true when you construct your plugin, which you do using the #define PLUG_DOES_STATE_CHUNKS in resource.h (assuming you're using IPLUG_CTOR() to do the constructing).
cc_ is offline   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 10:10 PM.


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