Can I embed a Java GUI into a VST some how?
-
- KVRian
- Topic Starter
- 1096 posts since 28 May, 2010 from Finland
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?
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?
-
- KVRAF
- 2008 posts since 11 Aug, 2012 from omfr morf form romf frmo
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.
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.
-
- KVRian
- Topic Starter
- 1096 posts since 28 May, 2010 from Finland
-
Guillaume Piolat Guillaume Piolat https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=366815
- KVRist
- 279 posts since 21 Sep, 2015 from Grenoble
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).
Checkout our VST3/VST2/AU/AAX/LV2:
Inner Pitch | Lens | Couture | Panagement | Graillon
Inner Pitch | Lens | Couture | Panagement | Graillon
- KVRAF
- 23102 posts since 7 Jan, 2009 from Croatia
I think that's a really bad idea but oh well.
-
- KVRian
- Topic Starter
- 1096 posts since 28 May, 2010 from Finland
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++.EvilDragon wrote:I think that's a really bad idea but oh well.
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?
-
- KVRian
- 1265 posts since 9 Sep, 2005 from Oulu, Finland
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.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?
The usual recommendations : JUCE, IPlug, VSTGUI.
And the Java GUI idea is indeed a bad one...
-
- KVRAF
- 2256 posts since 29 May, 2012
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.
As far as I know this only can happen with ActiveQt on Windows.
~stratum~
- KVRAF
- 7890 posts since 12 Feb, 2006 from Helsinki, Finland
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.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?
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.