X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_rtevents.cc;h=745212abb4151dee946ed9f1a8f5f2ea69879c09;hb=22b07e0233a29d9633ffa825a79503befaf2e16e;hp=6328607eec7dcc6148c5920e84a29783da7fdb40;hpb=81506ea41c40ed9ce6a433550549e0e25f0fe1a3;p=ardour.git diff --git a/libs/ardour/session_rtevents.cc b/libs/ardour/session_rtevents.cc index 6328607eec..745212abb4 100644 --- a/libs/ardour/session_rtevents.cc +++ b/libs/ardour/session_rtevents.cc @@ -69,6 +69,10 @@ Session::rt_set_solo (boost::shared_ptr rl, bool yn, bool /* group_ov } set_dirty(); + /* XXX boost::shared_ptr goes out of scope here and is likley free()ed in RT context + * because boost's shared_ptr does reference counting and free/delete in the dtor. + * (this also applies to other rt_ methods here) + */ } void @@ -143,6 +147,12 @@ Session::rt_set_listen (boost::shared_ptr rl, bool yn, bool /*group_o void Session::set_mute (boost::shared_ptr rl, bool yn, SessionEvent::RTeventCallback after, bool group_override) { + /* Set superficial value of mute controls for automation. */ + for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) { + boost::shared_ptr mc = (*i)->mute_control(); + mc->set_superficial_value(yn); + } + queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_mute)); } @@ -191,7 +201,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; } @@ -209,7 +219,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; } @@ -223,6 +233,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) {