restore ability to create TOC and CUE files during export. this is an option in a...
[ardour.git] / libs / ardour / route_group.cc
index 0806ad7730fa8f77c5c8307a56b3549f5a3d5fd2..ef7645e63f2ea68042f96ed412eec6255bbeb1f0 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 ()
@@ -120,7 +125,7 @@ RouteGroup::~RouteGroup ()
                RouteList::iterator tmp = i;
                ++tmp;
 
-               (*i)->leave_route_group ();
+               (*i)->set_route_group (0);
 
                i = tmp;
        }
@@ -136,15 +141,17 @@ RouteGroup::add (boost::shared_ptr<Route> r)
                return 0;
        }
 
-       r->leave_route_group ();
-
+       if (r->route_group()) {
+               r->route_group()->remove (r);
+       }
+       
        routes->push_back (r);
 
-       r->join_route_group (this);
+       r->set_route_group (this);
        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;
 }
 
@@ -164,10 +171,10 @@ RouteGroup::remove (boost::shared_ptr<Route> r)
        RouteList::iterator i;
 
        if ((i = find (routes->begin(), routes->end(), r)) != routes->end()) {
-               r->leave_route_group ();
+               r->set_route_group (0);
                routes->erase (i);
                _session.set_dirty ();
-               MembershipChanged (); /* EMIT SIGNAL */
+               RouteRemoved (this, boost::weak_ptr<Route> (r)); /* EMIT SIGNAL */
                return 0;
        }
 
@@ -251,10 +258,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) {
@@ -308,6 +312,7 @@ RouteGroup::set_gain (bool yn)
                return;
        }
        _gain = yn;
+       send_change (PropertyChange (Properties::gain));
 }
 
 void
@@ -317,6 +322,7 @@ RouteGroup::set_mute (bool yn)
                return;
        }
        _mute = yn;
+       send_change (PropertyChange (Properties::mute));
 }
 
 void
@@ -326,6 +332,7 @@ RouteGroup::set_solo (bool yn)
                return;
        }
        _solo = yn;
+       send_change (PropertyChange (Properties::solo));
 }
 
 void
@@ -335,6 +342,7 @@ RouteGroup::set_recenable (bool yn)
                return;
        }
        _recenable = yn;
+       send_change (PropertyChange (Properties::recenable));
 }
 
 void
@@ -344,6 +352,7 @@ RouteGroup::set_select (bool yn)
                return;
        }
        _select = yn;
+       send_change (PropertyChange (Properties::select));
 }
 
 void
@@ -353,6 +362,7 @@ RouteGroup::set_edit (bool yn)
                return;
        }
        _edit = yn;
+       send_change (PropertyChange (Properties::edit));
 }
 
 void
@@ -362,6 +372,7 @@ RouteGroup::set_route_active (bool yn)
                return;
        }
        _route_active = yn;
+       send_change (PropertyChange (Properties::route_active));
 }
 
 void
@@ -372,6 +383,8 @@ RouteGroup::set_color (bool yn)
        }
        _color = yn;
 
+       send_change (PropertyChange (Properties::color));
+
        /* This is a bit of a hack, but this might change
           our route's effective color, so emit gui_changed
           for our routes.
@@ -382,6 +395,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*/)
 {
@@ -391,7 +417,6 @@ RouteGroup::set_active (bool yn, void* /*src*/)
 
        _active = yn;
        send_change (PropertyChange (Properties::active));
-
        _session.set_dirty ();
 }
 
@@ -402,6 +427,7 @@ RouteGroup::set_relative (bool yn, void* /*src*/)
                return;
        }
        _relative = yn;
+       send_change (PropertyChange (Properties::relative));
        _session.set_dirty ();
 }