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.

77 lines
2.1KB

  1. /*
  2. * DISTRHO Cardinal Plugin
  3. * Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 3 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the LICENSE file.
  16. */
  17. /**
  18. * This file is an edited version of VCVRack's common.cpp
  19. * Copyright (C) 2016-2021 VCV.
  20. *
  21. * This program is free software: you can redistribute it and/or
  22. * modify it under the terms of the GNU General Public License as
  23. * published by the Free Software Foundation; either version 3 of
  24. * the License, or (at your option) any later version.
  25. */
  26. #include <common.hpp>
  27. #include <string.hpp>
  28. #ifdef NDEBUG
  29. # undef DEBUG
  30. #endif
  31. #include "DistrhoPluginUtils.hpp"
  32. #if defined ARCH_WIN
  33. #include <windows.h>
  34. FILE* fopen_u8(const char* filename, const char* mode) {
  35. if (std::strncmp(filename, "\\\\?\\", 4) == 0 && std::getenv("CARDINAL_UNDER_WINE") != nullptr)
  36. filename = "Z:\\dev\\null";
  37. return _wfopen(rack::string::UTF8toUTF16(filename).c_str(), rack::string::UTF8toUTF16(mode).c_str());
  38. }
  39. #endif
  40. namespace rack {
  41. const std::string APP_NAME = "Cardinal";
  42. const std::string APP_EDITION = getPluginFormatName();
  43. const std::string APP_EDITION_NAME = "Audio Plugin";
  44. const std::string APP_VERSION_MAJOR = "2";
  45. const std::string APP_VERSION = "2.1.2";
  46. #if defined ARCH_WIN
  47. const std::string APP_OS = "win";
  48. #elif defined ARCH_MAC
  49. const std::string APP_OS = "mac";
  50. #elif defined ARCH_LIN
  51. const std::string APP_OS = "lin";
  52. #else
  53. #error ARCH_LIN undefined
  54. #endif
  55. const std::string API_URL = "";
  56. Exception::Exception(const char* format, ...) {
  57. va_list args;
  58. va_start(args, format);
  59. msg = string::fV(format, args);
  60. va_end(args);
  61. }
  62. } // namespace rack