Raychan1 / symbiosis-au-vst

Automatically exported from code.google.com/p/symbiosis-au-vst
0 stars 0 forks source link

Enhancement: Allow gui construction in Editor::open #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently the wrapper needs VSTGUI to set up the size of the gui within the 
editor's constructor. For example:

SDEditor::SDEditor (void *effect) : AEffGUIEditor (effect)  {
    hBackground = new CBitmap ("back.png");
    rect.left   = 0;
    rect.top    = 0;
    rect.right  = (short)hBackground->getWidth ();
    rect.bottom = (short)hBackground->getHeight ();
}

If you look at the VSTGUI 3.6 examples, all construction is moved to 
Editor::open (void *ptr). But if you move the set up of rect sizes to the open 
function, it will cause errors on runtime. So the wrapper is incompatible 
with recent vstgui 3.6 examples.

Original issue reported on code.google.com by jurekra...@googlemail.com on 16 Jan 2010 at 6:55

GoogleCodeExporter commented 8 years ago
Thanks for reporting this (and sorry for my late reply). Then, if I understand 
you correctly, there is no way to 
query the size of the editor window before "populating it"? So we might need to 
create the user pane with an 
arbitrary size first, then open the editor and then resize the pane afterwards. 
This change would need quite a bit 
of compatibility testing.

The relevant code is in createView at line 4513. My guess is that the call to 
'getEditorDimensions' must not take 
place before 'openEditor'.

When time allows I will download VSTGUI 3.6 and check the examples.

Have you by any chance even tried this yourself already?

Original comment by malstro...@gmail.com on 22 Mar 2010 at 11:54

GoogleCodeExporter commented 8 years ago
I've done some more investigations into this. It has nothing to do with VSTGUI 
3.6. (It is the same in VSTGUI 3.5 at least.) 
Apparently, Steinberg is not setting the rect at all(!!) in the tutorial 
example. The rect data is garbage for the entire life-time of the 
plug-in.

I am not sure if I should report this as a bug yet. The VSTGUI tutorial 
certainly doesn't work with all hosts and I am talking about 
the VST now, not the wrapped AU. Ableton Live for example will open a window of 
incorrect size. VSTLord seems to display the 
plug-in fine anyhow.

My guess is that Steinberg is not relying on getRect themselves anymore, but on 
the size of the HIView (and perhaps the child-
window under Windows then). However, this won't work with some older plug-ins 
so I dare not taking this step with Symbiosis (yet 
anyhow). Steinberg hasn't officially deprecated getRect, so I am very inclined 
to file this as a bug with the VSTGUI crew.

Any thoughts, anyone?

Original comment by malstro...@gmail.com on 28 Mar 2010 at 1:14

GoogleCodeExporter commented 8 years ago
(Right, the tutorial doesn't work under Windows either. What were they 
thinking?)

Original comment by malstro...@gmail.com on 28 Mar 2010 at 6:26

GoogleCodeExporter commented 8 years ago
I've had problems with some of my plugins crashing if the construction isn't 
moved to Editor::open method. 
However, there's a bit of a kludge you can do - leave all construction in 
Editor::open and do this in the 
constructor;

    hBackground = new CBitmap ("back.png");
    rect.left   = 0;
    rect.top    = 0;
    rect.right  = (short)hBackground->getWidth ();
    rect.bottom = (short)hBackground->getHeight ();
    hBackground->forget ();
    hBackground = 0;

...messy, I know, but so far it does seem to work - you get the right sized 
window and no crashing 
(umm...so far) as I go through the process of symbioting my plugins.

   Dave Malham

Original comment by dgm2%yor...@gtempaccount.com on 4 Apr 2010 at 9:46

GoogleCodeExporter commented 8 years ago
Yes I agree. AFAIK you're required to set the rect size in the editor 
constructor. I do exactly what Dave Malham suggests above (which is exactly how 
the VSTGUI samples worked in  VSTGUI 3.0, which I'm still based on as I've made 
so many improvements that would all break in later versions that I'm now 
married to it.)

Original comment by AdmiralQuality@gmail.com on 4 Nov 2010 at 6:33

GoogleCodeExporter commented 8 years ago

Original comment by malstro...@gmail.com on 30 Aug 2011 at 10:34