add route group support for monitoring choices
[ardour.git] / libs / ardour / route_group.cc
index 0806ad7730fa8f77c5c8307a56b3549f5a3d5fd2..188ec71f8710ddaa28a5be728916316ae4548c76 100644 (file)
@@ -52,6 +52,7 @@ namespace ARDOUR {
                PropertyDescriptor<bool> edit;
                PropertyDescriptor<bool> route_active;
                PropertyDescriptor<bool> color;
+               PropertyDescriptor<bool> monitoring;
        }
 }
 
@@ -80,6 +81,8 @@ RouteGroup::make_property_quarks ()
         DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for route-active = %1\n", Properties::route_active.property_id));
        Properties::color.property_id = g_quark_from_static_string (X_("color"));
         DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for color = %1\n",       Properties::color.property_id));
+       Properties::monitoring.property_id = g_quark_from_static_string (X_("monitoring"));
+        DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for monitoring = %1\n",       Properties::monitoring.property_id));
 }
 
 #define ROUTE_GROUP_DEFAULT_PROPERTIES  _relative (Properties::relative, false) \
@@ -92,7 +95,8 @@ RouteGroup::make_property_quarks ()
        , _select (Properties::select, false) \
        , _edit (Properties::edit, false) \
        , _route_active (Properties::route_active, false) \
-       , _color (Properties::color, false)
+       , _color (Properties::color, false) \
+       , _monitoring (Properties::monitoring, false)
 
 RouteGroup::RouteGroup (Session& s, const string &n)
        : SessionObject (s, n)
@@ -112,6 +116,7 @@ RouteGroup::RouteGroup (Session& s, const string &n)
        add_property (_edit);
        add_property (_route_active);
        add_property (_color);
+       add_property (_monitoring);
 }
 
 RouteGroup::~RouteGroup ()
@@ -144,7 +149,7 @@ RouteGroup::add (boost::shared_ptr<Route> r)
        r->DropReferences.connect_same_thread (*this, boost::bind (&RouteGroup::remove_when_going_away, this, boost::weak_ptr<Route> (r)));
 
        _session.set_dirty ();
-       MembershipChanged (); /* EMIT SIGNAL */
+       RouteAdded (this, boost::weak_ptr<Route> (r)); /* EMIT SIGNAL */
        return 0;
 }
 
@@ -167,7 +172,7 @@ RouteGroup::remove (boost::shared_ptr<Route> r)
                r->leave_route_group ();
                routes->erase (i);
                _session.set_dirty ();
-               MembershipChanged (); /* EMIT SIGNAL */
+               RouteRemoved (this, boost::weak_ptr<Route> (r)); /* EMIT SIGNAL */
                return 0;
        }
 
@@ -251,10 +256,7 @@ RouteGroup::set_state (const XMLNode& node, int version)
 
        const XMLProperty *prop;
 
-       if ((prop = node.property ("id")) != 0) {
-               _id = prop->value();
-       }
-
+       set_id (node);
        set_values (node);
 
        if ((prop = node.property ("routes")) != 0) {
@@ -382,6 +384,19 @@ RouteGroup::set_color (bool yn)
        }
 }
 
+void
+RouteGroup::set_monitoring (bool yn) 
+{
+       if (is_monitoring() == yn) {
+               return;
+       }
+
+       _monitoring = yn;
+       send_change (PropertyChange (Properties::monitoring));
+
+       _session.set_dirty ();
+}
+
 void
 RouteGroup::set_active (bool yn, void* /*src*/)
 {