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.

89 lines
2.6KB

  1. --- ../Rack/src/common.cpp 2022-09-21 20:25:53.591040280 +0100
  2. +++ common.cpp 2022-09-21 20:18:50.294557597 +0100
  3. @@ -1,33 +1,77 @@
  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 common.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 <common.hpp>
  32. #include <string.hpp>
  33. +#ifdef NDEBUG
  34. +# undef DEBUG
  35. +#endif
  36. +
  37. +#include "DistrhoPluginUtils.hpp"
  38. -#if defined ARCH_WIN
  39. +#if defined(ARCH_WIN)
  40. #include <windows.h>
  41. FILE* fopen_u8(const char* filename, const char* mode) {
  42. + if (std::strncmp(filename, "\\\\?\\", 4) == 0 && std::getenv("CARDINAL_UNDER_WINE") != nullptr)
  43. + filename = "Z:\\dev\\null";
  44. return _wfopen(rack::string::UTF8toUTF16(filename).c_str(), rack::string::UTF8toUTF16(mode).c_str());
  45. }
  46. +#elif defined(DISTRHO_OS_WASM)
  47. +#include <sys/stat.h>
  48. +#undef fopen
  49. +
  50. +FILE* fopen_wasm(const char* filename, const char* mode) {
  51. + chmod(filename, 0777);
  52. + return std::fopen(filename, mode);
  53. +}
  54. +
  55. #endif
  56. namespace rack {
  57. -
  58. -const std::string APP_NAME = "VCV Rack";
  59. -const std::string APP_EDITION = "Free";
  60. -const std::string APP_EDITION_NAME = "Free";
  61. +const std::string APP_NAME = "Cardinal";
  62. +const std::string APP_EDITION = getPluginFormatName();
  63. +const std::string APP_EDITION_NAME = "Audio Plugin";
  64. const std::string APP_VERSION_MAJOR = "2";
  65. -const std::string APP_VERSION = TOSTRING(_APP_VERSION);
  66. +const std::string APP_VERSION = "2.1.2";
  67. #if defined ARCH_WIN
  68. const std::string APP_OS = "win";
  69. -#elif ARCH_MAC
  70. +#elif defined ARCH_MAC
  71. const std::string APP_OS = "mac";
  72. #elif defined ARCH_LIN
  73. const std::string APP_OS = "lin";
  74. +#else
  75. + #error ARCH_LIN undefined
  76. #endif
  77. -const std::string API_URL = "https://api.vcvrack.com";
  78. +const std::string API_URL = "";
  79. Exception::Exception(const char* format, ...) {