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.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. #include <string>
  18. #pragma once
  19. #ifdef HAVE_LIBLO
  20. // # define REMOTE_HOST "localhost"
  21. # define REMOTE_HOST "192.168.51.1"
  22. # define REMOTE_HOST_PORT "2228"
  23. #endif
  24. #ifdef DISTRHO_OS_WASM
  25. # ifdef STATIC_BUILD
  26. # define CARDINAL_WASM_WELCOME_TEMPLATE_FILENAME "welcome-wasm-mini.vcv"
  27. # else
  28. # define CARDINAL_WASM_WELCOME_TEMPLATE_FILENAME "welcome-wasm.vcv"
  29. # endif
  30. #endif
  31. extern const std::string CARDINAL_VERSION;
  32. namespace rack {
  33. namespace ui {
  34. struct Menu;
  35. }
  36. namespace window {
  37. void generateScreenshot();
  38. }
  39. bool isStandalone();
  40. #ifdef ARCH_WIN
  41. enum SpecialPath {
  42. kSpecialPathUserProfile,
  43. kSpecialPathCommonProgramFiles,
  44. kSpecialPathProgramFiles,
  45. kSpecialPathAppData,
  46. };
  47. std::string getSpecialPath(SpecialPath type);
  48. #endif
  49. #ifdef DISTRHO_OS_WASM
  50. extern char* patchFromURL;
  51. extern char* patchRemoteURL;
  52. extern char* patchStorageSlug;
  53. #endif
  54. } // namespace rack
  55. namespace patchUtils {
  56. void loadDialog();
  57. void loadPathDialog(const std::string& path, bool asTemplate = false);
  58. void loadSelectionDialog();
  59. void loadTemplateDialog();
  60. void revertDialog();
  61. void saveDialog(const std::string& path);
  62. void saveAsDialog();
  63. void saveAsDialogUncompressed();
  64. void appendSelectionContextMenu(rack::ui::Menu* menu);
  65. void openBrowser(const std::string& url);
  66. bool connectToRemote();
  67. bool isRemoteConnected();
  68. bool isRemoteAutoDeployed();
  69. void setRemoteAutoDeploy(bool autoDeploy);
  70. void deployToRemote();
  71. void sendScreenshotToRemote(const char* screenshot);
  72. } // namespace patchUtils