diff --git a/src/CardinalCommon.cpp b/src/CardinalCommon.cpp index a29ebf5..514015a 100644 --- a/src/CardinalCommon.cpp +++ b/src/CardinalCommon.cpp @@ -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 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; diff --git a/src/override/Scene.cpp b/src/override/Scene.cpp index 914499d..cd2d737 100644 --- a/src/override/Scene.cpp +++ b/src/override/Scene.cpp @@ -1,3 +1,30 @@ +/* + * DISTRHO Cardinal Plugin + * Copyright (C) 2021 Filipe Coelho + * + * 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 #include