【发布时间】:2015-01-10 19:46:31
【问题描述】:
我使用 VST SDK 2.4 制作了一个插件。到目前为止,我一直在使用通用接口来控制插件,但现在我正在尝试使用 VSTGUI 库添加自定义接口。
我已设置编辑器文件并尝试使用与库一起打包的示例代码中概述的代码。我有点担心可能无法与 OSX Yosemite 完全兼容,但是在这个阶段我正在解决一些基本问题。
我想知道我是否做错了什么,还是应该放弃在 OSX 10.10 中使用 VSTGUI?
在编译时,我收到以下错误: ./TutorialEditor.h:42:32: 错误:
no matching constructor for initialization of 'AEffGUIEditor'
Editor (const void* ptr) : AEffGUIEditor (ptr) {}
^ ~~~
vstsdk2.4/vstgui.sf/vstgui/aeffguieditor.h:51:7: note: candidate constructor
(the implicit copy constructor) not viable: cannot convert argument of incomplete type
'const void *' to 'const AEffGUIEditor'
class AEffGUIEditor : public AEffEditor
^
vstsdk2.4/vstgui.sf/vstgui/aeffguieditor.h:55:2: note: candidate constructor not viable: cannot
convert argument of incomplete type 'const void *' to 'AudioEffect *'
AEffGUIEditor (AudioEffect* effect);
^
我的 vst 插件的构造函数中的初始化如下所示:
extern AEffGUIEditor* createEditor (AudioEffectX*);
setEditor (createEditor (this));
这是 TutorialEditor.cpp 代码:
#include "TutorialEditor.h"
AEffGUIEditor* createEditor (AudioEffectX* effect) {
return new Editor (effect);
}
bool Editor::open (void* ptr) {
CRect frameSize (0, 0, 300, 300);
frame = new CFrame (frameSize, ptr, this);
return true;
}
void Editor::close () {
delete frame;
frame = 0;
}
这是 TutorialEditor.h 代码:
#include "vstgui.sf/vstgui/aeffguieditor.h"
class Editor : public AEffGUIEditor {
public:
Editor (void* ptr) : AEffGUIEditor (ptr) {}
bool open (void* ptr);
void close ();
};
【问题讨论】:
-
如果你得到一个编译器错误,你显然做错了什么。将正确的参数类型传递给基类构造函数,你不会有问题。