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.

42 lines
543B

  1. #pragma once
  2. #include "common.hpp"
  3. #include "math.hpp"
  4. #include "plugin/Model.hpp"
  5. #include <vector>
  6. namespace rack {
  7. namespace history {
  8. struct Action {
  9. virtual ~Action() {}
  10. virtual void undo() {}
  11. virtual void redo() {}
  12. };
  13. struct ModuleAdd : Action {
  14. Model *model;
  15. int moduleId;
  16. math::Vec pos;
  17. void undo() override;
  18. void redo() override;
  19. };
  20. struct State {
  21. std::vector<Action*> actions;
  22. int actionIndex = 0;
  23. ~State();
  24. void push(Action *action);
  25. void undo();
  26. void redo();
  27. };
  28. } // namespace history
  29. } // namespace rack