13
0

use PresentationInfo color to set route colors. GUI appears to respond as expected

This commit is contained in:
Paul Davis 2016-06-05 17:16:20 -04:00
parent 91ad3ef81d
commit 3e12d4b4a6
5 changed files with 12 additions and 12 deletions

View File

@ -1050,8 +1050,8 @@ void
EditorSummary::routes_added (list<RouteTimeAxisView*> const & r) EditorSummary::routes_added (list<RouteTimeAxisView*> const & r)
{ {
for (list<RouteTimeAxisView*>::const_iterator i = r.begin(); i != r.end(); ++i) { for (list<RouteTimeAxisView*>::const_iterator i = r.begin(); i != r.end(); ++i) {
/* Connect to gui_changed() on the route so that we know when their colour has changed */ /* Connect to the relevant signal for the route so that we know when its colour has changed */
(*i)->route()->gui_changed.connect (*this, invalidator (*this), boost::bind (&EditorSummary::route_gui_changed, this, _1), gui_context ()); (*i)->route()->presentation_info().PropertyChanged.connect (*this, invalidator (*this), boost::bind (&EditorSummary::route_gui_changed, this, _1), gui_context ());
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> ((*i)->route ()); boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> ((*i)->route ());
if (tr) { if (tr) {
tr->PlaylistChanged.connect (*this, invalidator (*this), boost::bind (&EditorSummary::set_background_dirty, this), gui_context ()); tr->PlaylistChanged.connect (*this, invalidator (*this), boost::bind (&EditorSummary::set_background_dirty, this), gui_context ());
@ -1062,9 +1062,9 @@ EditorSummary::routes_added (list<RouteTimeAxisView*> const & r)
} }
void void
EditorSummary::route_gui_changed (string c) EditorSummary::route_gui_changed (PBD::PropertyChange const& what_changed)
{ {
if (c == "color") { if (what_changed.contains (Properties::color)) {
set_background_dirty (); set_background_dirty ();
} }
} }

View File

@ -88,7 +88,7 @@ private:
double editor_y_to_summary (double) const; double editor_y_to_summary (double) const;
Position get_position (double, double) const; Position get_position (double, double) const;
void set_cursor (Position); void set_cursor (Position);
void route_gui_changed (std::string); void route_gui_changed (PBD::PropertyChange const&);
bool suspending_editor_updates () const; bool suspending_editor_updates () const;
double playhead_frame_to_position (framepos_t) const; double playhead_frame_to_position (framepos_t) const;
framepos_t position_to_playhead_frame_to_position (double pos) const; framepos_t position_to_playhead_frame_to_position (double pos) const;

View File

@ -860,7 +860,7 @@ GroupTabs::route_added_to_route_group (RouteGroup*, boost::weak_ptr<Route> w)
return; return;
} }
r->gui_changed (X_("color"), 0); r->presentation_info().PropertyChanged (Properties::color);
set_dirty (); set_dirty ();
} }
@ -875,7 +875,7 @@ GroupTabs::route_removed_from_route_group (RouteGroup*, boost::weak_ptr<Route> w
return; return;
} }
r->gui_changed (X_("color"), 0); r->presentation_info().PropertyChanged (Properties::color);
set_dirty (); set_dirty ();
} }

View File

@ -285,9 +285,9 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
_route->PropertyChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_property_changed, this, _1), gui_context()); _route->PropertyChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_property_changed, this, _1), gui_context());
_route->presentation_info().PropertyChanged.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_gui_changed, this, _1), gui_context ());
_route->io_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::setup_invert_buttons, this), gui_context ()); _route->io_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::setup_invert_buttons, this), gui_context ());
_route->gui_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_gui_changed, this, _1), gui_context ());
if (_session->writable() && is_track()) { if (_session->writable() && is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route); boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route);
@ -1612,8 +1612,8 @@ RouteUI::choose_color ()
void void
RouteUI::set_color (uint32_t c) RouteUI::set_color (uint32_t c)
{ {
cerr << "setting route color\n";
_route->presentation_info().set_color (c); _route->presentation_info().set_color (c);
_route->gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */
} }
/** @return GUI state ID for things that are common to the route in all its representations */ /** @return GUI state ID for things that are common to the route in all its representations */
@ -2165,9 +2165,9 @@ RouteUI::request_redraw ()
/** The Route's gui_changed signal has been emitted */ /** The Route's gui_changed signal has been emitted */
void void
RouteUI::route_gui_changed (string what_changed) RouteUI::route_gui_changed (PropertyChange const& what_changed)
{ {
if (what_changed == "color") { if (what_changed.contains (Properties::color)) {
if (set_color_from_route () == 0) { if (set_color_from_route () == 0) {
route_color_changed (); route_color_changed ();
} }

View File

@ -289,7 +289,7 @@ class RouteUI : public virtual ARDOUR::SessionHandlePtr, public virtual sigc::tr
void set_invert_sensitive (bool); void set_invert_sensitive (bool);
bool verify_new_route_name (const std::string& name); bool verify_new_route_name (const std::string& name);
void route_gui_changed (std::string); void route_gui_changed (PBD::PropertyChange const&);
virtual void route_color_changed () {} virtual void route_color_changed () {}
void check_rec_enable_sensitivity (); void check_rec_enable_sensitivity ();