make file picker contruct using whatever soundfont path is available at construction-time. work towards giving Processor access to change its File on load.
This commit is contained in:
parent
191641ddd1
commit
114bb2f10a
@ -22,6 +22,11 @@ FilePicker::FilePicker(
|
||||
// faster (rounded edges introduce transparency)
|
||||
setOpaque (true);
|
||||
|
||||
const String& currentSoundFontAbsPath = fluidSynthModel->getCurrentSoundFontAbsPath();
|
||||
if (currentSoundFontAbsPath.isNotEmpty()) {
|
||||
fileChooser.setCurrentFile(File(currentSoundFontAbsPath), true, dontSendNotification);
|
||||
}
|
||||
|
||||
addAndMakeVisible (fileChooser);
|
||||
fileChooser.addListener (this);
|
||||
}
|
||||
|
@ -170,6 +170,10 @@ bool FluidSynthModel::shouldLoadFont(const String &absPath) {
|
||||
void FluidSynthModel::Listener::fontChanged(FluidSynthModel * model, const String &absPath) {
|
||||
}
|
||||
|
||||
const String& FluidSynthModel::getCurrentSoundFontAbsPath() {
|
||||
return currentSoundFontAbsPath;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
void FluidSynthModel::addListener (FluidSynthModel::Listener* const newListener)
|
||||
{
|
||||
|
@ -56,6 +56,8 @@ public:
|
||||
*/
|
||||
void removeListener (Listener* listener);
|
||||
|
||||
const String& getCurrentSoundFontAbsPath();
|
||||
|
||||
private:
|
||||
SharesParams& sharesParams;
|
||||
|
||||
|
@ -134,3 +134,7 @@ bool JuicySFAudioProcessorEditor::keyStateChanged (bool isKeyDown) {
|
||||
// }
|
||||
// return false;
|
||||
}
|
||||
|
||||
const FilePicker& JuicySFAudioProcessorEditor::getFilePicker() {
|
||||
|
||||
}
|
@ -37,6 +37,8 @@ public:
|
||||
// void getStateInformation (XmlElement& xml) override;
|
||||
// void setStateInformation (XmlElement* xmlState) override;
|
||||
|
||||
const FilePicker& getFilePicker();
|
||||
|
||||
private:
|
||||
// This reference is provided as a quick way for your editor to
|
||||
// access the processor object that created it.
|
||||
|
@ -242,6 +242,11 @@ void JuicySFAudioProcessor::setStateInformation (const void* data, int sizeInByt
|
||||
if (editor != nullptr) {
|
||||
editor->setSize(lastUIWidth, lastUIHeight);
|
||||
}
|
||||
|
||||
// const String& currentSoundFontAbsPath = fluidSynthModel->getCurrentSoundFontAbsPath();
|
||||
// if (currentSoundFontAbsPath.isNotEmpty()) {
|
||||
// fileChooser.setCurrentFile(File(currentSoundFontAbsPath), true, dontSendNotification);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user