summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/route_ui.cc')
-rw-r--r--gtk2_ardour/route_ui.cc29
1 files changed, 21 insertions, 8 deletions
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index fe2adff449..a8e97f081f 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -452,6 +452,22 @@ RouteUI::solo_release(GdkEventButton*)
return true;
}
+void
+RouteUI::post_rec_cleanup (SessionEvent* ev, UndoTransaction* undo, Session::GlobalRecordEnableStateCommand* cmd)
+{
+ ENSURE_GUI_THREAD (bind (mem_fun (*this, &RouteUI::post_rec_cleanup), ev, undo, cmd));
+
+ delete ev->routes;
+ delete ev;
+
+ check_rec_enable_sensitivity ();
+
+ cmd->mark();
+ undo->add_command(cmd);
+
+ _session.finish_reversible_command (*undo);
+}
+
bool
RouteUI::rec_enable_press(GdkEventButton* ev)
{
@@ -474,20 +490,17 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
- _session.begin_reversible_command (_("rec-enable change"));
+ UndoTransaction* undo = _session.start_reversible_command (_("rec-enable change"));
Session::GlobalRecordEnableStateCommand *cmd = new Session::GlobalRecordEnableStateCommand(_session, this);
+ sigc::slot<void,SessionEvent*> callback = bind (sigc::mem_fun (*this, &RouteUI::post_rec_cleanup), undo, cmd);
+
if (rec_enable_button->get_active()) {
- _session.record_disenable_all ();
+ _session.record_disenable_all (callback);
} else {
- _session.record_enable_all ();
- check_rec_enable_sensitivity ();
+ _session.record_enable_all (callback);
}
- cmd->mark();
- _session.add_command(cmd);
- _session.commit_reversible_command ();
-
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
/* Primary-button1 applies change to the mix group.