diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-09-18 18:04:25 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-09-28 17:42:11 -0400 |
commit | ebb43508f1ab75b7d7467e0e95cdd1c816cf3183 (patch) | |
tree | 7c94c5715fa54a70cc769292d8a27fac140e7323 /gtk2_ardour/editor_ops.cc | |
parent | 25011161e0a0ad77b77db787af35e24bdf10a040 (diff) |
add new action and loop marker menu item for setting up loop record
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index cc67e02ee8..c7a46d0ad3 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6266,6 +6266,60 @@ Editor::set_punch_from_selection () } void +Editor::set_punch_from_loop () +{ + if (_session == 0) { + return; + } + + Location* tll; + + if ((tll = transport_loop_location()) == 0) { + return; + } + + set_punch_range (tll->start(), tll->end(), _("set punch range from loop")); +} + +void +Editor::setup_loop_record () +{ + if (_session == 0) { + return; + } + + Location * looploc = _session->locations()->auto_loop_location(); + + if (!looploc) { + return; + } + + set_punch_range (looploc->start(), looploc->end(), _("setup loop recording")); + + Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch"); + + if (action) { + + Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action); + + if (!tact) { + return; + } + + /* drive the other two actions from this one */ + + Glib::RefPtr<Action> in_action = ActionManager::get_action ("Transport", "TogglePunchIn"); + Glib::RefPtr<Action> out_action = ActionManager::get_action ("Transport", "TogglePunchOut"); + + if (in_action && out_action) { + Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(in_action); + Glib::RefPtr<ToggleAction> toact = Glib::RefPtr<ToggleAction>::cast_dynamic(out_action); + tiact->set_active (true); + toact->set_active (true); + } + } +} +void Editor::set_session_extents_from_selection () { if (_session == 0) { |