Update Fundamental and Rack

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2021-12-18 20:05:40 +00:00
parent 3943e4c1e9
commit fd1de47874
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
6 changed files with 45 additions and 32 deletions

View file

@ -30,6 +30,7 @@
#include "AsyncDialog.hpp"
#include "PluginContext.hpp"
#include <asset.hpp>
#include <context.hpp>
#include <history.hpp>
#include <patch.hpp>
@ -117,6 +118,30 @@ void loadPathDialog(const std::string& path)
#endif
}
void loadSelectionDialog()
{
app::RackWidget* const w = APP->scene->rack;
std::string selectionDir = asset::user("selections");
system::createDirectories(selectionDir);
async_dialog_filebrowser(false, selectionDir.c_str(), "Import selection", [w](char* pathC) {
if (!pathC) {
// No path selected
return;
}
try {
w->loadSelection(pathC);
}
catch (Exception& e) {
async_dialog_message(e.what());
}
std::free(pathC);
});
}
void loadTemplateDialog()
{
#ifndef HEADLESS