Remove the source files which got transferred to libpbd
[ardour.git] / libs / ardour / session_rtevents.cc
index 43d291c45870b239d51e513a2f43e71eb14a41b1..4bd7c2da9a03ac27d45a31b15b856345a4d6ca5c 100644 (file)
@@ -42,7 +42,7 @@ void
 Session::rt_set_monitoring (boost::shared_ptr<RouteList> rl, MonitorChoice mc, bool /* group_override */)
 {
        for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
-               if (!(*i)->is_hidden()) {
+               if (!(*i)->is_auditioner()) {
                        boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (*i);
                        if (t) {
                                t->set_monitoring (mc);
@@ -63,7 +63,7 @@ void
 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_hidden()) {
+               if (!(*i)->is_auditioner()) {
                        (*i)->set_solo (yn, this);
                }
        }
@@ -72,20 +72,20 @@ Session::rt_set_solo (boost::shared_ptr<RouteList> rl, bool yn, bool /* group_ov
 }
 
 void
-Session::cancel_solo_after_disconnect (boost::shared_ptr<Route> r, SessionEvent::RTeventCallback after)
+Session::cancel_solo_after_disconnect (boost::shared_ptr<Route> r, bool upstream, SessionEvent::RTeventCallback after)
 {
        boost::shared_ptr<RouteList> rl (new RouteList);
        rl->push_back (r);
 
-       queue_event (get_rt_event (rl, false, after, false, &Session::rt_cancel_solo_after_disconnect));
+       queue_event (get_rt_event (rl, upstream, after, false, &Session::rt_cancel_solo_after_disconnect));
 }
 
 void
-Session::rt_cancel_solo_after_disconnect (boost::shared_ptr<RouteList> rl, bool /*yn */, bool /* group_override */)
+Session::rt_cancel_solo_after_disconnect (boost::shared_ptr<RouteList> rl, bool upstream, bool /* group_override */)
 {
        for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
-               if (!(*i)->is_hidden()) {
-                       (*i)->cancel_solo_after_disconnect ();
+               if (!(*i)->is_auditioner()) {
+                       (*i)->cancel_solo_after_disconnect (upstream);
                }
        }
        /* no need to call set-dirty - the disconnect will already have done that */
@@ -112,7 +112,7 @@ Session::rt_set_just_one_solo (boost::shared_ptr<RouteList> just_one, bool yn, b
        boost::shared_ptr<Route> r = just_one->front();
 
        for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
-               if (!(*i)->is_hidden() && r != *i) {
+               if (!(*i)->is_auditioner() && r != *i) {
                        (*i)->set_solo (!yn, (*i)->route_group());
                }
        }
@@ -132,7 +132,7 @@ void
 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_hidden()) {
+               if (!(*i)->is_auditioner()) {
                        (*i)->set_listen (yn, this);
                }
        }
@@ -143,6 +143,12 @@ Session::rt_set_listen (boost::shared_ptr<RouteList> rl, bool yn, bool /*group_o
 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));
 }
 
@@ -150,7 +156,7 @@ void
 Session::rt_set_mute (boost::shared_ptr<RouteList> rl, bool yn, bool /*group_override*/)
 {
        for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
-               if (!(*i)->is_hidden()) {
+               if (!(*i)->is_monitor() && !(*i)->is_auditioner()) {
                        (*i)->set_mute (yn, this);
                }
        }
@@ -168,7 +174,7 @@ void
 Session::rt_set_solo_isolated (boost::shared_ptr<RouteList> rl, bool yn, bool /*group_override*/)
 {
        for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
-               if (!(*i)->is_master() && !(*i)->is_monitor() && !(*i)->is_hidden()) {
+               if (!(*i)->is_master() && !(*i)->is_monitor() && !(*i)->is_auditioner()) {
                        (*i)->set_solo_isolated (yn, this);
                }
        }
@@ -183,6 +189,25 @@ Session::set_record_enabled (boost::shared_ptr<RouteList> rl, bool yn, SessionEv
                return;
        }
 
+       /* do the non-RT part of rec-enabling first - the RT part will be done
+        * on the next process cycle. This does mean that theoretically we are
+        * doing things provisionally on the assumption that the rec-enable
+        * change will work, but this had better be a solid assumption for
+        * other reasons.
+        */
+
+       for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
+               if ((*i)->is_auditioner()) {
+                       continue;
+               }
+
+               boost::shared_ptr<Track> t;
+
+               if ((t = boost::dynamic_pointer_cast<Track>(*i)) != 0) {
+                       t->prep_record_enabled (yn, (group_override ? (void*) t->route_group() : (void *) this));
+               }
+       }
+
        queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_record_enabled));
 }
 
@@ -190,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_hidden()) {
+               if ((*i)->is_auditioner()) {
                        continue;
                }