Audio plugin host https://kx.studio/carla
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.

undo-history.h 875B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef RTOSC_UNDO_H
  2. #define RTOSC_UNDO_H
  3. #include <functional>
  4. namespace rtosc
  5. {
  6. /**
  7. * Known event types:
  8. * /undo_change /path/location old-data new-data
  9. */
  10. class UndoHistory
  11. {
  12. //TODO think about the consequences of largish loads
  13. public:
  14. UndoHistory(void);
  15. ~UndoHistory(void);
  16. //Records any undoable event
  17. void recordEvent(const char *msg);
  18. //Prints out a history
  19. void showHistory(void) const;
  20. //Seek to another point in history relative to the current one
  21. //Negative values mean undo, positive values mean redo
  22. void seekHistory(int distance);
  23. unsigned getPos(void) const;
  24. const char *getHistory(int i) const;
  25. size_t size(void) const;
  26. void setCallback(std::function<void(const char*)> cb);
  27. private:
  28. class UndoHistoryImpl *impl;
  29. };
  30. };
  31. #endif