summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_markers.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-04-23 02:00:23 +0000
committerCarl Hetherington <carl@carlh.net>2011-04-23 02:00:23 +0000
commit4f9b75c8a2ba182ae0a3131352284f2ccd04193e (patch)
treebe37da361f1a7c69ba7cf44873ea42588126b4ad /gtk2_ardour/editor_markers.cc
parentb7198760955ad27ab766d4a721bf0b8a9eecd3e1 (diff)
Remove unnecessary refresh_location_display_s method. Speed up marker loading somewhat by only setting up marker labels once after load. Fix check on visible status of the location UI so that it is built when opened rather than on load. The location UI is still extremely slow to build with a couple of thousand markers. This fixes #3958.
git-svn-id: svn://localhost/ardour2/branches/3.0@9414 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r--gtk2_ardour/editor_markers.cc32
1 files changed, 18 insertions, 14 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 8b4b2b39bb..34fdc094b1 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -61,8 +61,21 @@ Editor::clear_marker_display ()
void
Editor::add_new_location (Location *location)
{
- ENSURE_GUI_THREAD (*this, &Editor::add_new_location, location)
+ ENSURE_GUI_THREAD (*this, &Editor::add_new_location, location);
+ ArdourCanvas::Group* group = add_new_location_internal (location);
+
+ /* Do a full update of the markers in this group */
+ update_marker_labels (group);
+}
+
+/** Add a new location, without a time-consuming update of all marker labels;
+ * the caller must call update_marker_labels () after calling this.
+ * @return canvas group that the location's marker was added to.
+ */
+ArdourCanvas::Group*
+Editor::add_new_location_internal (Location* location)
+{
LocationMarkers *lam = new LocationMarkers;
uint32_t color;
@@ -163,15 +176,14 @@ Editor::add_new_location (Location *location)
lam->set_show_lines (_show_marker_lines);
/* Add these markers to the appropriate sorted marker lists, which will render
- them unsorted until the update_marker_labels() below sorts them out.
+ them unsorted until a call to update_marker_labels() sorts them out.
*/
_sorted_marker_lists[group].push_back (lam->start);
if (lam->end) {
_sorted_marker_lists[group].push_back (lam->end);
}
- /* Do a full update of the markers in this group */
- update_marker_labels (group);
+ return group;
}
void
@@ -483,7 +495,7 @@ Editor::refresh_location_display_internal (Locations::LocationList& locations)
continue;
}
- add_new_location (*i);
+ add_new_location_internal (*i);
}
/* remove dead ones */
@@ -521,16 +533,8 @@ Editor::refresh_location_display ()
if (_session) {
_session->locations()->apply (*this, &Editor::refresh_location_display_internal);
}
-}
-
-void
-Editor::refresh_location_display_s (const PropertyChange&)
-{
- ENSURE_GUI_THREAD (*this, &Editor::refresh_location_display_s, ignored)
- if (_session) {
- _session->locations()->apply (*this, &Editor::refresh_location_display_internal);
- }
+ update_marker_labels ();
}
void