summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-05 17:16:20 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-06-05 17:16:20 -0400
commit3e12d4b4a625e7c02b797e806c1de501a33ade2d (patch)
tree81e57b4986ca8d52fc4f79346faa0a0466759c9a /gtk2_ardour
parent91ad3ef81d94d4108c971b8c9f7a226293d57cfc (diff)
use PresentationInfo color to set route colors. GUI appears to respond as expected
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_summary.cc8
-rw-r--r--gtk2_ardour/editor_summary.h2
-rw-r--r--gtk2_ardour/group_tabs.cc4
-rw-r--r--gtk2_ardour/route_ui.cc8
-rw-r--r--gtk2_ardour/route_ui.h2
5 files changed, 12 insertions, 12 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc
index fb2a15773a..0ac2cdc114 100644
--- a/gtk2_ardour/editor_summary.cc
+++ b/gtk2_ardour/editor_summary.cc
@@ -1050,8 +1050,8 @@ void
EditorSummary::routes_added (list<RouteTimeAxisView*> const & r)
{
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 */
- (*i)->route()->gui_changed.connect (*this, invalidator (*this), boost::bind (&EditorSummary::route_gui_changed, this, _1), gui_context ());
+ /* Connect to the relevant signal for the route so that we know when its colour has changed */
+ (*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 ());
if (tr) {
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
-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 ();
}
}
diff --git a/gtk2_ardour/editor_summary.h b/gtk2_ardour/editor_summary.h
index e95406f978..4fb406a9ab 100644
--- a/gtk2_ardour/editor_summary.h
+++ b/gtk2_ardour/editor_summary.h
@@ -88,7 +88,7 @@ private:
double editor_y_to_summary (double) const;
Position get_position (double, double) const;
void set_cursor (Position);
- void route_gui_changed (std::string);
+ void route_gui_changed (PBD::PropertyChange const&);
bool suspending_editor_updates () const;
double playhead_frame_to_position (framepos_t) const;
framepos_t position_to_playhead_frame_to_position (double pos) const;
diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc
index 299660a4ed..06e50f274b 100644
--- a/gtk2_ardour/group_tabs.cc
+++ b/gtk2_ardour/group_tabs.cc
@@ -860,7 +860,7 @@ GroupTabs::route_added_to_route_group (RouteGroup*, boost::weak_ptr<Route> w)
return;
}
- r->gui_changed (X_("color"), 0);
+ r->presentation_info().PropertyChanged (Properties::color);
set_dirty ();
}
@@ -875,7 +875,7 @@ GroupTabs::route_removed_from_route_group (RouteGroup*, boost::weak_ptr<Route> w
return;
}
- r->gui_changed (X_("color"), 0);
+ r->presentation_info().PropertyChanged (Properties::color);
set_dirty ();
}
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index e10926d00f..c6a1677cc0 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -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->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->gui_changed.connect (route_connections, invalidator (*this), boost::bind (&RouteUI::route_gui_changed, this, _1), gui_context ());
if (_session->writable() && is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route);
@@ -1612,8 +1612,8 @@ RouteUI::choose_color ()
void
RouteUI::set_color (uint32_t c)
{
+ cerr << "setting route color\n";
_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 */
@@ -2165,9 +2165,9 @@ RouteUI::request_redraw ()
/** The Route's gui_changed signal has been emitted */
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) {
route_color_changed ();
}
diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h
index d710614299..aedea7380b 100644
--- a/gtk2_ardour/route_ui.h
+++ b/gtk2_ardour/route_ui.h
@@ -289,7 +289,7 @@ class RouteUI : public virtual ARDOUR::SessionHandlePtr, public virtual sigc::tr
void set_invert_sensitive (bool);
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 () {}
void check_rec_enable_sensitivity ();