Hey Everyone,
I’m trying to refactor an audio plugin I made with a proper component hierarchy, but I’m stuck at the start with something that’s probably a beginners mistake…
So I got my empty VST3 project setup and that works in the daw (I use StudioOne):
But if add a basic empty child component, in the daw it just shows a bunch of dials like this:
Here’s my PluginEditor.h:
// Conductor : Copyright ioFlow Studios 2021 //
#pragma once
// System includes
#include <vector>
#include <iostream>
#include <map>
#include "HeaderComponent.h"
#include "BodyComponent.h"
#include "FooterComponent.h"
#include <JuceHeader.h>
#include "PluginProcessor.h"
/////////////////////////////////////
// //
// ConductorAudioProcessorEditor //
// //
/////////////////////////////////////
class ConductorAudioProcessorEditor : public juce::AudioProcessorEditor, private juce::Timer
{
public:
////////// ---------- Components ---------- //////////
// Layout components
HeaderComponent* header;
BodyComponent* body;
FooterComponent* footer;
// Resizer component
ResizableCornerComponent* resizer;
ComponentBoundsConstrainer resizeLimits;
////////// ---------- Methods ---------- //////////
// Construction
ConductorAudioProcessorEditor (ConductorAudioProcessor&);
~ConductorAudioProcessorEditor() override;
// Rendering
void paint (juce::Graphics&) override;
void resized() override;
// listeners
void timerCallback() override; // Check processor frequently (thread safe alternative to processor pushing to editor)
private:
////////// ---------- Properties ---------- //////////
// Processor reference for editor
ConductorAudioProcessor& audioProcessor;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ConductorAudioProcessorEditor)
};
And here’s my PluginEditor.cpp
// Conductor : Copyright ioFlow Studios 2021 //
#include "PluginProcessor.h"
#include "PluginEditor.h"
///////////////////
// //
// constructor //
// //
///////////////////
ConductorAudioProcessorEditor::ConductorAudioProcessorEditor (ConductorAudioProcessor& p)
: AudioProcessorEditor (&p), audioProcessor (p)
{
//// ---- header component ---- ////
addAndMakeVisible(header);
//// ---- set starting size ---- ////
setSize (1600, 730);
}
ConductorAudioProcessorEditor::~ConductorAudioProcessorEditor() {}
/////////////////////
// //
// timerCallBack //
// //
/////////////////////
void ConductorAudioProcessorEditor::timerCallback()
{
}
/////////////
// //
// paint //
// //
/////////////
void ConductorAudioProcessorEditor::paint (juce::Graphics& g)
{
// (Our component is opaque, so we must completely fill the background with a solid colour)
g.fillAll (getLookAndFeel().findColour (juce::ResizableWindow::backgroundColourId));
g.setColour (juce::Colours::white);
g.setFont (15.0f);
g.drawFittedText ("Hello World!", getLocalBounds(), juce::Justification::centred, 1);
}
///////////////
// //
// resized //
// //
///////////////
void ConductorAudioProcessorEditor::resized()
{
// This gets called when you set the size of the canvas (either in the constructor or by resizing in the daw)
header->setBounds(0, 0, getWidth(), getHeight());
}
So, pretty basic, don’t think there’s something else interfering with the plugin working (the header, body and footer components are just empty components made in projucer).
Did I miss something in the tutorials? Is there something extra you have to do to make it work when you’re doing an audio plugin?