summaryrefslogtreecommitdiff
path: root/vendor/vstsdk2.4/vstgui.sf/vstgui/Documentation/html/maceditor.html
blob: 702648f1c969cfb9a0ddcdca7db91ec064615711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>VSTGUI: Macintosh Editor as HIViewRef</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.5 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="annotated.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul></div>
<h1><a class="anchor" name="maceditor">Macintosh Editor as HIViewRef</a></h1><h2><a class="anchor" name="Introduction">
Introduction</a></h2>
In the beginning of VST the Plug-In's GUI was attached at the left-top corner without a mechanism for the host to move it. This and the evolution of the macintosh platform makes it necessary to change this old behaviour. The modern way on Mac OS X to do UI design with C/C++ is to use HIViews and window compositing.<br>
 The VST SDK 2.4 requires the Plug-In to attach one HIView to the window and that this HIView can be moved around and that it can be embedded into other subviews.<br>
 Hosts which implement VST 2.4 need to provide a window to the Plug-In which is composited if the Plug-In itself uses 2.4. If the Plug-In uses an earlier VST SDK it should provide a non composited window.<p>
<hr>
 <h2><a class="anchor" name="maceditoropen">
Adding an HIView on effEditOpen</a></h2>
As before the ptr in effEditOpen is a WindowRef. You need to add one HIView to the content view of this window.<p>
<div class="fragment"><pre class="fragment">HIViewRef contentView;
<span class="keywordflow">if</span> (HIViewFindByID (HIViewGetRoot ((WindowRef)ptr, kHIViewWindowContentID, &amp;contentView) == noErr)
        HIViewAddSubview (contentView, myPluginView);
</pre></div><p>
<hr>
 <h2><a class="anchor" name="maceditorclose">
Closing on effEditClose</a></h2>
When effEditClose is called you should remove your HIView from the window.<p>
<div class="fragment"><pre class="fragment">HIViewRemoveFromSuperview (myPluginView);
</pre></div><p>
Don't do anything with the window. It is not your window.<p>
<hr>
 <h2><a class="anchor" name="maceditorsizing">
Resizing the Plug-In</a></h2>
If you want to resize your view, just do it, but don't resize the host window.<p>
<div class="fragment"><pre class="fragment">HIRect pluginBounds;
HIViewGetFrame (myPluginView, &amp;pluginBounds);
pluginBounds.size.width = newWidth;
pluginBounds.size.height = newHeight;
HIViewSetFrame (myPluginView, &amp;pluginBounds);
</pre></div><p>
The host needs to listen to bounds changes on the Plug-In view and resize its window accordingly.<p>
<hr>
 <h2><a class="anchor" name="maceditordeprecated">
No more effEditDraw, effEditIdle, effEditMouse, effEditTop, effEditSleep</a></h2>
You need to use Carbon Events now, which you register on the HIView, not on the window if possible. But don't remove these opcodes from your editor yet.<p>
<hr>
 <h2><a class="anchor" name="maceditorvst23hosts">
VST 2.4 Plug-Ins and VST 2.3 Hosts</a></h2>
Now there is a conflict situation that VST 2.3 hosts may not work with HIViews and window compositing. Therefore you need at least support effEditDraw, so that your Plug-In draws correctly in these hosts. Mouse, idle and activation events can be handled via Carbon Events.<p>
<dl compact><dt><b>See also:</b></dt><dd><a href="http://developer.apple.com/documentation/Carbon/Conceptual/HIViewDoc/index.html" target="_blank>">Apple HIView Programming Guide </a> </dd></dl>
<html>

<head>
	<title>Empty</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<meta name="Author" content="mario">
</head>

<body>

<br/>
<hr width="100%" size="2" align="left" />
<div align=left>
Copyright �2006 <a href="http://www.steinberg.net" target="_blank"><u>Steinberg Media Technologies</u></a>.
All Rights Reserved.
</div>
</body>

</html>