Can I embed a Java GUI into a VST some how?

DSP, Plug-in and Host development discussion.
soundmodel
KVRian
644 posts since 28 May, 2010 from Finland

Post Wed May 23, 2018 11:44 am

I found a good library that's written in Java and while it has a C++ API, the GUI for it is in Java.

Wanting to avoid rewriting the GUI or parts of it. I was thinking, would it be possible to "host" the GUI somehow inside a C++ VST?

yellowmix
KVRian
694 posts since 11 Aug, 2012

Re: Can I embed a Java GUI into a VST some how?

Post Wed May 23, 2018 2:54 pm

Yes, look up Java Native Interface. Whether it's a good idea is another question.

Could also use a network model, like REST API. Have the Java GUI run as a separate process and talk to the C++ plugin. But that's probably an even worse idea.

soundmodel
KVRian
644 posts since 28 May, 2010 from Finland

Re: Can I embed a Java GUI into a VST some how?

Post Thu May 24, 2018 7:36 am

Perhaps this is a simpler path to this:

http://jvstwrapper.sourceforge.net

User avatar
Guillaume Piolat
KVRist
177 posts since 21 Sep, 2015 from Grenoble

Re: Can I embed a Java GUI into a VST some how?

Post Thu May 24, 2018 7:48 am

If using JNI, I don't remember a way to directly read from C memory : you have to copy it to the Java heap, and that might even allocate in the process. Having an UI in Java would probably prevent you from having real-time feedback that would fetch a buffer from DSP to UI (for say, the GR curve of a compressor).
VST/AU/AAX: Couture | Panagement | Graillon

User avatar
EvilDragon
KVRAF
16885 posts since 7 Jan, 2009 from Croatia

Re: Can I embed a Java GUI into a VST some how?

Post Thu May 24, 2018 7:52 am

I think that's a really bad idea but oh well.

soundmodel
KVRian
644 posts since 28 May, 2010 from Finland

Re: Can I embed a Java GUI into a VST some how?

Post Thu May 24, 2018 8:20 am

EvilDragon wrote:I think that's a really bad idea but oh well.
It could be that it'd take less time to write the GUI again in C++. Rather than try to host the Java GUI in C++.

What bugs me about VST SDK though is that I don't understand what kind of GUI standards it follows. Like can I write a VST SDK using Qt or something? Or do I need to use some "VST SDK -compatible" GUI SDK?

Xenakios
KVRian
1142 posts since 9 Sep, 2005 from Oulu, Finland

Re: Can I embed a Java GUI into a VST some how?

Post Thu May 24, 2018 9:05 am

soundmodel wrote:I don't understand what kind of GUI standards it follows. Like can I write a VST SDK using Qt or something? Or do I need to use some "VST SDK -compatible" GUI SDK?
It's best to use a GUI framework that's designed to be used for plugins. Qt is an example of a framework that is not going to work without major problems.

The usual recommendations : JUCE, IPlug, VSTGUI.

And the Java GUI idea is indeed a bad one...

stratum
KVRAF
1839 posts since 29 May, 2012

Re: Can I embed a Java GUI into a VST some how?

Post Thu May 24, 2018 1:37 pm

If anyone knows how to integrate Qt into another GUI framework/application, I would like to know too :)
As far as I know this only can happen with ActiveQt on Windows.
~stratum~

mystran
KVRAF
4981 posts since 12 Feb, 2006 from Helsinki, Finland

Re: Can I embed a Java GUI into a VST some how?

Post Thu May 24, 2018 2:10 pm

soundmodel wrote: What bugs me about VST SDK though is that I don't understand what kind of GUI standards it follows. Like can I write a VST SDK using Qt or something? Or do I need to use some "VST SDK -compatible" GUI SDK?
Well, the compatibility requirements are basically that it needs to work with the host provided message loop and needs to be able to open your GUI inside a host provided window (ie. you get a HWND or Cocoa view to use as a parent depending on platform). One (or both) of these is usually the main problem with the "big frameworks" as they often like to have full control over the application and that's just not going to work in a plugin.

In contrast the toolkits (eg. Juce, IPlug) that are usually recommended for plugin work have been specifically designed to work in this environment and they make few assumptions about the rest of the application. On top of that they might include work-arounds for various corner cases in various specific hosts, so you potentially save yourself a bunch of troubleshooting.
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.

Return to “DSP and Plug-in Development”