| 28 | } |
| 29 | |
| 30 | bool VSTControl::Create(wxWindow *parent, VSTLink *link) |
| 31 | { |
| 32 | if (!VSTControlBase::Create(parent, link)) |
| 33 | { |
| 34 | return false; |
| 35 | } |
| 36 | |
| 37 | VstRect *rect; |
| 38 | |
| 39 | // Some effects like to have us get their rect before opening them. |
| 40 | mLink->callDispatcher(effEditGetRect, 0, 0, &rect, 0.0); |
| 41 | |
| 42 | // Get the native handle |
| 43 | mHwnd = GetHWND(); |
| 44 | |
| 45 | // Ask the effect to add its GUI |
| 46 | mLink->callDispatcher(effEditOpen, 0, 0, mHwnd, 0.0); |
| 47 | |
| 48 | // Get the final bounds of the effect GUI |
| 49 | mLink->callDispatcher(effEditGetRect, 0, 0, &rect, 0.0); |
| 50 | |
| 51 | // Add the effect host window to the layout |
| 52 | SetMinSize(wxSize(rect->right - rect->left, rect->bottom - rect->top)); |
| 53 | |
| 54 | // Must get the size again since SetPeer() could cause it to change |
| 55 | SetInitialSize(GetMinSize()); |
| 56 | |
| 57 | return true; |
| 58 | } |
no test coverage detected