[linux-audio-dev] VST compiled for linux / gui message loop

jorgen support at xt-hq.com
Sat Jan 7 13:43:24 UTC 2006


torbenh at gmx.de wrote:

>On Sat, Jan 07, 2006 at 11:58:49AM +0100, jorgen wrote:
>  
>
>>Hi, Im coding a VST host for windows and linux. The linux version will 
>>support VSTs compiled on linux and not using wine or aything. Of course, 
>>there is not alot of native linux VST plugins around but that will 
>>change (I already made one :P )
>>    
>>
>
>:) cool welcome abord. so you ported vstGUI ?
>how will that work ? 
>does a vst plugin coder only recompile his plug then ?
>
>  
>
No, I have made my own toolkit based on xlib calls. The host (energyXT2) 
will pass a xlib Window handle that I use as a parent when calling 
XCreateWindow:

      case effEditOpen:
            if (!editor)
                editor = new CEditor(app, 0, wsChild | wsNoBorder, "", 
100, 100, 200, 200);
#ifdef WIN32   
      SetWindowLong (editor->handle, GWL_STYLE,
                (GetWindowLong (editor->handle, GWL_STYLE) &~ WS_POPUP) 
| WS_CHILD);
      SetParent(editor->handle, HWND(ptr));
#endif
#ifdef linux
            XReparentWindow(dp, editor->handle, (Window)ptr, 0, 0);
            editor->parentWnd = (Window)ptr;
#endif
      editor->show();
      result = 1;
    break;



In effEditIdle I then call my message loop:

        case effEditIdle:
#ifdef linux
            XEvent event;
            while (XPending(dp)) {
                XNextEvent(dp, &event);
                handleEvent(event);                        // replace 
this with your own event handler for your toolkit
            }
#endif
        break;

>>There is one challange though, event dispatching in X11. Unlike windows, 
>>X11 windows doesnt have an assotiated window proc for dispatching 
>>events. I can overcome this in my own gui toolkit by passing a Display* 
>>pointer to the plugin etc, but it wouldnt work with other gui toolkits.
>>
>>So how do I make a soution that work with any toolkits on linux?
>>    
>>
>
>we are still searching for a solution with a window generated in the
>same process. with different toolkits etc.
>
>to my knowledge
>this has not really been solved. believe me, there would be a much nicer
>standard than dssi already.
>
>  
>
>>1) the plugin calls its own event loop in effEditIdle
>>2) make a new atom "wndproc" for storing wndproc function per window, 
>>the host will send XEvents to the wndproc if found.
>>
>>I prefer 1) but I dont know if toolkits supports manually calling the 
>>event loop?
>>    
>>
>
>i am not sure i understand what you want to do but.....
>
>for gtk see:
>
>http://www.gtk.org/api/2.6/gtk/gtk-General.html#gtk-main-iteration-do
>
>for qt start along here:
>
>http://doc.trolltech.com/4.1/qeventloop.html#processEvents
>
>
>  
>
>>cheers
>>jorgen
>>
>>
>>    
>>
>
>  
>




More information about the Linux-audio-dev mailing list