copy JUCE demo plugin more closely. worry about coupling later; for now get ownership in right place. update lastUIW/H on resize.
This commit is contained in:
@ -22,9 +22,9 @@ JuicySFAudioProcessorEditor::JuicySFAudioProcessorEditor (JuicySFAudioProcessor&
|
||||
// set resize limits for this plug-in
|
||||
setResizeLimits (400, 300, 800, 600);
|
||||
|
||||
setSize (400, 300);
|
||||
setSize (p.lastUIWidth, p.lastUIHeight);
|
||||
|
||||
processor.subscribeToStateChanges(this);
|
||||
// processor.subscribeToStateChanges(this);
|
||||
|
||||
midiKeyboard.setName ("MIDI Keyboard");
|
||||
|
||||
@ -40,20 +40,20 @@ JuicySFAudioProcessorEditor::JuicySFAudioProcessorEditor (JuicySFAudioProcessor&
|
||||
|
||||
JuicySFAudioProcessorEditor::~JuicySFAudioProcessorEditor()
|
||||
{
|
||||
processor.unsubscribeFromStateChanges(this);
|
||||
// processor.unsubscribeFromStateChanges(this);
|
||||
}
|
||||
|
||||
void JuicySFAudioProcessorEditor::getStateInformation (XmlElement& xml) {
|
||||
// save
|
||||
xml.setAttribute ("uiWidth", getWidth());
|
||||
xml.setAttribute ("uiHeight", getHeight());
|
||||
}
|
||||
|
||||
void JuicySFAudioProcessorEditor::setStateInformation (XmlElement* xmlState) {
|
||||
// load
|
||||
setSize (xmlState->getIntAttribute ("uiWidth", getWidth()),
|
||||
xmlState->getIntAttribute ("uiHeight", getHeight()));
|
||||
}
|
||||
//void JuicySFAudioProcessorEditor::getStateInformation (XmlElement& xml) {
|
||||
// // save
|
||||
// xml.setAttribute ("uiWidth", getWidth());
|
||||
// xml.setAttribute ("uiHeight", getHeight());
|
||||
//}
|
||||
//
|
||||
//void JuicySFAudioProcessorEditor::setStateInformation (XmlElement* xmlState) {
|
||||
// // load
|
||||
// setSize (xmlState->getIntAttribute ("uiWidth", getWidth()),
|
||||
// xmlState->getIntAttribute ("uiHeight", getHeight()));
|
||||
//}
|
||||
|
||||
//==============================================================================
|
||||
void JuicySFAudioProcessorEditor::paint (Graphics& g)
|
||||
@ -85,6 +85,9 @@ void JuicySFAudioProcessorEditor::resized()
|
||||
midiKeyboard.setBounds (r.removeFromBottom (pianoHeight).reduced(padding, 0));
|
||||
tablesComponent.setBounds(r.reduced(0, padding));
|
||||
|
||||
processor.lastUIWidth = getWidth();
|
||||
processor.lastUIHeight = getHeight();
|
||||
|
||||
// Rectangle<int> r2 (getLocalBounds());
|
||||
// r2.reduce(0, padding);
|
||||
// r2.removeFromBottom(pianoHeight);
|
||||
|
||||
Reference in New Issue
Block a user