0

I am looking for a way to write an audio plugin using Qt. Audio plugins usually are dynamic libraries, not applications (http://teragonaudio.com/article/How-to-make-VST-plugins-in-Visual-Studio.html). While searching, I found on the audio forum contains the post QT etc for vst UI:

QtQuick/QML is perfect for any GUI development, including plugins. The only downside is that the payload is big (size of deployment). But that's really just the installation size and none of it affects performance. There are numerous ways to inject QtQuick scene graph to a window and not all of them are tied to or limited by the QApplication fake singleton. Gluing generic C++/Boost to Qml is made simple and thread-safe and Qt Quick scene graph itself runs mostly on GPU.

It's really just best to avoid all the QApplication and old Qt graphics framework techniques. They were good for maybe KDE and embedded systems (dentists chairs) ten years a go. QML made all that obsolete. For KDE also by the way.

Are these statements correct?
How can one use Qml and Qt Quck without QApplication in a c++ project? Can I use qtbase module in such a project?

scopchanov
  • 7,966
  • 10
  • 40
  • 68
Vladimir Bershov
  • 2,701
  • 2
  • 21
  • 51
  • 1
    Start with the fact, that QQuickItem is a subclass of QObject and QObject needs an event loop to function properly. _QGuiApplication contains the main event loop, where all events from the window system and other sources are processed and dispatched._ – scopchanov Oct 29 '20 at 04:04
  • You should write your plugin such that during it's life-time there is a QApplication/QGuiApplication that you instantiated yourself – Amfasis Oct 29 '20 at 07:51
  • I have used the VST SDK to write plugins aprox. 20 years ago. Could you please tell how the plugin is instantiated by the host in VST3? – scopchanov Oct 29 '20 at 10:55
  • @scopchanov Host app loads VST3 plugin as a dynamic library, which should implement some interface. – Vladimir Bershov Oct 29 '20 at 15:12
  • @scopchanov you can see it in the JUCE source file https://github.com/juce-framework/JUCE/blob/master/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp by looking at the methods containing the "factory" in the name – Vladimir Bershov Oct 29 '20 at 15:15

1 Answers1

1

I read through all the posts in your link and I think the author was being very loose with his terms. When he says:

It's really just best to avoid all the QApplication and old Qt graphics framework techniques.

He appears to simply be referring to avoiding Qt Widgets. The docs say "QApplication specializes QGuiApplication with some functionality needed for QWidget-based applications." In another post, he points to a QQuickRenderControl example, which he doesn't provide a link to, but I assume is this. That example uses QML along with a QGuiApplication, just not a QApplication.

Qt has examples for creating plugins for Qt-based applications. If you're wanting to use Qt to create a plugin for a non-Qt application, then it might work, but be prepared to have to ship the Qt libraries with your plugin, and you probably will still need a QGuiApplication. I don't really see a way around that.

JarMan
  • 7,589
  • 1
  • 10
  • 25