Force open a Plugin's AudioProcessorEditor

gui

#1

Hey friends,

I have a Plugin which also has a separate DocumentWindow that is shared among all instances of the Plugin.

Now inside this DocumentWindow I want to add a “show Plugin”-button for each Plugin instance. When clicked, it should open the AudioProcessorEditor of the desired Plugin.

Is this a good idea or even possible? I assume that different hosts handle opening of Plugin GUIs in different ways, so my trying to force open the editor gives me the heebie jeebies a little bit.

In any case I haven’t been successful. If the given Plugin’s editor is already open somewhere, it successfully brings it to the foreground. But it doesn’t open the editor if it is currently closed.

void MyDocumentWindow::buttonClicked(Button *button)
{
	// Check which button was clicked, etc..
	// ...

	// Get corresponding plugin instance.
	AudioProcessor* plugin = GetProcessor(buttonIndex);
	if (plugin)
	{
		// Create plugin's editor if it doesn't already exist.
		AudioProcessorEditor* gui = plugin->createEditorIfNeeded();

		// Show and bring to foreground.
		if (gui)
		{
			gui->setVisible(true);
			gui->toFront(true);
		}
	}
}

The call to createEditorIfNeeded() seems to be working fine and returns a valid pointer, but then setVisible() doesn’t seem to be doing anything.

Any ideas?
Cheers


#2

To me it sounds like just a bad idea.

Have you ever seen any other plugin in any host achieving something like that successfully?


#3

To me it sounds like just a bad idea.

Ok so it’s not just me :slight_smile:

Have you ever seen any other plugin in any host achieving something like that successfully?

Well there are plugins which have their separate “settings” window or whatever (like what I am doing) but no, I’ve never seen the reverse.


#4

Maybe if you do addToDesktop on the plugin GUI, it will appear, but I bet there will be all kinds of problems…I wouldn’t recommend shipping to customers. :slight_smile:


#5

Yes, don’t. Remember, that usually a host embeds the editor created by createEditorIfNeeded() into a window with host specific buttons for routing, presets and all kind of things.

If you create the editor yourself, even if you manage to display it, it will break the user experience, since it will lack the features you get, if the host opened the editor.


#6

Indeed. Calling addToDesktop() like @Xenakios suggested works, but then I don’t have the host-specific controls like you say. Moreover, deleting the Editor which I forced to create then becomes my problem, as it is no longer attached to the host, so to speak.

This was a feature suggested from “above”, so I wanted to investigate it. But I knew from the start that it was probably a bad idea.

Thanks guys for your input! :smiley:


#7

you could probably do something like Kontakt’s memory server, in that it’s a separate application altogether that all instances of the plugin can talk to.


#8

Well, communication between the individual plugins and the standalone window is no issue at all.

My question was specifically about forcing a plugin to pop open it’s editor, which is normally something that the host handles.


#9

Another thought that comes to my mind: Wouldn’t it be completely possible for a host designer to decide to embed the plugin GUI into the main host GUI instead of opening an additional window which shows the editor? I’m not 100% sure, but I think I remember coming across such a solution in some special host out there.

So in this (maybe only theoretical) case, for the host opening the editor wouldn’t necessarily mean to create a free-floating window with the plugin editor, but could also mean to trigger a change in the layout of the host window. Now that’s an event that is not expected to be triggered externally as this wouldn’t necessarily make sense for the host in all situations. That might be another explanation why there seems to be no such option in any popular plugin format. Please correct me if I’m completely wrong at this point.


#10

Wouldn’t it be completely possible for a host designer to decide to embed the plugin GUI into the main host GUI instead of opening an additional window which shows the editor?

Yeaps that’s completely possible. Or you can have it (your plugin editor) dockable with your daw. Or collect all your open plugin editors in a set of tabbed windows. But bear in mind that most plugins does a bad job of being resized. Many don’t scale at all so you’re mostly stuck with a fixed plugin editor size.