JuceVstWrapper...fixed cleanup when plug is rejected

I finished debuging the problem with Cubase disapearing after rejecting my plug. What happens with Cubase is this:

main() called, audio master version 2200
dispatcher<-effIdentify returned CCONST:1316373862

I am yet to find why effIdentify() failed and what its supposed to do anyway…

After this Cubase disapeared and in the debugger it seems that the problem is that a thread was stopped by force:

Logger::writeToLog (T("!! killing thread by force !!"));

It was a timer thread belonging to a texteditor of a combobox!

One problem was that my editor didn’t call DeleteAllChildren() in the destructor but that did not solve the problem.

the problems with JuceVstWrapper (that I fixed now) are:

  • The DLL was unloaded without calling effOpen or effClose so the wrapper was not deleted. I added DeletedAtShutdown as a base class to the wrapper so it will be deleted when the DLL unload

  • createEditorComp() was called twice, both in not the best place maybe. One in the constructor which is too early since effOpen was not received yet and like in the Cubase example there is no reason to create it if the plugin is not even opened. The second place is effEditOpen which is too late since my filter interacts with the editor when processBlock is called. so I moved createEditorComp() to the open() method and problem was finally solved.

Next task is fix the effIdentify problem and see that all is ok with Cubase. Next is to make FLStudio detect my Vst as an instrument and not an effect. Then Live, Podium, Sonar, Orion, Project 5…

Good night 8)

Thanks for all your hard work on this! Wish I had time right now to help out more, but I’ve got this tracktion thing to do… I promise I’ll be more useful as soon as V2 is launched!

I’ve added your changes to my code - the effIdentify thing can’t be causing the problem, because all it does is return a constant to tell the host that it’s actually a VST plugin. Check it out in AudioEffect.cpp. Maybe cubase expects the plugin to send something else afterwards?

take your time, I am having fun here and learning from the process…

The Cubase problem is strange, it happens in my plug and in the JuceAudioPlugin demo. It does not happen in the SDK demo synth and it is compiled in the same environment. Other plugs I wrote with the SDK directly (using JUCE for audio stuff only) also work with Cubase…

My plug and the VST demo both return the same value in effIdentify but Cubase say ‘Effect cannot be installed’ and does not call the plug again! BTW if I chane the value effIdentify then Cubase say another error 'Plugin failed to install".

This is realy strange, maybe the return value is garbaged somehow on its way back to Cubase?

Any idea?