do not allow undo/redo while actively recording
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 17 Aug 2016 23:21:45 +0000 (19:21 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 17 Aug 2016 23:22:26 +0000 (19:22 -0400)
libs/ardour/ardour/session.h
libs/ardour/session_state.cc

index a1e094a7a443bccd47674a5b220448869c91d8ca..535317c407c030d076e1004907cc659af6fb27d7 100644 (file)
@@ -874,13 +874,11 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        /** Undo some transactions.
         * @param n Number of transactions to undo.
         */
-       void undo (uint32_t n) {
-               _history.undo (n);
-       }
-
-       void redo (uint32_t n) {
-               _history.redo (n);
-       }
+       void undo (uint32_t n);
+       /** Redo some transactions.
+        * @param n Number of transactions to undo.
+        */
+       void redo (uint32_t n);
 
        UndoHistory& history() { return _history; }
 
index 76cf2d375599dfda5a8b2bddcfe9ab6a155b5370..41d6d519795efbe04fc39d17e211dc7d52372754 100644 (file)
@@ -4916,3 +4916,23 @@ Session::save_as (SaveAs& saveas)
 
        return 0;
 }
+
+void
+Session::undo (uint32_t n)
+{
+       if (actively_recording()) {
+               return;
+       }
+
+       _history.undo (n);
+}
+
+void
+Session::redo (uint32_t n)
+{
+       if (actively_recording()) {
+               return;
+       }
+
+       _history.redo (n);
+}