COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 05-24-2012, 05:03 AM   #121
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

I don't really understand your problem. If you make a simplified example based on IPlugChunks, from the latest next branch that works in VST2/AU but not in VST3, then I can take a look at it. The IPlugChunks VST3 example works now for me.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-24-2012, 07:56 AM   #122
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 633
Default

i think you are correct, i am somewhat confused.

this bit from IPlugVST.cpp
Code:
case effGetChunk: {
	    BYTE** ppData = (BYTE**) ptr;
      if (ppData) {
        bool isBank = (!idx);
        ByteChunk* pChunk = (isBank ? &(_this->mBankState) : &(_this->mState));
        InitializeVSTChunk(pChunk);
        bool savedOK = true;
        if (isBank) {
          _this->ModifyCurrentPreset();
          savedOK = _this->SerializePresets(pChunk);
          savedOK = _this->SerializeState(pChunk); //uncommented jd
        }
        else {
          savedOK = _this->SerializeState(pChunk);
        }
        if (savedOK && pChunk->Size()) {
          *ppData = pChunk->GetBytes();
          return pChunk->Size();
        }
      }
      return 0;
    }
    case effSetChunk: {
      if (ptr) {
        bool isBank = (!idx);
        ByteChunk* pChunk = (isBank ? &(_this->mBankState) : &(_this->mState));
        pChunk->Resize(value);
        memcpy(pChunk->GetBytes(), ptr, value);
        int pos = 0;
        int iplugVer = GetIPlugVerFromChunk(pChunk, &pos);
        isBank &= (iplugVer >= 0x010000);
        if (isBank) {
          pos = _this->UnserializePresets(pChunk, pos);
          pos = _this->UnserializeState(pChunk, pos); //uncommented jd
        }
        else {
          pos = _this->UnserializeState(pChunk, pos);
          _this->ModifyCurrentPreset();
        }
        if (pos >= 0) {
          _this->RedrawParamControls();
		      return 1;
	      }
      }
	    return 0;
    }
