Problems when trying to put 2 plugineditors into 1 Component


#1

Please consider the following code, why are the 2 VST plugin editors not put on the correct positions? I need this to work as I want to create a big component with many plugins on it. This was on Windows, I haven’t tested on Mac.

[code]class MainAppWindow:public DocumentWindow
{
public:
MainAppWindow():DocumentWindow(JUCEApplication::getInstance()->getApplicationName()+" ("+JUCEApplication::getInstance()->getApplicationVersion()+")",
Colours::black, DocumentWindow::allButtons, true)
{
setResizable(true, false);
setUsingNativeTitleBar(true);
setContentComponent(new Component());
test();
}

~MainAppWindow()
{
	setContentComponent(0, true);
}

void test()
{
	Component *c=getContentComponent();

	VSTPluginFormat format;
	PluginDescription desc;
	desc.fileOrIdentifier="c:/audio/vstplugins/dx10 vsti.dll";
	AudioPluginInstance *d1=format.createInstanceFromDescription(desc);
	desc.fileOrIdentifier="c:/audio/vstplugins/IL Drumaxx.dll";
	AudioPluginInstance *d2=format.createInstanceFromDescription(desc);

	AudioProcessorEditor *e1=d1->createEditor();
	AudioProcessorEditor *e2=d2->createEditor();

	e1->setTopLeftPosition(10,10);
	e2->setTopLeftPosition(600,20);
	c->addAndMakeVisible(e1);
	c->addAndMakeVisible(e2);
}

void closeButtonPressed()
{
	JUCEApplication::getInstance()->quit();
}

void paint(Graphics& g)
{
	g.fillAll(Colours::white);
}

};[/code]


#2

Hmm with some plugins it works, with others not. I assume that’s some bugs in the VSTs then.


#3

Interesting fact: 1 plugin can always be placed anywhere onto a component. It’s only with 2 or more plugins that problems occur.


#4

Many plugins will assume that they are the only child window in their parent, and will get confused if you try to make them share a parent. It really only works if you put them each in their own window, since that’s how all the hosts do it.


#5

Wouldn’it be possible to add another intermediary dummy window where the actual VST plugin window is added to the VSTPluginWindow class inside juce_VSTPluginFormat.cpp ? So it would be the only child of that window. I guess that would work.


#6

Yes, that’d probably do the trick.


#7

Yes it does, I just tried it.