GUI does an even stronger check on no undo/redo while recording
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 17 Aug 2016 23:22:15 +0000 (19:22 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 17 Aug 2016 23:22:26 +0000 (19:22 -0400)
gtk2_ardour/editor_ops.cc

index e5d762332e9fd72828d5a9f099d365042a55427f..f7bbf2a16666d68d05b06d67d4fee6196156ad79 100644 (file)
@@ -119,6 +119,13 @@ using Gtkmm2ext::Keyboard;
 void
 Editor::undo (uint32_t n)
 {
+       if (_session && _session->actively_recording()) {
+               /* no undo allowed while recording. Session will check also,
+                  but we don't even want to get to that.
+               */
+               return;
+       }
+
        if (_drags->active ()) {
                _drags->abort ();
        }
@@ -136,12 +143,19 @@ Editor::undo (uint32_t n)
 void
 Editor::redo (uint32_t n)
 {
+       if (_session && _session->actively_recording()) {
+               /* no redo allowed while recording. Session will check also,
+                  but we don't even want to get to that.
+               */
+               return;
+       }
+
        if (_drags->active ()) {
                _drags->abort ();
        }
 
        if (_session) {
-               _session->redo (n);
+       _session->redo (n);
                if (_session->redo_depth() == 0) {
                        redo_action->set_sensitive(false);
                }