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

123456789101112131415161718192021222324252627282930313233343536
  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. //Records any undoable event
  16. void recordEvent(const char *msg);
  17. //Prints out a history
  18. void showHistory(void) const;
  19. //Seek to another point in history relative to the current one
  20. //Negative values mean undo, positive values mean redo
  21. void seekHistory(int distance);
  22. unsigned getPos(void) const;
  23. const char *getHistory(int i) const;
  24. size_t size(void) const;
  25. void setCallback(std::function<void(const char*)> cb);
  26. private:
  27. class UndoHistoryImpl *impl;
  28. };
  29. };
  30. #endif