From 90220998af4f9683d696b511a09b34034e799093 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 16 Jun 2015 08:44:03 -0400 Subject: add Record-Safe feature to libardour (from Nikolay Polyanovskii) --- libs/ardour/session_rtevents.cc | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'libs/ardour/session_rtevents.cc') diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc index 4bd7c2da9a..11d8319c0d 100644 --- a/libs/ardour/session_rtevents.cc +++ b/libs/ardour/session_rtevents.cc @@ -197,7 +197,7 @@ Session::set_record_enabled (boost::shared_ptr rl, bool yn, SessionEv */ for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if ((*i)->is_auditioner()) { + if ((*i)->is_auditioner() || (*i)->record_safe ()) { continue; } @@ -215,7 +215,7 @@ void Session::rt_set_record_enabled (boost::shared_ptr rl, bool yn, bool group_override) { for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { - if ((*i)->is_auditioner()) { + if ((*i)->is_auditioner() || (*i)->record_safe ()) { continue; } @@ -229,6 +229,32 @@ Session::rt_set_record_enabled (boost::shared_ptr rl, bool yn, bool g set_dirty (); } + +void +Session::set_record_safe (boost::shared_ptr rl, bool yn, SessionEvent::RTeventCallback after, bool group_override) +{ + set_record_enabled (rl, false, after, group_override); + queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_record_safe)); +} + +void +Session::rt_set_record_safe (boost::shared_ptr rl, bool yn, bool group_override) +{ + for (RouteList::iterator i = rl->begin (); i != rl->end (); ++i) { + if ((*i)->is_auditioner ()) { // REQUIRES REVIEW Can audiotioner be in Record Safe mode? + continue; + } + + boost::shared_ptr t; + + if ((t = boost::dynamic_pointer_cast(*i)) != 0) { + t->set_record_safe (yn, (group_override ? (void*) t->route_group () : (void *) this)); + } + } + + set_dirty (); +} + void Session::process_rtop (SessionEvent* ev) { -- cgit v1.2.3