Audacity 3.2.0
VSTControlMSW.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 VSTControlMSW.cpp
6
7 Leland Lucius
8
9**********************************************************************/
10
11#include "VSTControlMSW.h"
12
13#include <wx/dynlib.h>
14#include <wx/sizer.h>
15
18{
19}
20
22{
23 if (mHwnd)
24 {
26 mHwnd = 0;
27 }
28}
29
30bool 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
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}
const int effEditClose
Definition: aeffectx.h:107
const int effEditGetRect
Definition: aeffectx.h:105
const int effEditOpen
Definition: aeffectx.h:106
virtual bool Create(wxWindow *parent, VSTLink *link)
Definition: VSTControl.h:31
VSTLink * mLink
Definition: VSTControl.h:46
virtual ~VSTControl()
bool Create(wxWindow *parent, VSTLink *link) override
HANDLE mHwnd
Definition: VSTControlMSW.h:27
short right
Definition: aeffectx.h:388
short left
Definition: aeffectx.h:386
short top
Definition: aeffectx.h:385
short bottom
Definition: aeffectx.h:387