diff options
author | Carl Hetherington <carl@carlh.net> | 2011-08-31 19:14:12 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-08-31 19:14:12 +0000 |
commit | 881b5a43e755860e91bf596bcac1f8c105b0a843 (patch) | |
tree | ea8c1ee2acca440144caa74dc5f6698449278dd8 /libs/ardour | |
parent | f3a6b8a9bae2c926dd37315793416f14c176bbd8 (diff) |
Allow route groups to color their tracks (remainder of
#4064).
git-svn-id: svn://localhost/ardour2/branches/3.0@10043 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/route_group.h | 4 | ||||
-rw-r--r-- | libs/ardour/route_group.cc | 29 |
2 files changed, 31 insertions, 2 deletions
diff --git a/libs/ardour/ardour/route_group.h b/libs/ardour/ardour/route_group.h index 5ab78cdf76..1f6be864cd 100644 --- a/libs/ardour/ardour/route_group.h +++ b/libs/ardour/ardour/route_group.h @@ -44,6 +44,7 @@ namespace Properties { extern PBD::PropertyDescriptor<bool> select; extern PBD::PropertyDescriptor<bool> edit; extern PBD::PropertyDescriptor<bool> route_active; + extern PBD::PropertyDescriptor<bool> color; /* we use this, but its declared in region.cc */ extern PBD::PropertyDescriptor<bool> hidden; }; @@ -71,6 +72,7 @@ class RouteGroup : public SessionObject bool is_select () const { return _select.val(); } bool is_edit () const { return _edit.val(); } bool is_route_active () const { return _route_active.val(); } + bool is_color () const { return _color.val(); } bool empty() const {return routes->empty();} size_t size() const { return routes->size();} @@ -89,6 +91,7 @@ class RouteGroup : public SessionObject void set_select (bool yn); void set_edit (bool yn); void set_route_active (bool yn); + void set_color (bool yn); bool enabled_property (PBD::PropertyID); @@ -141,6 +144,7 @@ private: PBD::Property<bool> _select; PBD::Property<bool> _edit; PBD::Property<bool> _route_active; + PBD::Property<bool> _color; void remove_when_going_away (boost::weak_ptr<Route>); int set_state_2X (const XMLNode&, int); diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc index ae2545a3ea..0806ad7730 100644 --- a/libs/ardour/route_group.cc +++ b/libs/ardour/route_group.cc @@ -51,6 +51,7 @@ namespace ARDOUR { PropertyDescriptor<bool> select; PropertyDescriptor<bool> edit; PropertyDescriptor<bool> route_active; + PropertyDescriptor<bool> color; } } @@ -77,6 +78,8 @@ RouteGroup::make_property_quarks () DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for edit = %1\n", Properties::edit.property_id)); Properties::route_active.property_id = g_quark_from_static_string (X_("route-active")); 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)); } #define ROUTE_GROUP_DEFAULT_PROPERTIES _relative (Properties::relative, false) \ @@ -88,7 +91,8 @@ RouteGroup::make_property_quarks () , _recenable (Properties::recenable, false) \ , _select (Properties::select, false) \ , _edit (Properties::edit, false) \ - , _route_active (Properties::route_active, false) + , _route_active (Properties::route_active, false) \ + , _color (Properties::color, false) RouteGroup::RouteGroup (Session& s, const string &n) : SessionObject (s, n) @@ -107,6 +111,7 @@ RouteGroup::RouteGroup (Session& s, const string &n) add_property (_select); add_property (_edit); add_property (_route_active); + add_property (_color); } RouteGroup::~RouteGroup () @@ -282,6 +287,7 @@ RouteGroup::set_state_2X (const XMLNode& node, int /*version*/) _recenable = true; _edit = false; _route_active = true; + _color = false; } else if (node.name() == "EditGroup") { _gain = false; _mute = false; @@ -289,6 +295,7 @@ RouteGroup::set_state_2X (const XMLNode& node, int /*version*/) _recenable = false; _edit = true; _route_active = false; + _color = false; } return 0; @@ -358,6 +365,24 @@ RouteGroup::set_route_active (bool yn) } void +RouteGroup::set_color (bool yn) +{ + if (is_color() == yn) { + return; + } + _color = yn; + + /* This is a bit of a hack, but this might change + our route's effective color, so emit gui_changed + for our routes. + */ + + for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) { + (*i)->gui_changed (X_("color"), this); + } +} + +void RouteGroup::set_active (bool yn, void* /*src*/) { if (is_active() == yn) { @@ -399,7 +424,7 @@ RouteGroup::set_hidden (bool yn, void* /*src*/) } } - PropertyChanged (Properties::hidden); /* EMIT SIGNAL */ + send_change (Properties::hidden); _session.set_dirty (); } |