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:
@ -22,6 +22,11 @@ FilePicker::FilePicker(
|
|||||||
// faster (rounded edges introduce transparency)
|
// faster (rounded edges introduce transparency)
|
||||||
setOpaque (true);
|
setOpaque (true);
|
||||||
|
|
||||||
|
const String& currentSoundFontAbsPath = fluidSynthModel->getCurrentSoundFontAbsPath();
|
||||||
|
if (currentSoundFontAbsPath.isNotEmpty()) {
|
||||||
|
fileChooser.setCurrentFile(File(currentSoundFontAbsPath), true, dontSendNotification);
|
||||||
|
}
|
||||||
|
|
||||||
addAndMakeVisible (fileChooser);
|
addAndMakeVisible (fileChooser);
|
||||||
fileChooser.addListener (this);
|
fileChooser.addListener (this);
|
||||||
}
|
}
|
||||||
|
@ -170,6 +170,10 @@ bool FluidSynthModel::shouldLoadFont(const String &absPath) {
|
|||||||
void FluidSynthModel::Listener::fontChanged(FluidSynthModel * model, 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)
|
void FluidSynthModel::addListener (FluidSynthModel::Listener* const newListener)
|
||||||
{
|
{
|
||||||
|
@ -56,6 +56,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
void removeListener (Listener* listener);
|
void removeListener (Listener* listener);
|
||||||
|
|
||||||
|
const String& getCurrentSoundFontAbsPath();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SharesParams& sharesParams;
|
SharesParams& sharesParams;
|
||||||
|
|
||||||
|
@ -134,3 +134,7 @@ bool JuicySFAudioProcessorEditor::keyStateChanged (bool isKeyDown) {
|
|||||||
// }
|
// }
|
||||||
// return false;
|
// return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const FilePicker& JuicySFAudioProcessorEditor::getFilePicker() {
|
||||||
|
|
||||||
|
}
|
@ -37,6 +37,8 @@ public:
|
|||||||
// void getStateInformation (XmlElement& xml) override;
|
// void getStateInformation (XmlElement& xml) override;
|
||||||
// void setStateInformation (XmlElement* xmlState) override;
|
// void setStateInformation (XmlElement* xmlState) override;
|
||||||
|
|
||||||
|
const FilePicker& getFilePicker();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// This reference is provided as a quick way for your editor to
|
// This reference is provided as a quick way for your editor to
|
||||||
// access the processor object that created it.
|
// access the processor object that created it.
|
||||||
|
@ -242,6 +242,11 @@ void JuicySFAudioProcessor::setStateInformation (const void* data, int sizeInByt
|
|||||||
if (editor != nullptr) {
|
if (editor != nullptr) {
|
||||||
editor->setSize(lastUIWidth, lastUIHeight);
|
editor->setSize(lastUIWidth, lastUIHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// const String& currentSoundFontAbsPath = fluidSynthModel->getCurrentSoundFontAbsPath();
|
||||||
|
// if (currentSoundFontAbsPath.isNotEmpty()) {
|
||||||
|
// fileChooser.setCurrentFile(File(currentSoundFontAbsPath), true, dontSendNotification);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user