Initial work on custom GUI

This commit is contained in:
xenakios
2017-11-13 20:45:23 +02:00
parent 793279a20a
commit b9db955a99
5 changed files with 72 additions and 31 deletions

View File

@ -16,9 +16,14 @@
PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor (PaulstretchpluginAudioProcessor& p)
: AudioProcessorEditor (&p), processor (p)
{
// Make sure that before the constructor has finished, you've set the
// editor's size to whatever you need it to be.
setSize (400, 300);
const auto& pars = processor.getParameters();
for (int i=0;i<pars.size();++i)
{
m_parcomps.push_back(std::make_shared<ParameterComponent>(pars[i]));
m_parcomps.back()->setBounds(1, i * 25, 598, 24);
addAndMakeVisible(m_parcomps.back().get());
}
setSize (600, pars.size()*25);
}
PaulstretchpluginAudioProcessorEditor::~PaulstretchpluginAudioProcessorEditor()
@ -28,12 +33,7 @@ PaulstretchpluginAudioProcessorEditor::~PaulstretchpluginAudioProcessorEditor()
//==============================================================================
void PaulstretchpluginAudioProcessorEditor::paint (Graphics& g)
{
// (Our component is opaque, so we must completely fill the background with a solid colour)
g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));
g.setColour (Colours::white);
g.setFont (15.0f);
g.drawFittedText ("Hello World!", getLocalBounds(), Justification::centred, 1);
g.fillAll(Colours::darkgrey);
}
void PaulstretchpluginAudioProcessorEditor::resized()