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.

40 lines
801B

  1. #pragma once
  2. #include <common.hpp>
  3. #include <jansson.h>
  4. namespace rack {
  5. struct PatchManager {
  6. /** The currently loaded patch file path */
  7. std::string path;
  8. /** Enables certain compatibility behavior based on the value */
  9. int legacy;
  10. std::string warningLog;
  11. PatchManager();
  12. ~PatchManager();
  13. void init(std::string path);
  14. void reset();
  15. void resetDialog();
  16. void save(std::string path);
  17. void saveDialog();
  18. void saveAsDialog();
  19. void saveTemplateDialog();
  20. bool load(std::string path);
  21. void loadDialog();
  22. void loadPathDialog(std::string path);
  23. /** If `lastPath` is defined, ask the user to reload it */
  24. void revertDialog();
  25. /** Disconnects all cables */
  26. void disconnectDialog();
  27. json_t* toJson();
  28. void fromJson(json_t* rootJ);
  29. bool isLegacy(int level);
  30. };
  31. } // namespace rack