obey monitor=disk when recording also; remove debug output
[ardour.git] / libs / ardour / session_rtevents.cc
index 2befe47c16012a4787de749f03b450bf89c56895..ca1ee319c7d93e32c7497c2a52dbf84547977148 100644 (file)
@@ -32,16 +32,25 @@ using namespace PBD;
 using namespace ARDOUR;
 using namespace Glib;
 
-SessionEvent*
-Session::get_rt_event (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override,  
-                      void (Session::*method) (boost::shared_ptr<RouteList>, bool, bool))
+void
+Session::set_monitoring (boost::shared_ptr<RouteList> rl, MonitorChoice mc, SessionEvent::RTeventCallback after, bool group_override)
 {
-       SessionEvent* ev = new SessionEvent (SessionEvent::RealTimeOperation, SessionEvent::Add, SessionEvent::Immediate, 0, 0.0);
-       ev->rt_slot = boost::bind (method, this, rl, yn, group_override);
-       ev->rt_return = after;
-       ev->event_loop = EventLoop::get_event_loop_for_thread ();
+       queue_event (get_rt_event (rl, mc, after, group_override, &Session::rt_set_monitoring));
+}
+
+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()) {
+                       boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track> (*i);
+                       if (t) {
+                               t->set_monitoring (mc);
+                       }
+               }
+       }
 
-       return ev;
+       set_dirty();
 }
 
 void
@@ -65,7 +74,7 @@ Session::rt_set_solo (boost::shared_ptr<RouteList> rl, bool yn, bool /* group_ov
 void
 Session::set_just_one_solo (boost::shared_ptr<Route> r, bool yn, SessionEvent::RTeventCallback after)
 {
-       /* its a bit silly to have to do this, but it keeps the API for this public method sane (we're 
+       /* its a bit silly to have to do this, but it keeps the API for this public method sane (we're
           only going to solo one route) and keeps our ability to use get_rt_event() for the internal
           private method.
        */
@@ -87,9 +96,9 @@ Session::rt_set_just_one_solo (boost::shared_ptr<RouteList> just_one, bool yn, b
                        (*i)->set_solo (!yn, (*i)->route_group());
                }
        }
-       
+
        r->set_solo (yn, r->route_group());
-       
+
        set_dirty();
 }
 
@@ -125,22 +134,40 @@ Session::rt_set_mute (boost::shared_ptr<RouteList> rl, bool yn, bool /*group_ove
                        (*i)->set_mute (yn, this);
                }
        }
-       
+
        set_dirty();
 }
 
 void
-Session::set_record_enable (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override)
+Session::set_solo_isolated (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override)
+{
+       queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_solo_isolated));
+}
+
+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()) {
+                       (*i)->set_solo_isolated (yn, this);
+               }
+       }
+
+       set_dirty();
+}
+
+void
+Session::set_record_enabled (boost::shared_ptr<RouteList> rl, bool yn, SessionEvent::RTeventCallback after, bool group_override)
 {
        if (!writable()) {
                return;
        }
-       
-       queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_record_enable));
+
+       queue_event (get_rt_event (rl, yn, after, group_override, &Session::rt_set_record_enabled));
 }
 
 void
-Session::rt_set_record_enable (boost::shared_ptr<RouteList> rl, bool yn, bool group_override)
+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()) {
@@ -150,7 +177,7 @@ Session::rt_set_record_enable (boost::shared_ptr<RouteList> rl, bool yn, bool gr
                boost::shared_ptr<Track> t;
 
                if ((t = boost::dynamic_pointer_cast<Track>(*i)) != 0) {
-                       t->set_record_enable (yn, (group_override ? (void*) t->route_group() : (void *) this));
+                       t->set_record_enabled (yn, (group_override ? (void*) t->route_group() : (void *) this));
                }
        }