HELP: Setting up Plugin Editor with custom JUCER dialog


#1

[code]/*

This file was auto-generated by the Introjucer!

It contains the basic startup code for a Juce application.

==============================================================================
*/

#include “PluginProcessor.h”
#include “PluginEditor.h”
#include “NewJucerComponent.h”

//==============================================================================
JlethalAudioProcessorEditor::JlethalAudioProcessorEditor (JlethalAudioProcessor* ownerFilter)
: AudioProcessorEditor (ownerFilter), DialogComponent(0)
{
setSize(860, 735);

DialogComponent = new NewJucerComponent();
addAndMakeVisible(DialogComponent);

}

JlethalAudioProcessorEditor::~JlethalAudioProcessorEditor()
{
deleteAndZero(DialogComponent);
}

//==============================================================================
void JlethalAudioProcessorEditor::paint (Graphics& g)
{
/g.fillAll (Colours::white);
g.setColour (Colours::black);
g.setFont (15.0f);
g.drawFittedText (“Hello World!”,
0, 0, getWidth(), getHeight(),
Justification::centred, 1);
/
}
[/code]

Is that right? It seems every time the window is closed and re-opened all of the dial values reset as if the synth was deleted and re-added.


#2

An AudioProcessorEditor is destroyed each time you close it. If you want your controls to be in the same position after re-opening the editor you will need to query their current state when your editor launches. Take a look at AudioProcessorEditor::getAudioProcessor() and AudioProcessor::getParameter()