summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/editor.cc9
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_drag.cc1
-rw-r--r--gtk2_ardour/public_editor.h1
-rw-r--r--libs/ardour/ardour/session.h1
-rw-r--r--libs/ardour/session_state.cc11
6 files changed, 24 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 0cb58a8387..c8b3437662 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -3429,6 +3429,15 @@ Editor::begin_reversible_command (GQuark q)
}
void
+Editor::abort_reversible_command ()
+{
+ if (_session) {
+ before.clear();
+ _session->abort_reversible_command ();
+ }
+}
+
+void
Editor::commit_reversible_command ()
{
if (_session) {
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 5cf98fa0d9..c7d323576f 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -452,6 +452,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void redo_selection_op ();
void begin_reversible_command (std::string cmd_name);
void begin_reversible_command (GQuark);
+ void abort_reversible_command ();
void commit_reversible_command ();
DragManager* drags () const {
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 79f8654ff4..1f13c68d74 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -108,6 +108,7 @@ DragManager::abort ()
}
_drags.clear ();
+ _editor->abort_reversible_command();
_ending = false;
}
diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h
index ff7cae35f2..e580ac0ec3 100644
--- a/gtk2_ardour/public_editor.h
+++ b/gtk2_ardour/public_editor.h
@@ -396,6 +396,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
virtual void commit_reversible_selection_op () = 0;
virtual void begin_reversible_command (std::string cmd_name) = 0;
virtual void begin_reversible_command (GQuark) = 0;
+ virtual void abort_reversible_command () = 0;
virtual void commit_reversible_command () = 0;
virtual MouseCursors const * cursors () const = 0;
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index d1b64f2e5c..552c8e203a 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -747,6 +747,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void begin_reversible_command (const std::string& cmd_name);
void begin_reversible_command (GQuark);
+ void abort_reversible_command ();
void commit_reversible_command (Command* cmd = 0);
void add_command (Command *const cmd) {
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index c626e792ea..7aac354c06 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -2434,6 +2434,17 @@ Session::begin_reversible_command (GQuark q)
}
void
+Session::abort_reversible_command ()
+{
+ if (_current_trans != 0) {
+ _current_trans->clear();
+ delete _current_trans;
+ _current_trans = 0;
+ _current_trans_quarks.clear();
+ }
+}
+
+void
Session::commit_reversible_command (Command *cmd)
{
assert (_current_trans);