}
void
-Session::set_solo (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override)
+Session::clear_all_solo_state (boost::shared_ptr<RouteList> rl)
{
- queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_solo));
+ queue_event (get_rt_event (rl, false, rt_cleanup, false, &Session::rt_clear_all_solo_state));
}
void
-Session::rt_set_solo (boost::shared_ptr<RouteList> rl, bool yn, bool /* group_override */)
+Session::rt_clear_all_solo_state (boost::shared_ptr<RouteList> rl, bool /* yn */, bool /* group_override */)
{
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
- if (!(*i)->is_auditioner()) {
- (*i)->set_solo (yn, this);
+ if ((*i)->is_auditioner()) {
+ continue;
}
+ (*i)->clear_all_solo_state();
}
-
set_dirty();
}
void
-Session::cancel_solo_after_disconnect (boost::shared_ptr<Route> r, bool upstream, SessionEvent::RTeventCallback after)
+Session::set_solo (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override)
{
- boost::shared_ptr<RouteList> rl (new RouteList);
- rl->push_back (r);
-
- queue_event (get_rt_event (rl, upstream, after, false, &Session::rt_cancel_solo_after_disconnect));
+ queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_solo));
}
void
-Session::rt_cancel_solo_after_disconnect (boost::shared_ptr<RouteList> rl, bool upstream, bool /* group_override */)
+Session::rt_set_solo (boost::shared_ptr<RouteList> rl, bool yn, bool group_override)
{
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
if (!(*i)->is_auditioner()) {
- (*i)->cancel_solo_after_disconnect (upstream);
+ (*i)->set_solo (yn, this, group_override);
}
}
- /* no need to call set-dirty - the disconnect will already have done that */
+
+ set_dirty();
+ /* XXX boost::shared_ptr<RouteList> 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
}
void
-Session::rt_set_listen (boost::shared_ptr<RouteList> rl, bool yn, bool /*group_override*/ )
+Session::rt_set_listen (boost::shared_ptr<RouteList> rl, bool yn, bool group_override)
{
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
if (!(*i)->is_auditioner()) {
- (*i)->set_listen (yn, this);
+ (*i)->set_listen (yn, this, group_override);
}
}
void
Session::set_mute (boost::shared_ptr<RouteList> 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<Route::MuteControllable> mc = (*i)->mute_control();
+ mc->set_superficial_value(yn);
+ }
+
queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_mute));
}
*/
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
- if ((*i)->is_auditioner()) {
+ if ((*i)->is_auditioner() || (*i)->record_safe ()) {
continue;
}
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;
}
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)
{