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 811B

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