summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-07 21:37:35 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-07 21:37:35 +0000
commit9686f8097d45c306168d1a5220d9c8bf225edb8c (patch)
tree274d7f7d8a549f96a5459d9be257581980906be3 /gtk2_ardour
parentdc86434283718b7c4a4ed6af52a950e6cfc5e86f (diff)
first pass at end-to-end RT operation request (GUI->session->RT thread->GUI), just for rec-enable
git-svn-id: svn://localhost/ardour2/branches/3.0@6324 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/route_ui.cc29
-rw-r--r--gtk2_ardour/route_ui.h4
2 files changed, 25 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.
diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h
index b62b146735..e71864ab20 100644
--- a/gtk2_ardour/route_ui.h
+++ b/gtk2_ardour/route_ui.h
@@ -25,6 +25,8 @@
#include "pbd/xml++.h"
#include "ardour/ardour.h"
#include "ardour/mute_master.h"
+#include "ardour/session_event.h"
+#include "ardour/session.h"
#include "ardour/route.h"
#include "ardour/track.h"
@@ -209,6 +211,8 @@ class RouteUI : public virtual AxisView
void check_rec_enable_sensitivity ();
void parameter_changed (std::string const &);
void relabel_solo_button ();
+
+ void post_rec_cleanup (ARDOUR::SessionEvent* ev, UndoTransaction* undo, ARDOUR::Session::GlobalRecordEnableStateCommand*);
};
#endif /* __ardour_route_ui__ */