<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Including <a href="mailto:devel@lists.lv2plug.in">devel@lists.lv2plug.in</a><br><br>On Thu, Nov 21, 2013 at 3:10 PM, Warren Koontz <span dir="ltr"><<a href="mailto:profwub@gmail.com" target="_blank">profwub@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Harry,<div><br></div><div>Thanks for the quick response. Or should I say "dank U wel"? </div>
</div></blockquote><div>Dank je wel, I'm dutch indeed. Living in Ireland though<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">
<div><br></div><div>The Multiverb object is not the plug-in itself, but an object used within the plug-in. This object includes delay lines which need to be re-set for each activate/run(one or more times)/deactivate cycle. So instantiate instantiates the plug-in, activate instantiates and initializes the Multiverb object (with fresh delay lines), run does the processing (saving delay line states between successive runs), deactivate deletes the Multiverb object (setting the state for a subsequent cycle) and cleanup deletes the plug-in.</div>
</div></blockquote><div><br>Yes you're on the right track.  Lots of plugins have "internal classes" for lack of a better way of explaining it.<br>An example I'm familiar with is Masha, which includes two instances of a DSP class: <a href="https://github.com/harryhaaren/openAV-ArtyFX/blob/master/masha/dsp/masha.cxx#L84">https://github.com/harryhaaren/openAV-ArtyFX/blob/master/masha/dsp/masha.cxx#L84</a> <br>
<br></div><div>Try to do as little work as possible in activate() / deactivate(). If work can be pushed to instantiate(), it should be: <br>In this case, concider having a "reset()" method on the Multiverb class, and call that on activate(), instead of deleting the Multiverb object in deallocate(), and creating a new one in activate().<br>
<br></div><div>Deleting / allocating a Multiverb object in activate() / deactivate() should be avoided at all costs: it is *not* a real-time safe operation, and can be avoided.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div></div><div>I agree that static variables are undesirable (although they served a purpose in the pre C++ days). I just thought it might be weird to give the host application access to the Multiverb object.</div>
</div></blockquote><div>The host doesn't actually have access to the Multiverb object: it knows the plugin handle*, but nothing particular about it. The host won't interact with the plugin instance except for the LV2 specified callback functions.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>mvg,</div><div><br></div><div>Warren</div></div></blockquote><div>
<br></div><div>Cheers, -Harry<br></div><div> <br></div></div></div></div>