diff options
author | Robin Gareus <robin@gareus.org> | 2017-05-03 17:36:35 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-05-03 17:53:00 +0200 |
commit | b5c6f06a99144e0bd81ddafb6f19aab7217123b1 (patch) | |
tree | 0c4ad7b8c15308db23a851147efd7fc217fffb7b /libs/ardour/route_group.cc | |
parent | b45a3c816484346f44cd65341fade0850670c2bb (diff) |
Move RouteGroup color into libardour.
This allows to change it from scripts and surfaces and consolidates code.
Diffstat (limited to 'libs/ardour/route_group.cc')
-rw-r--r-- | libs/ardour/route_group.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc index 9bbbd90776..c41a890a02 100644 --- a/libs/ardour/route_group.cc +++ b/libs/ardour/route_group.cc @@ -109,6 +109,7 @@ RouteGroup::RouteGroup (Session& s, const string &n) , _rec_enable_group (new ControlGroup (RecEnableAutomation)) , _gain_group (new GainControlGroup ()) , _monitoring_group (new ControlGroup (MonitoringAutomation)) + , _rgba (0) { _xml_node_name = X_("RouteGroup"); @@ -234,6 +235,22 @@ RouteGroup::remove (boost::shared_ptr<Route> r) return -1; } +void +RouteGroup::set_rgba (uint32_t color) { + _rgba = color; + + PBD::PropertyChange change; + change.add (Properties::color); + PropertyChanged (change); + + if (!is_color ()) { + return; + } + + for (RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) { + (*i)->presentation_info().PropertyChanged (Properties::color); + } +} XMLNode& RouteGroup::get_state () @@ -241,6 +258,7 @@ RouteGroup::get_state () XMLNode *node = new XMLNode ("RouteGroup"); node->set_property ("id", id()); + node->set_property ("rgba", _rgba); add_properties (*node); @@ -266,6 +284,7 @@ RouteGroup::set_state (const XMLNode& node, int version) set_id (node); set_values (node); + node.get_property ("rgba", _rgba); std::string routes; if (node.get_property ("routes", routes)) { |