Move RouteGroup color into libardour.
This allows to change it from scripts and surfaces and consolidates code.
This commit is contained in:
parent
b45a3c8164
commit
b5c6f06a99
|
@ -150,6 +150,15 @@ public:
|
||||||
bool has_control_master() const;
|
bool has_control_master() const;
|
||||||
bool slaved () const;
|
bool slaved () const;
|
||||||
|
|
||||||
|
uint32_t rgba () const { return _rgba; }
|
||||||
|
|
||||||
|
/** set route-group color and notify UI about change */
|
||||||
|
void set_rgba (uint32_t);
|
||||||
|
|
||||||
|
/* directly set color only, used to convert old 5.x gui-object-state
|
||||||
|
* to libardour color */
|
||||||
|
void migrate_rgba (uint32_t color) { _rgba = color; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
boost::shared_ptr<RouteList> routes;
|
boost::shared_ptr<RouteList> routes;
|
||||||
boost::shared_ptr<Route> subgroup_bus;
|
boost::shared_ptr<Route> subgroup_bus;
|
||||||
|
@ -179,6 +188,8 @@ private:
|
||||||
|
|
||||||
void post_set (PBD::PropertyChange const &);
|
void post_set (PBD::PropertyChange const &);
|
||||||
void push_to_groups ();
|
void push_to_groups ();
|
||||||
|
|
||||||
|
uint32_t _rgba;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace */
|
} /* namespace */
|
||||||
|
|
|
@ -109,6 +109,7 @@ RouteGroup::RouteGroup (Session& s, const string &n)
|
||||||
, _rec_enable_group (new ControlGroup (RecEnableAutomation))
|
, _rec_enable_group (new ControlGroup (RecEnableAutomation))
|
||||||
, _gain_group (new GainControlGroup ())
|
, _gain_group (new GainControlGroup ())
|
||||||
, _monitoring_group (new ControlGroup (MonitoringAutomation))
|
, _monitoring_group (new ControlGroup (MonitoringAutomation))
|
||||||
|
, _rgba (0)
|
||||||
{
|
{
|
||||||
_xml_node_name = X_("RouteGroup");
|
_xml_node_name = X_("RouteGroup");
|
||||||
|
|
||||||
|
@ -234,6 +235,22 @@ RouteGroup::remove (boost::shared_ptr<Route> r)
|
||||||
return -1;
|
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&
|
XMLNode&
|
||||||
RouteGroup::get_state ()
|
RouteGroup::get_state ()
|
||||||
|
@ -241,6 +258,7 @@ RouteGroup::get_state ()
|
||||||
XMLNode *node = new XMLNode ("RouteGroup");
|
XMLNode *node = new XMLNode ("RouteGroup");
|
||||||
|
|
||||||
node->set_property ("id", id());
|
node->set_property ("id", id());
|
||||||
|
node->set_property ("rgba", _rgba);
|
||||||
|
|
||||||
add_properties (*node);
|
add_properties (*node);
|
||||||
|
|
||||||
|
@ -266,6 +284,7 @@ RouteGroup::set_state (const XMLNode& node, int version)
|
||||||
|
|
||||||
set_id (node);
|
set_id (node);
|
||||||
set_values (node);
|
set_values (node);
|
||||||
|
node.get_property ("rgba", _rgba);
|
||||||
|
|
||||||
std::string routes;
|
std::string routes;
|
||||||
if (node.get_property ("routes", routes)) {
|
if (node.get_property ("routes", routes)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user