Allow usage of local user dir and config
I held on for as long as I could, but plugin host caching needs it Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
2823dcfe78
commit
e7bb99c3ce
13 changed files with 221 additions and 71 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* DISTRHO Cardinal Plugin
|
||||
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
|
||||
* Copyright (C) 2021-2023 Filipe Coelho <falktx@falktx.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
|
|
@ -127,20 +127,33 @@ struct FileButton : MenuButton {
|
|||
menu->box.pos = getAbsoluteOffset(math::Vec(0, box.size.y));
|
||||
|
||||
#ifndef DISTRHO_OS_WASM
|
||||
const char* const NewShortcut = RACK_MOD_CTRL_NAME "+N";
|
||||
constexpr const char* const NewShortcut = RACK_MOD_CTRL_NAME "+N";
|
||||
#else
|
||||
const char* const NewShortcut = "";
|
||||
constexpr const char* const NewShortcut = "";
|
||||
#endif
|
||||
menu->addChild(createMenuItem("New", NewShortcut, []() {
|
||||
patchUtils::loadTemplateDialog();
|
||||
patchUtils::loadTemplateDialog(false);
|
||||
}));
|
||||
|
||||
#if DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
|
||||
#ifndef DISTRHO_OS_WASM
|
||||
menu->addChild(createMenuItem("New (factory template)", "", []() {
|
||||
patchUtils::loadTemplateDialog(true);
|
||||
}));
|
||||
|
||||
menu->addChild(createMenuItem("Open / Import...", RACK_MOD_CTRL_NAME "+O", []() {
|
||||
patchUtils::loadDialog();
|
||||
}));
|
||||
|
||||
menu->addChild(createSubmenuItem("Open recent", "", [](ui::Menu* menu) {
|
||||
for (const std::string& path : settings::recentPatchPaths) {
|
||||
std::string name = system::getStem(path);
|
||||
menu->addChild(createMenuItem(name, "", [=]() {
|
||||
patchUtils::loadPathDialog(path, false);
|
||||
}));
|
||||
}
|
||||
}, settings::recentPatchPaths.empty()));
|
||||
|
||||
menu->addChild(createMenuItem("Save", RACK_MOD_CTRL_NAME "+S", []() {
|
||||
// NOTE: will do nothing if path is empty, intentionally
|
||||
patchUtils::saveDialog(APP->patch->path);
|
||||
|
|
@ -172,6 +185,10 @@ struct FileButton : MenuButton {
|
|||
patchUtils::revertDialog();
|
||||
}, APP->patch->path.empty()));
|
||||
|
||||
menu->addChild(createMenuItem("Overwrite template", "", []() {
|
||||
patchUtils::saveTemplateDialog();
|
||||
}));
|
||||
|
||||
#if defined(HAVE_LIBLO) || ! DISTRHO_PLUGIN_WANT_DIRECT_ACCESS
|
||||
#ifdef __MOD_DEVICES__
|
||||
#define REMOTE_NAME "MOD"
|
||||
|
|
@ -728,6 +745,12 @@ struct HelpButton : MenuButton {
|
|||
|
||||
menu->addChild(new ui::MenuSeparator);
|
||||
|
||||
menu->addChild(createMenuItem("Open user folder", "", [=]() {
|
||||
system::openDirectory(asset::user(""));
|
||||
}));
|
||||
|
||||
menu->addChild(new ui::MenuSeparator);
|
||||
|
||||
menu->addChild(createMenuLabel("Cardinal " + APP_EDITION + " " + CARDINAL_VERSION));
|
||||
menu->addChild(createMenuLabel("Rack " + APP_VERSION + " Compatible"));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ void Scene::onHoverKey(const HoverKeyEvent& e) {
|
|||
if (e.action == GLFW_PRESS || e.action == GLFW_REPEAT) {
|
||||
// DEBUG("key '%d '%c' scancode %d '%c' keyName '%s'", e.key, e.key, e.scancode, e.scancode, e.keyName.c_str());
|
||||
if (e.keyName == "n" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
|
||||
patchUtils::loadTemplateDialog();
|
||||
patchUtils::loadTemplateDialog(false);
|
||||
e.consume(this);
|
||||
}
|
||||
if (e.keyName == "q" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue