JUCE无法在音频插件上插入按钮

时间:2017-06-04 15:03:17

标签: c++ juce

我试图在音频插件中添加按钮,但在测试时无法显示它。

我使用插件主机测试并查看GUI。 /* GET home page. */ router.get('/', function(req, res, next) { res.sendFile(path.join(__dirname, '../', 'views', 'index.html')); }); 中定义了pad1

PluginEditor.h

我已将以下代码放入private: // This reference is provided as a quick way for your editor to // access the processor object that created it. CPAudioProcessor& processor; TextButton pad1;

PluginEditor.cpp

我在阅读本教程时作为如何添加按钮的指南:https://www.juce.com/doc/tutorial_rectangle_advanced

我有什么遗失的吗?它看起来与指南中的代码相同。

1 个答案:

答案 0 :(得分:1)

问题是我忘了在覆盖的resized方法中设置宽度/高度。

void CPAudioProcessorEditor::resized()
{
    // This is generally where you'll want to lay out the positions of any
    // subcomponents in your editor..
    pad1.setBounds(10, 10, 100, 100);
}