summaryrefslogtreecommitdiff
path: root/libs/ardour/session_rtevents.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-06-16 08:44:03 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-06-16 08:44:03 -0400
commit90220998af4f9683d696b511a09b34034e799093 (patch)
treee974251993f9bf8b33c26bdeb117a8759b476d77 /libs/ardour/session_rtevents.cc
parentd65f03d07455c4ea38084af71a38c383bd2b3e19 (diff)
add Record-Safe feature to libardour (from Nikolay Polyanovskii)
Diffstat (limited to 'libs/ardour/session_rtevents.cc')
-rw-r--r--libs/ardour/session_rtevents.cc30
1 files changed, 28 insertions, 2 deletions
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<RouteList> 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<RouteList> 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<RouteList> rl, bool yn, bool g
set_dirty ();
}
+
+void
+Session::set_record_safe (boost::shared_ptr<RouteList> 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<RouteList> 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<Track> t;
+
+ if ((t = boost::dynamic_pointer_cast<Track>(*i)) != 0) {
+ t->set_record_safe (yn, (group_override ? (void*) t->route_group () : (void *) this));
+ }
+ }
+
+ set_dirty ();
+}
+
void
Session::process_rtop (SessionEvent* ev)
{