diff --git a/Source/LumatoneEditorState.cpp b/Source/LumatoneEditorState.cpp index a9fda4b..d6f3158 100644 --- a/Source/LumatoneEditorState.cpp +++ b/Source/LumatoneEditorState.cpp @@ -154,6 +154,11 @@ juce::File LumatoneEditorState::getUserPalettesDirectory() const return directory; } +juce::File LumatoneEditorState::getLastOpenedMappingsDirectory() const +{ + return recentFiles->getFile(0).getParentDirectory(); +} + void LumatoneEditorState::setHasChangesToSave(bool hasChangesToSaveIn) { hasChangesToSave = hasChangesToSaveIn; diff --git a/Source/LumatoneEditorState.h b/Source/LumatoneEditorState.h index 461c919..10ffaed 100644 --- a/Source/LumatoneEditorState.h +++ b/Source/LumatoneEditorState.h @@ -106,6 +106,8 @@ class LumatoneEditorState : public LumatoneApplicationState juce::File getUserMappingsDirectory() const; juce::File getUserPalettesDirectory() const; + juce::File getLastOpenedMappingsDirectory() const; + public: bool doSendChangesToDevice() const override; diff --git a/Source/Main.cpp b/Source/Main.cpp index 960398c..d05b718 100644 --- a/Source/Main.cpp +++ b/Source/Main.cpp @@ -391,7 +391,7 @@ bool TerpstraSysExApplication::perform(const InvocationInfo& info) bool TerpstraSysExApplication::openSysExMapping() { - fileChooser = std::make_unique("Open a Lumatone key mapping", state.getRecentFiles().getFile(0).getParentDirectory(), "*.ltn;*.tsx"); + fileChooser = std::make_unique("Open a Lumatone key mapping", state.getLastOpenedMappingsDirectory(), "*.ltn"); fileChooser->launchAsync(FileBrowserComponent::FileChooserFlags::canSelectFiles | FileBrowserComponent::FileChooserFlags::openMode, [&](const FileChooser& chooser) { @@ -417,7 +417,7 @@ bool TerpstraSysExApplication::saveSysExMapping(std::function saveFileCallback) { - fileChooser = std::make_unique("Lumatone Key Mapping Files", state.getRecentFiles().getFile(0).getParentDirectory(), "*.ltn"); + fileChooser = std::make_unique("Lumatone Key Mapping Files", state.getLastOpenedMappingsDirectory(), "*.ltn"); fileChooser->launchAsync(FileBrowserComponent::FileChooserFlags::saveMode | FileBrowserComponent::FileChooserFlags::warnAboutOverwriting, [this, saveFileCallback](const FileChooser& chooser) {