is likely my problem? it's not from the latest wdl-ol so it breaks IPlugChunks VST2...
if (isBank) { ends up testing true, or my source wouldn't work*. i don't know why it
tests true tho'... so that is where i'm at here.

*the call stack if i put a breakpoint at the head of UnserializeState() -or- at the uncommented lines as shown above:

1 myplugin::UnserializeState()
2 VSTDispatcher()

(and that is all) which seems as direct and elegant as could be...
my source produces "the right result", for apparently the wrong reason. but with
IPlugChunks, the reason is "not there", the control gets set dirty when no chunk
gets read, and it produces the wrong result.
__________________
welcome to epoch
enjoy volt

Last edited by cerberus; 05-24-2012 at 08:19 AM.
cerberus is offline   Reply With Quote
Old 05-24-2012, 08:59 AM   #123
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

I thought you were talking about VST3? Anyway re the VST2 stuff...

isBank should be true when the host is restoring or trying to save the entire state (could be saving/loading a project or an fxb - so Un/SerializePresets() should be called when loading/saving all the preset data. UnSerializePresets() calls RestorePreset(currentPreset) after the presets have been unserialized - so it is not necessary in effSetChunk to call UnserializeState() again, since this is called from RestorePreset(). Likewise when calling SerializePresets() in effGetChunk the current state should already be stored in the current preset (i think), so no need to call SerializeState() again.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-24-2012, 12:41 PM   #124
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

I discovered a bug with VST3 - bypass and chosen preset aren't stored in the state. That is going to be a bit of a pain to fix cleanly because unlike schwa i wasn't thoughtful enough to store the IPlug version number in the VST3 chunk - and now i'm going to add two params, so will probably have to break existing projects. If you were about to release a VST3 version of your IPlug plug-in, perhaps wait till i fix this one :-)
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-25-2012, 03:38 PM   #125
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 633
Default

i may need to revert to before:

when my issues were confined to vst3.

i am using MakePreset() because it allows for the behaviors that i think most end-users expect. i.e. u.i. settings, undo histories, user settable memories, etc. do not get affected by loading a preset bank... let's say the user has chosen an appearance theme, i think we can agree that is a separate matter entirely from what the settings on the knobs are. but we might wish to store/restore this kind of setting in the state chunk with the project file.

could we please have an example showing how to handle sparky's very simple and i think common situation:

we have an on/off button and we don't want that to be stored with a preset, because when a user selects a preset, they will expect the on/off state to remain static.
__________________
welcome to epoch
enjoy volt
cerberus is offline   Reply With Quote
Old 05-25-2012, 05:20 PM   #126
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

Quote:
Originally Posted by cerberus View Post
but we might wish to store/restore this kind of setting in the state chunk with the project file.
i hope this makes things clearer for you:

AU/VST3/RTAS Hosts don't support banks of presets and they don't call different plug-in methods when saving the project file or when saving preset files (e.g. .aupreset / .vstpreset) to disk - they just ask the plug-in for a chunk to represent the plug-in's current state. In my IPlug this entails calling SerializeState(). If you didn't decide to manually add stuff to the chunk yourself (#define PLUG_DOES_STATE_CHUNKS 0), you won't have implemented SerializeState() in your plugin class and IPlugBase::SerializeState() will get called, which will just call IPlugBase::SerializeParams() to serialize the values of all the regular IPlug parameters. If however you wanted to add a hidden parameter (i.e. not exposed to automation) or some arbitrary data (e.g a string for a filepath) you will set (#define PLUG_DOES_STATE_CHUNKS 1) and implement Un/SerializeState() in your plugin class. In your SerializeState() you pack all the extra data into the chunk and then finally call IPlugBase::SerializeParams() at the end to store all the regular parameters in the chunk after your custom ones.

VST2 plug-ins do support saving banks of presets (.fxb files) but also support saving individual presets (.fxp). Importantly though when you save the VST2 host's project file it will store the state of a bank in rather than just the current state - so this means that if you edited preset #1 and #2 and #3, when you reload your project and select preset #1,#2 or #3 you will get the modified preset, not the initial preset that you declared in the plugin constructor. When the host tries to save the state of the VST2 plugin to the project file or to an fxb file IPlugBase::SerializePresets() will be called. This method will stick all of the chunks from your individual presets into one big chunk and return that to the host.

If you like you can implement Un/SerializePresets() in your plugin class (calling IPlugBase::Un/SerializePresets() at the end) in order to store a "global" custom variable that will be the same for the entire bank (fxb or in host project). This might be appropriate for the kind of things that i think you are talking about I suppose, HOWEVER it will only work for VST2!

If you wish to store a skin/theme choice globally for instance, one idea might be to write it to a text file on disk somewhere - however this way the choice is not saved with the project - it is totally global across hosts.

As I previously mentioned you could implement your own preset system (storing presets in some location on the HD) and discourage the use of host presets. Your presets might not include the skin/theme choice, just the parameter states - the skin/theme choice could just be saved in the main plugin state.

Apart from that I don't know anything else to suggest. FWIW on a related topic i think i will avoid an in-plugin preset menu in future plugins I make, because the behaviour is not the same in VST2 as it is in Audiounit/VST3/RTAS - i.e. since these formats don't support/save banks , Un/SerializePresets() is not called and only the last preset you edit gets stored in the state chunk. If you try and recall other presets they will have the default values you specified for them in the constructor.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-25-2012, 10:40 PM   #127
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 633
Default

that is a very helpful explanation.

[edit]

sparky, if you were looking for an "easy" answer... there isn't likely to be one, but i'm sure it's possible to make your design work with some variant of wdl-ol. for my forthcoming product, i must make it appear to the end user as if state chunks and presets were independent of one another across formats. the code won't look pretty tho'.
__________________
welcome to epoch
enjoy volt

Last edited by cerberus; 06-07-2012 at 03:00 PM.
cerberus is offline   Reply With Quote
Old 06-13-2012, 12:36 PM   #128
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

I've been doing lots of work lately on WDL-OL, improving the xcode/msvc projects and adding AAX support - will publish soon.

One thing I would really like to sort out is the windows standalone audio driver switching. If anyone has experience or ideas about how to handle that more smoothly and to deal with misbehaving drivers (or better yet, some time to get it working) it would really help. I run windows in virtualbox and I'm never quite sure if the driver problems I experience are because of that.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-27-2012, 03:15 PM   #129
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

Just pushed a big update to the next branch https://github.com/olilarkin/wdl-ol/tree/next

off the top of my head here are the main new features

- AAX Native support
- Re-vamped projects and build scripts, better use of property sheets
- Code-signing in build scripts for 10.8
- Improvements to audio driver handling on OSX Standalone (Windows still needs work)
- VST3 bypass state saved
- RTAS chunks support (unfortunately this breaks compatibility with previous RTAS versions)
- RTAS/AAX/VST3 N-Channel delay to match latency when bypassed
- VS2005 no longer needed for RTAS
- Code style a lot more consistent (indentation etc)
- works with xcode4 on Lion

Visual studio project build-order should be sorted now. So no need to compile Lice.lib manually.

I want to fix the windows audio driver issues (and any other problems that get noticed) and then I will merge next to master. The AAX support has not been heavily tested yet so may change a bit.

NOTE: you will have to re-duplicate one of the examples to update your existing projects.

oli
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook

Last edited by olilarkin; 06-28-2012 at 03:29 AM.
olilarkin is offline   Reply With Quote
Old 06-28-2012, 03:53 AM   #130
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Quote:
Originally Posted by olilarkin View Post
Just pushed a big update to the next branch https://github.com/olilarkin/wdl-ol/tree/next

off the top of my head here are the main new features

- AAX Native support
- Re-vamped projects and build scripts, better use of property sheets
- Code-signing in build scripts for 10.8
- Improvements to audio driver handling on OSX Standalone (Windows still needs work)
- VST3 bypass state saved
- RTAS chunks support (unfortunately this breaks compatibility with previous RTAS versions)
- RTAS/AAX/VST3 N-Channel delay to match latency when bypassed
- VS2005 no longer needed for RTAS
- Code style a lot more consistent (indentation etc)
- works with xcode4 on Lion

Visual studio project build-order should be sorted now. So no need to compile Lice.lib manually.

I want to fix the windows audio driver issues (and any other problems that get noticed) and then I will merge next to master. The AAX support has not been heavily tested yet so may change a bit.

NOTE: you will have to re-duplicate one of the examples to update your existing projects.

oli
Wow awesome! I sure am glad I procrastinated with the whole RTAS on VS2005 thing.

Just one thing though, in my PT9 SDK thing there is no PT9_SDK\AlturaPorts\TDMPlugIns\PlugInLibrary\WinBu ild\PlugInLib.vcxproj, only PlugInLib.vcproj, where do you get/how do you make that file? Just convert? Same problem with AAXLibrary.vcproj and AAXLibrary.vcxproj missing.

Last edited by A_SN; 06-28-2012 at 04:11 AM.
A_SN is offline   Reply With Quote
Old 06-28-2012, 04:04 AM   #131
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

you should be able to open the .vcproj in vs2010 and it will upgrade it to a vcxproj.


>Oh and while we're at it, do you know any convenient way to add a whole bunch of source/header files to a cloned project on Windows? It's a bit tedious to add each file to each target.

add them to one target, then select them all and ctrl-c, then click through the targets and ctrl-v
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-28-2012, 04:24 AM   #132
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Quote:
Originally Posted by olilarkin View Post
you should be able to open the .vcproj in vs2010 and it will upgrade it to a vcxproj.


>Oh and while we're at it, do you know any convenient way to add a whole bunch of source/header files to a cloned project on Windows? It's a bit tedious to add each file to each target.

add them to one target, then select them all and ctrl-c, then click through the targets and ctrl-v
Ah yeah I ended up thinking of the same thing (with Alt-Shift-A too), it's simple enough like that.

Anyway I built the standalone app so far and it works except unlike with the previous release (olilarkin-wdl-ol-92f9028) when I right click my knobs it works like the left click so nothing pops up. My knob class inherits from IKnobControl and its OnMouseDown isn't overridden.

Last edited by A_SN; 06-28-2012 at 04:45 AM.
A_SN is offline   Reply With Quote
Old 06-28-2012, 04:51 AM   #133
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Alright everything works (except for the right click issue) except the AAX build, here's what it gives me:

Code:
2>msvcprt.lib(MSVCP100.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
many more such lines
....
2>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
2>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
2>     Creating library build-win\aax\Win32\Release\SplineEQ.lib and object build-win\aax\Win32\Release\SplineEQ.exp
2>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
2>build-win\aax\bin\SplineEQ.aaxplugin\Contents\Win32\SplineEQ.aaxplugin : fatal error LNK1169: one or more multiply defined symbols found
2>
2>Build FAILED.
I think there's a problem with some libraries being compiled with different library options or something. Seems like a trivial problem but I'm not sure what to change.
A_SN is offline   Reply With Quote
Old 06-28-2012, 04:56 AM   #134
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

I think you need to change the aax library and PluginLib projects to link statically to the msvc runtime /MT instead of /MD
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-28-2012, 04:59 AM   #135
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Quote:
Originally Posted by olilarkin View Post
I think you need to change the aax library and PluginLib projects to link statically to the msvc runtime /MT instead of /MD
That solved it thanks. Only AAXLibrary had to be changed by the way, PlugInLib already had /MT.
A_SN is offline   Reply With Quote
Old 06-28-2012, 05:31 AM   #136
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

for the right-click issue, you need to modify IControl::OnMouseDown()

add

if (pMod->R)
{
PromptUserInput();
}

I removed this because I don't like that behaviour and it was conflicting with VST3 right-click to bring up contextual menu. Will have a think whether to keep it in WDL-OL IPlug or not
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-28-2012, 05:45 AM   #137
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Ah okay. Well maybe you can have an exception for VST3 with an #ifdef?

Also this is kind of a dumb question but how do you change the option host application? I want to change the path from vsthost.exe to another executable.
A_SN is offline   Reply With Quote
Old 06-28-2012, 05:52 AM   #138
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

Quote:
Originally Posted by A_SN View Post
Ah okay. Well maybe you can have an exception for VST3 with an #ifdef?

Also this is kind of a dumb question but how do you change the option host application? I want to change the path from vsthost.exe to another executable.
Open up common.props and change the User Macros VST2_32_HOST_PATH and/or VST2_64_HOST_PATH

but the nice thing about vsthost.exe is that you can supply a path to the dll as an argument, which is what I do. If you don't do that then you'll probably have to add a post build script to copy the dll to your VSTPlugins folder (depends on which host you debug with)
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-28-2012, 06:08 AM   #139
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Quote:
Originally Posted by olilarkin View Post
Open up common.props and change the User Macros VST2_32_HOST_PATH and/or VST2_64_HOST_PATH

but the nice thing about vsthost.exe is that you can supply a path to the dll as an argument, which is what I do. If you don't do that then you'll probably have to add a post build script to copy the dll to your VSTPlugins folder (depends on which host you debug with)
Alright thanks! I use SAVIHost for that so it's just as fine. I like to test my EQ with the feedback from the mic input/speaker output so I don't need any chain or anything like VSTHost does.
A_SN is offline   Reply With Quote
Old 06-28-2012, 06:11 AM   #140
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

is it possible to launch savihost from the command line with the dll as an argument? i would prefer that actually
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-28-2012, 06:13 AM   #141
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Yep, it works for me. I like the way your thing does it cause before in order to debug I had to launch SAVIHost, attach, then load the plugin, now I can just debug it like a regular app.
A_SN is offline   Reply With Quote
Old 06-28-2012, 02:27 PM   #142
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

great savihost is much better for quickly debugging, thanks.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-28-2012, 08:08 PM   #143
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 633
Default

thanks for this update.

these issues might not affect anyone else, but:

- i'm crashing reaper with vst2 when i call IPlugBase::SetParameterFromGUI() (the crash seems to happen at InformHostOfParamChange()). the overridden vst3 version seems to work ok in cubase5.

- vst3 bypass still not restoring it's state with my source in cubase5, osx 10.6. could i have missed a change that is not in IPlugVST3.cpp which might affect this?

- vst3 presets turned up empty. for now i've re-enabled my own vst3 to use vst2 style presets.
__________________
welcome to epoch
enjoy volt

Last edited by cerberus; 06-28-2012 at 09:04 PM.
cerberus is offline   Reply With Quote
Old 06-29-2012, 12:34 AM   #144
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

Quote:
Originally Posted by cerberus View Post
- i'm crashing reaper with vst2 when i call IPlugBase::SetParameterFromGUI() (the crash seems to happen at InformHostOfParamChange()). the overridden vst3 version seems to work ok in cubase5.

- vst3 bypass still not restoring it's state with my source in cubase5, osx 10.6. could i have missed a change that is not in IPlugVST3.cpp which might affect this?

- vst3 presets turned up empty. for now i've re-enabled my own vst3 to use vst2 style presets.
- not sure about your 1st crash - it works for me. Where does it crash?

- you are correct about VST3 bypass - i just pushed an update to fix it

- I disabled the VST3 preset list, because i don't like it. You can re-enable it by defining VST3_PRESET_LIST as a preprocessor macro in MyPlugin.xcconfig / MyPlugin.props
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 06-29-2012, 04:02 AM   #145
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 633
Default

Quote:
Originally Posted by olilarkin View Post
- not sure about your 1st crash - it works for me. Where does it crash?
here's a link to the crash report : http://cerberusaudio.com/b/REAPER_20...computer.crash
it's likely my fault. perhaps i should try GetGUI()->SetParameterFromPlug()

it seems that you've moved SetParameterFromGUI() from IGraphics to IPlugBase so that VST3 and AAX can override it, but i don't understand why the new IPlugBase method is so radically different from the original, which i think was working fine wrt VST2 and AU.

thanks again for your dedication and generosity.
__________________
welcome to epoch
enjoy volt
cerberus is offline   Reply With Quote
Old 06-29-2012, 04:13 AM   #146
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

I haven't moved SetParameterFromGui(). In the original IPlug there is both IPlugBase:: SetParameterFromGui() and IGraphics::SetParameterFromGui() - IGraphics::SetParameterFromGui() is not used anywhere - i didn't really understand its purpose, so it is currently commented out in WDL-OL.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 07-04-2012, 08:37 AM   #147
captain_caveman
Human being with feelings
 
captain_caveman's Avatar
 
Join Date: Dec 2011
Posts: 999
Default

I am getting the issue with the IPlugChunks example that was detailed earlier in this thread and is apparently fixed in latest branch. I think a similar issue is affecting my attempt at implementing chunks in my plugin, but I only have the latest Master from git. Sorry for n00b question, but how do I grab the Next branch?
captain_caveman is offline   Reply With Quote
Old 07-04-2012, 09:26 AM   #148
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

once you've cloned the repo, you should be able to switch branches by typing "git checkout next"
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 07-04-2012, 06:22 PM   #149
captain_caveman
Human being with feelings
 
captain_caveman's Avatar
 
Join Date: Dec 2011
Posts: 999
Default

Thanks, that's me on the bleedin' edge now and the IPlugChunks example is working perfectly.
captain_caveman is offline   Reply With Quote
Old 07-05-2012, 06:02 AM   #150
captain_caveman
Human being with feelings
 
captain_caveman's Avatar
 
Join Date: Dec 2011
Posts: 999
Default

Actually it's not quite working perfectly. In the simple plugin I am doing I am just trying to save one double value and having no joy with the Next branch either.

I have noticed that in the IPlugChunks example when I...

- Load it in project
- Save project
- Recall project

... the init valued are not recalled, but the first preset is. When a control is moved though, the actual state is saved and recalled. So it's similar to the issue before, but instead of blank values being recalled, the values from the first preset are.

Am I misunderstanding the purpose of SerializeState or am I correct in saying that it should be able to be used to store any arbitary data, whether or not it is part of a control?
captain_caveman is offline   Reply With Quote
Old 07-05-2012, 06:50 AM   #151
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

You are correct about SerializeState().

Regarding the rest of your message: I don't understand what you are saying. Which format are you trying with?

If I load IPlugChunks (VST2) in reaper, adjust the multislider, then save/reload the project the adjustments I made recall fine.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 07-05-2012, 08:53 AM   #152
captain_caveman
Human being with feelings
 
captain_caveman's Avatar
 
Join Date: Dec 2011
Posts: 999
Default

Yes, that parts works fine in the example. The issue appears when you load the plugin, do not make any changes, then save and recall the project. Instead of the sliders being at the last place they were, here in the code...
Code:
for(int i=0; i<NUM_SLIDERS; i++)
  {
    mSteps[i] = (double) i / (double) NUM_SLIDERS;
  }
... they are set to the first preset, Ramp Up, which is so similar to the initial state that I didn't notice at first. Switching the order of presets make it obvious.

So it seems as though some interaction is needed with a control for Un/SerializeState to function correctly.

In my simple plugin for example, I am attempting to store the number of seconds a project has been opened by substituting mSteps[i] with mSeconds (a (double) member of the plugin class, not the custom control class) in Un/SerializeState (removing for loop obviously) and in CompareState(), substituting mSteps with &mSeconds. The double isn't a normalized range. It isn't recalling with the project with the Master or Next branch.

If anything, it's been an adventure.
captain_caveman is offline   Reply With Quote
Old 07-06-2012, 02:20 AM   #153
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

thanks for clarifying... I can see the problem now.

Can you tell me if you uncomment line 155: RestorePreset(0); at the end of the constructor, does that fix the problem?
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 07-06-2012, 02:44 AM   #154
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

I see that the pDir (3rd argument) of PromptForFile is now a WDL_String, how do I specify no directory? Relatedly, is there any macro to make a constant WDL_String, like L"text" for long chars?

Also, how do you move a project out of the wdl-ol folder, is there any way? Thanks!
A_SN is offline   Reply With Quote
Old 07-06-2012, 04:33 AM   #155
captain_caveman
Human being with feelings
 
captain_caveman's Avatar
 
Join Date: Dec 2011
Posts: 999
Default

Quote:
Originally Posted by olilarkin View Post
thanks for clarifying... I can see the problem now.

Can you tell me if you uncomment line 155: RestorePreset(0); at the end of the constructor, does that fix the problem?
Cheers... no, I'm afraid not. Although that stops there being a change in appearance on save/reload it doesn't fix the issue.

I have toyed with it a bit more and it turns out that the even gain slider is not recalled unless the multislider control is changed by the user afterwards. So changing it by itself and saving/recalling or changing it after the multislider then saving recalling does not recall its state.

Also, changing the values of mSteps during ProcessDoubleReplacing then saving and recalling does not recall the changes. This is the one that is tripping me up in my plugin because I am changing a value and expecting it will be recalled in SerializeState.

Sorry to be a PITA, but I hope this helps.
captain_caveman is offline   Reply With Quote
Old 07-06-2012, 05:45 AM   #156
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

captain - it looks like chunks are a bit broken at the moment sorry about that.

A_SN - not sure what you mean by no directory. You could make a WDL_String and then set it to a default path with IGraphics:: DesktopPath() and pass as a reference.

regarding rearranging the project structure, you can try but I wouldn't advise it! There are a lot of relative paths that you will need to change in the xcode/MSVC projects. Personally I have all my private projects in a folder at the same level as IPlugExamples and this works really well for me.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 07-06-2012, 06:51 AM   #157
captain_caveman
Human being with feelings
 
captain_caveman's Avatar
 
Join Date: Dec 2011
Posts: 999
Default

Quote:
Originally Posted by olilarkin View Post
captain - it looks like chunks are a bit broken at the moment sorry about that.
No worries, glad I could help in finding something. Thanks.
captain_caveman is offline   Reply With Quote
Old 07-06-2012, 06:56 AM   #158
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

I just pushed an update that I hope fixes the problem... please try
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 07-06-2012, 09:16 AM   #159
captain_caveman
Human being with feelings
 
captain_caveman's Avatar
 
Join Date: Dec 2011
Posts: 999
Default

Yes, that's it working now inc abitrarily changing mStep values in the code.

Now it's just my plugin that isn't behaving, so I'll need to see what's different.... I haven't implemented any presets so maybe that's it.

Thanks again.
captain_caveman is offline   Reply With Quote
Old 07-06-2012, 03:25 PM   #160
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

Quote:
Originally Posted by olilarkin View Post
captain - it looks like chunks are a bit broken at the moment sorry about that.

A_SN - not sure what you mean by no directory. You could make a WDL_String and then set it to a default path with IGraphics:: DesktopPath() and pass as a reference.

regarding rearranging the project structure, you can try but I wouldn't advise it! There are a lot of relative paths that you will need to change in the xcode/MSVC projects. Personally I have all my private projects in a folder at the same level as IPlugExamples and this works really well for me.
Okay, by no directory I mean using "" as a third argument (for pDir) so if I recall correctly the folder opened would be the last used folder, which suits me since I use that for opening presets (you might find them in the same folder, probably nowhere near the desktop).
A_SN 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 05:29 PM.


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