Audacity
3.2.0
src
effects
VST
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
16
VSTControl::VSTControl
()
17
:
VSTControlBase
()
18
{
19
}
20
21
VSTControl::~VSTControl
()
22
{
23
if
(
mHwnd
)
24
{
25
mLink
->
callDispatcher
(
effEditClose
, 0, 0,
mHwnd
, 0.0);
26
mHwnd
= 0;
27
}
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
}
VSTControlMSW.h
effEditClose
const int effEditClose
Definition:
aeffectx.h:107
effEditGetRect
const int effEditGetRect
Definition:
aeffectx.h:105
effEditOpen
const int effEditOpen
Definition:
aeffectx.h:106
VSTControlBase
Definition:
VSTControl.h:19
VSTControlBase::Create
virtual bool Create(wxWindow *parent, VSTLink *link)
Definition:
VSTControl.h:31
VSTControlBase::mLink
VSTLink * mLink
Definition:
VSTControl.h:46
VSTControl::~VSTControl
virtual ~VSTControl()
Definition:
VSTControlGTK.cpp:36
VSTControl::VSTControl
VSTControl()
Definition:
VSTControlGTK.cpp:31
VSTControl::Create
bool Create(wxWindow *parent, VSTLink *link) override
Definition:
VSTControlGTK.cpp:42
VSTControl::mHwnd
HANDLE mHwnd
Definition:
VSTControlMSW.h:27
VSTLink
Definition:
VSTWrapper.h:64
VSTLink::callDispatcher
virtual intptr_t callDispatcher(int opcode, int index, intptr_t value, void *ptr, float opt)=0
VstRect
Definition:
aeffectx.h:383
VstRect::right
short right
Definition:
aeffectx.h:388
VstRect::left
short left
Definition:
aeffectx.h:386
VstRect::top
short top
Definition:
aeffectx.h:385
VstRect::bottom
short bottom
Definition:
aeffectx.h:387
Generated by
1.9.3