commit f74e2e42de7b1ed02355453ca80269b506b3a6d5
parent cd11809f87f9886fbe196399313c6de9c1efdf2a
Author: Steven Atkinson <[email protected]>
Date: Sun, 11 Jun 2023 17:01:04 -0700
Formatting
Diffstat:
2 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/NeuralAmpModeler/NeuralAmpModeler.cpp b/NeuralAmpModeler/NeuralAmpModeler.cpp
@@ -223,13 +223,13 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
}
};
+ pGraphics->AttachControl(new NAMFileBrowserControl(modelArea, kMsgTagClearModel, "Select model directory...", "nam",
+ loadModelCompletionHandler, style, fileSVG, closeButtonSVG,
+ leftArrowSVG, rightArrowSVG),
+ kCtrlTagModelFileBrowser);
pGraphics->AttachControl(
- new NAMFileBrowserControl(modelArea, kMsgTagClearModel, "Select model directory...", "nam", loadModelCompletionHandler,
- style, fileSVG, closeButtonSVG, leftArrowSVG, rightArrowSVG),
- kCtrlTagModelFileBrowser);
- pGraphics->AttachControl(
- new NAMFileBrowserControl(irArea, kMsgTagClearIR, "Select IR directory...", "wav", loadIRCompletionHandler, style, fileSVG,
- closeButtonSVG, leftArrowSVG, rightArrowSVG),
+ new NAMFileBrowserControl(irArea, kMsgTagClearIR, "Select IR directory...", "wav", loadIRCompletionHandler, style,
+ fileSVG, closeButtonSVG, leftArrowSVG, rightArrowSVG),
kCtrlTagIRFileBrowser);
// TODO all these magic numbers
diff --git a/NeuralAmpModeler/NeuralAmpModelerControls.h b/NeuralAmpModeler/NeuralAmpModelerControls.h
@@ -203,17 +203,16 @@ public:
WDL_String fileName;
WDL_String path;
GetSelectedFileDirectory(path);
- pCaller->GetUI()->PromptForDirectory(
- path, [&](const WDL_String& fileName, const WDL_String& path) {
- if (path.GetLength())
- {
- ClearPathList();
- AddPath(path.Get(), "");
- SetupMenu();
- SelectFirstFile();
- LoadFileAtCurrentIndex();
- }
- });
+ pCaller->GetUI()->PromptForDirectory(path, [&](const WDL_String& fileName, const WDL_String& path) {
+ if (path.GetLength())
+ {
+ ClearPathList();
+ AddPath(path.Get(), "");
+ SetupMenu();
+ SelectFirstFile();
+ LoadFileAtCurrentIndex();
+ }
+ });
};
auto clearFileFunc = [&](IControl* pCaller) {
@@ -299,17 +298,15 @@ public:
}
private:
- void SelectFirstFile()
+ void SelectFirstFile() { mSelectedIndex = mFiles.GetSize() ? 0 : -1; }
+
+ void GetSelectedFileDirectory(WDL_String& path)
{
- mSelectedIndex = mFiles.GetSize() ? 0 : -1;
- }
-
- void GetSelectedFileDirectory(WDL_String& path) {
GetSelectedFile(path);
path.remove_filepart();
return;
}
-
+
WDL_String mDefaultLabelStr;
IFileDialogCompletionHandlerFunc mCompletionHandlerFunc;
NAMFileNameControl* mFileNameControl = nullptr;