Watch for route colour changes and update the summary accordingly. Fixes #3692.

git-svn-id: svn://localhost/ardour2/branches/3.0@8480 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2011-01-08 02:35:35 +00:00
parent 41264273ec
commit 150d3fdfbf
3 changed files with 24 additions and 4 deletions

View File

@ -4854,14 +4854,13 @@ Editor::handle_new_route (RouteList& routes)
}
_routes->routes_added (new_views);
_summary->routes_added (new_views);
if (show_editor_mixer_when_tracks_arrive) {
show_editor_mixer (true);
}
editor_list_button.set_sensitive (true);
_summary->set_dirty ();
}
void

View File

@ -29,6 +29,7 @@
#include "editor_routes.h"
#include "editor_cursors.h"
#include "mouse_cursors.h"
#include "route_time_axis.h"
using namespace std;
using namespace ARDOUR;
@ -792,3 +793,22 @@ EditorSummary::editor_y_to_summary (double y) const
return sy;
}
void
EditorSummary::routes_added (list<RouteTimeAxisView*> const & r)
{
/* Connect to gui_changed() on the routes so that we know when their colour has changed */
for (list<RouteTimeAxisView*>::const_iterator i = r.begin(); i != r.end(); ++i) {
(*i)->route()->gui_changed.connect (*this, invalidator (*this), ui_bind (&EditorSummary::route_gui_changed, this, _1), gui_context ());
}
set_dirty ();
}
void
EditorSummary::route_gui_changed (string c)
{
if (c == "color") {
set_dirty ();
}
}

View File

@ -1,4 +1,3 @@
/*
Copyright (C) 2009 Paul Davis
@ -33,13 +32,14 @@ class Editor;
/** Class to provide a visual summary of the contents of an editor window; represents
* the whole session as a set of lines, one per region view.
*/
class EditorSummary : public CairoWidget, public EditorComponent, public ARDOUR::SessionHandlePtr
class EditorSummary : public CairoWidget, public EditorComponent, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
{
public:
EditorSummary (Editor *);
void set_session (ARDOUR::Session *);
void set_overlays_dirty ();
void routes_added (std::list<RouteTimeAxisView*> const &);
private:
@ -79,6 +79,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);
framepos_t _start; ///< start frame of the overview
framepos_t _end; ///< end frame of the overview