summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_regions.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-04-09 03:21:13 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:14 +1000
commit618a391346763603ef8e1d77f17a7fb6a6538772 (patch)
tree3bfd1563fd5bb6e763f19c32016fafba9ac7ebc3 /gtk2_ardour/editor_regions.cc
parentec29f5d64cd59f27f2953cb3363c2bb9c4a21eb2 (diff)
Preformance - reinstate EditorRegions::freeze_tree_model ().
Diffstat (limited to 'gtk2_ardour/editor_regions.cc')
-rw-r--r--gtk2_ardour/editor_regions.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc
index c6620958c6..f95e5b797e 100644
--- a/gtk2_ardour/editor_regions.cc
+++ b/gtk2_ardour/editor_regions.cc
@@ -255,6 +255,8 @@ EditorRegions::EditorRegions (Editor* e)
ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::region_changed, this, _1, _2), gui_context());
ARDOUR::RegionFactory::CheckNewRegion.connect (check_new_region_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::add_region, this, _1), gui_context());
+ e->EditorFreeze.connect (editor_freeze_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::freeze_tree_model, this), gui_context());
+ e->EditorThaw.connect (editor_thaw_connection, MISSING_INVALIDATOR, boost::bind (&EditorRegions::thaw_tree_model, this), gui_context());
}
bool
@@ -1407,6 +1409,25 @@ EditorRegions::get_single_selection ()
}
void
+EditorRegions::freeze_tree_model (){
+
+ _display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
+ _model->set_sort_column (-2, SORT_ASCENDING); //Disable sorting to gain performance
+
+}
+
+void
+EditorRegions::thaw_tree_model (){
+
+ _model->set_sort_column (0, SORT_ASCENDING); // renabale sorting
+ _display.set_model (_model);
+
+ if (toggle_full_action()->get_active()) {
+ _display.expand_all();
+ }
+}
+
+void
EditorRegions::locked_changed (std::string const & path)
{
TreeIter i = _model->get_iter (path);