make a pattern for notifying subscribers about VST state save/load. but it seems to run too early for Editor to benefit.
This commit is contained in:
@ -22,8 +22,9 @@ JuicySFAudioProcessorEditor::JuicySFAudioProcessorEditor (JuicySFAudioProcessor&
|
||||
// set resize limits for this plug-in
|
||||
setResizeLimits (400, 300, 800, 600);
|
||||
|
||||
setSize (p.getLastUIWidth(),
|
||||
p.getLastUIHeight());
|
||||
setSize (400, 300);
|
||||
|
||||
processor.subscribeToStateChanges(this);
|
||||
|
||||
midiKeyboard.setName ("MIDI Keyboard");
|
||||
|
||||
@ -39,6 +40,19 @@ JuicySFAudioProcessorEditor::JuicySFAudioProcessorEditor (JuicySFAudioProcessor&
|
||||
|
||||
JuicySFAudioProcessorEditor::~JuicySFAudioProcessorEditor()
|
||||
{
|
||||
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()));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
@ -81,9 +95,6 @@ void JuicySFAudioProcessorEditor::resized()
|
||||
// r3.removeFromTop(filePickerHeight);
|
||||
//
|
||||
// filePicker.setBounds(r3);
|
||||
|
||||
processor.setLastUIWidth(getWidth());
|
||||
processor.setLastUIHeight(getHeight());
|
||||
}
|
||||
|
||||
bool JuicySFAudioProcessorEditor::keyPressed(const KeyPress &key) {
|
||||
@ -119,4 +130,4 @@ bool JuicySFAudioProcessorEditor::keyStateChanged (bool isKeyDown) {
|
||||
// if (childComponent->keyStateChanged(isKeyDown)) return true;
|
||||
// }
|
||||
// return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user