[Clam-devel] VST plugins with qt interface!

David García Garzón dgarcia at iua.upf.edu
Mon Mar 2 04:02:22 PST 2009


I am on an spike on what we need to make vst plugins first class clam 
citizens. I fully solved croscompiling vst's from linux and I event started 
using qt interfaces as vst gui. In that last point, there still is a lot of 
work to do, but the basic question on whether you can use qt to edit a vst 
plugin is now out of any doubt.

To make the spike simpler, and in order not to collide with other CLAM 
developers, i just let apart all the CLAM wrapping part, just addressing vst 
crosscompiling and Qt with the sdk examples.

Cross compilation was pretty easy. This time I found lot more documentation on 
mingw and even scons[1]. Just by adding the crossmingw scons tool we are 
already using for the apps and i got some Linux compiled plugins running on 
Wine [2].
[1] http://learnvst.wordpress.com/
[2] http://clam-project.org/wiki/Image:Vst-crosscompiling.png

Adding a regular user intercaces is just a matter of compiling both the vstgui 
and editor sources[3] that comes in the sdk.
http://clam-project.org/wiki/Image:Vst-vstgui.png

VSTGUI is just a full toolkit implementing the 'editor interface' and a 
toolkit with some provided widgets and, i guess, a way of automating the 
binding of controls to processing.

So what we need for qt is to implement the AEffEditor interface using the qt 
toolkit instead. The problem is that you are provided a system window handle, 
if you create a widget with no parent it will be a top level and the window 
for the plugin is an empty one[4]. 

[4] http://clam-project.org/wiki/Image:Vst-qttoplevel.png

How do you create a widget on an existing window handle? Months ago trolls 
redirected me to a commercial solution, and i was digging in windows qt source 
code for a hack when i found the answer just at the public and multiplatform 
QWidget api. QWidget::create works like a charm. The following simple class is 
a native window wrapper you can use as a regular QWidget.

class QVstWindow : public QWidget
{
	Q_OBJECT
public:
	QVstWindow(WId handle) {create(handle);}
	QVstWindow::~QVstWindow() {}
};

Still there are some issues: focus handling, reopening, drag&drop... But the 
basic mouse clicking and resizing works[5]
[5] http://clam-project.org/wiki/Image:Vst-qt.png

Once i got that, loading a designer ui file[6] was very easy.
[6] http://clam-project.org/wiki/Image:Vst-designer.png

As I said there are still many caveats to solve. A matter of playing with it 
and refining things.

TODO's:
- Communicate controls up and down
- Handle focus and other events properly
- Build a network wrapper which reensembles more the one for LADSPA
- Embed network and interface files (DONE)
- Wiki documentation on how to do one
- One button plugin generator ;-)

I attatch the files for the examples. Interesting bits are in QADelayEditor.*



-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia


-------------- next part --------------
A non-text attachment was scrubbed...
Name: surrounddelay.cpp
Type: text/x-c++src
Size: 4774 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0018.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: surrounddelay.h
Type: text/x-chdr
Size: 1854 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0009.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adelaymain.cpp
Type: text/x-c++src
Size: 776 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0019.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SConstruct
Type: text/x-python
Size: 4628 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0003.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QADelayEditor.hpp
Type: text/x-c++hdr
Size: 2119 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0006.hpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qadelay.hpp
Type: text/x-c++hdr
Size: 798 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0007.hpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adelay.h
Type: text/x-chdr
Size: 2264 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0010.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QADelayEditor.cpp
Type: text/x-c++src
Size: 9810 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0020.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qadelay.cpp
Type: text/x-c++src
Size: 1483 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0021.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interface.ui
Type: application/x-designer
Size: 2335 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0012.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adelay.cpp
Type: text/x-c++src
Size: 5804 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0022.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sdeditor.cpp
Type: text/x-c++src
Size: 7803 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0023.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sdeditor.h
Type: text/x-chdr
Size: 1320 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0011.h>
-------------- next part --------------
#define APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

128                     BITMAP  DISCARDABLE     "bmp00128.bmp"
129                     BITMAP  DISCARDABLE     "bmp00129.bmp"
130                     BITMAP  DISCARDABLE     "bmp00130.bmp"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bmp00130.bmp
Type: image/bmp
Size: 294 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0013.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bmp00129.bmp
Type: image/bmp
Size: 2634 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0014.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bmp00128.bmp
Type: image/bmp
Size: 116154 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090302/83a038f9/attachment-0015.bin>


More information about the clam-devel mailing list