You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.7KB

  1. --- ../Rack/src/plugin/Model.cpp 2021-10-17 13:57:23.257633662 +0100
  2. +++ Model.cpp 2022-04-27 17:55:57.362107553 +0100
  3. @@ -1,3 +1,30 @@
  4. +/*
  5. + * DISTRHO Cardinal Plugin
  6. + * Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
  7. + *
  8. + * This program is free software; you can redistribute it and/or
  9. + * modify it under the terms of the GNU General Public License as
  10. + * published by the Free Software Foundation; either version 3 of
  11. + * the License, or any later version.
  12. + *
  13. + * This program is distributed in the hope that it will be useful,
  14. + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. + * GNU General Public License for more details.
  17. + *
  18. + * For a full copy of the GNU General Public License see the LICENSE file.
  19. + */
  20. +
  21. +/**
  22. + * This file is an edited version of VCVRack's plugin/Model.cpp
  23. + * Copyright (C) 2016-2021 VCV.
  24. + *
  25. + * This program is free software: you can redistribute it and/or
  26. + * modify it under the terms of the GNU General Public License as
  27. + * published by the Free Software Foundation; either version 3 of
  28. + * the License, or (at your option) any later version.
  29. + */
  30. +
  31. #include <algorithm>
  32. #include <plugin/Model.hpp>
  33. @@ -17,7 +44,7 @@
  34. void Model::fromJson(json_t* rootJ) {
  35. - assert(plugin);
  36. + DISTRHO_SAFE_ASSERT_RETURN(plugin != nullptr,);
  37. json_t* nameJ = json_object_get(rootJ, "name");
  38. if (nameJ)
  39. @@ -54,11 +81,6 @@
  40. if (manualUrlJ)
  41. manualUrl = json_string_value(manualUrlJ);
  42. - // modularGridUrl
  43. - json_t* modularGridUrlJ = json_object_get(rootJ, "modularGridUrl");
  44. - if (modularGridUrlJ)
  45. - modularGridUrl = json_string_value(modularGridUrlJ);
  46. -
  47. // hidden
  48. json_t* hiddenJ = json_object_get(rootJ, "hidden");
  49. // Use `disabled` as an alias which was deprecated in Rack 2.0
  50. @@ -73,7 +95,7 @@
  51. std::string Model::getFullName() {
  52. - assert(plugin);
  53. + DISTRHO_SAFE_ASSERT_RETURN(plugin, {});
  54. return plugin->getBrand() + " " + name;
  55. }
  56. @@ -132,18 +154,6 @@
  57. menu->addChild(new ui::MenuSeparator);
  58. - // VCV Library page
  59. - menu->addChild(createMenuItem("VCV Library page", "", [=]() {
  60. - system::openBrowser("https://library.vcvrack.com/" + plugin->slug + "/" + slug);
  61. - }));
  62. -
  63. - // modularGridUrl
  64. - if (modularGridUrl != "") {
  65. - menu->addChild(createMenuItem("ModularGrid page", "", [=]() {
  66. - system::openBrowser(modularGridUrl);
  67. - }));
  68. - }
  69. -
  70. // manual
  71. std::string manualUrl = getManualUrl();
  72. if (manualUrl != "") {
  73. @@ -173,13 +183,6 @@
  74. }));
  75. }
  76. - // plugin folder
  77. - if (plugin->path != "") {
  78. - menu->addChild(createMenuItem("Open plugin folder", "", [=]() {
  79. - system::openDirectory(plugin->path);
  80. - }));
  81. - }
  82. -
  83. // Favorite
  84. std::string favoriteRightText = inBrowser ? (RACK_MOD_CTRL_NAME "+click") : "";
  85. if (isFavorite())