Cleanup and credits
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
5a652907c7
commit
b6ac2766dc
2 changed files with 54 additions and 17 deletions
|
@ -15,6 +15,16 @@
|
|||
* For a full copy of the GNU General Public License see the LICENSE file.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file is partially based on VCVRack's patch.cpp
|
||||
* Copyright (C) 2016-2021 VCV.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include "CardinalCommon.hpp"
|
||||
|
||||
#include "AsyncDialog.hpp"
|
||||
|
@ -42,31 +52,31 @@ namespace patchUtils
|
|||
|
||||
static void promptClear(const char* const message, const std::function<void()> action)
|
||||
{
|
||||
if (APP->history->isSaved() || APP->scene->rack->hasModules())
|
||||
return action();
|
||||
if (APP->history->isSaved() || APP->scene->rack->hasModules())
|
||||
return action();
|
||||
|
||||
asyncDialog::create(message, action);
|
||||
asyncDialog::create(message, action);
|
||||
}
|
||||
|
||||
static std::string homeDir()
|
||||
{
|
||||
#ifdef ARCH_WIN
|
||||
if (const char* const userprofile = getenv("USERPROFILE"))
|
||||
{
|
||||
return userprofile;
|
||||
}
|
||||
else if (const char* const homedrive = getenv("HOMEDRIVE"))
|
||||
{
|
||||
if (const char* const homepath = getenv("HOMEPATH"))
|
||||
return system::join(homedrive, homepath);
|
||||
}
|
||||
if (const char* const userprofile = getenv("USERPROFILE"))
|
||||
{
|
||||
return userprofile;
|
||||
}
|
||||
else if (const char* const homedrive = getenv("HOMEDRIVE"))
|
||||
{
|
||||
if (const char* const homepath = getenv("HOMEPATH"))
|
||||
return system::join(homedrive, homepath);
|
||||
}
|
||||
#else
|
||||
if (const char* const home = getenv("HOME"))
|
||||
return home;
|
||||
else if (struct passwd* const pwd = getpwuid(getuid()))
|
||||
return pwd->pw_dir;
|
||||
if (const char* const home = getenv("HOME"))
|
||||
return home;
|
||||
else if (struct passwd* const pwd = getpwuid(getuid()))
|
||||
return pwd->pw_dir;
|
||||
#endif
|
||||
return {};
|
||||
return {};
|
||||
}
|
||||
|
||||
using namespace rack;
|
||||
|
|
|
@ -1,3 +1,30 @@
|
|||
/*
|
||||
* DISTRHO Cardinal Plugin
|
||||
* Copyright (C) 2021 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
|
||||
* published by the Free Software Foundation; either version 3 of
|
||||
* the License, or any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* For a full copy of the GNU General Public License see the LICENSE file.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file is an edited version of VCVRack's Scene.cpp
|
||||
* Copyright (C) 2016-2021 VCV.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <thread>
|
||||
|
||||
#include <app/Scene.hpp>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue