diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-04 14:32:28 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-04 14:32:28 +0000 |
commit | 89d1a2fdf5f9794f56f6bf960bfbebfad913cf74 (patch) | |
tree | 5a2d55a420955f86151ba37870f1de0762195456 /gtk2_ardour | |
parent | 1feaa65d167e59b400b8ac003f69e33934ee7c08 (diff) |
dramatically speed up the addition of large numbers of busses + tracks. consists of a backend part (ignore JACK graph/latency callbacks while we're adding tracks) and a GUI side (avoid O(N^N) behaviour while adding each new time axis view)
git-svn-id: svn://localhost/ardour2/branches/3.0@13595 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_routes.cc | 11 | ||||
-rw-r--r-- | gtk2_ardour/editor_routes.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor_summary.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/mixer_ui.cc | 14 |
4 files changed, 21 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index acbbb697f2..e1a8bc6450 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -69,6 +69,7 @@ EditorRoutes::EditorRoutes (Editor* e) : EditorComponent (e) , _ignore_reorder (false) , _no_redisplay (false) + , _adding_routes (false) , _menu (0) , old_focus (0) , selection_countdown (0) @@ -600,9 +601,12 @@ void EditorRoutes::routes_added (list<RouteTimeAxisView*> routes) { TreeModel::Row row; + PBD::Unwinder<bool> at (_adding_routes, true); suspend_redisplay (); + _display.set_model (Glib::RefPtr<ListStore>()); + for (list<RouteTimeAxisView*>::iterator x = routes.begin(); x != routes.end(); ++x) { boost::shared_ptr<MidiTrack> midi_trk = boost::dynamic_pointer_cast<MidiTrack> ((*x)->route()); @@ -653,6 +657,7 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes) (*x)->route()->solo_isolated_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_isolate_display, this), gui_context()); (*x)->route()->solo_safe_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_safe_display, this), gui_context()); (*x)->route()->active_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_active_display, this), gui_context ()); + } update_rec_display (); @@ -662,7 +667,9 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes) update_solo_safe_display (); update_input_active_display (); update_active_display (); + resume_redisplay (); + _display.set_model (_model); /* now update route order keys from the treeview/track display order */ @@ -672,7 +679,9 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes) void EditorRoutes::handle_gui_changes (string const & what, void*) { - ENSURE_GUI_THREAD (*this, &EditorRoutes::handle_gui_changes, what, src) + if (_adding_routes) { + return; + } if (what == "track_height") { /* Optional :make tracks change height while it happens, instead diff --git a/gtk2_ardour/editor_routes.h b/gtk2_ardour/editor_routes.h index 4933a9496f..6118a2b057 100644 --- a/gtk2_ardour/editor_routes.h +++ b/gtk2_ardour/editor_routes.h @@ -154,6 +154,7 @@ private: bool _ignore_reorder; bool _no_redisplay; + bool _adding_routes; Gtk::Menu* _menu; Gtk::Widget* old_focus; diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 1d7440115e..e7ddb650ed 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -689,8 +689,6 @@ EditorSummary::set_editor (double const x, double const y) is merely pending but not executing. But c'est la vie. */ - cerr << "Editor pending idle already queued\n"; - return; } diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 18ad28d774..560c37bb1d 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -311,9 +311,10 @@ Mixer_UI::add_strips (RouteList& routes) { MixerStrip* strip; - { - Unwinder<bool> uw (no_track_list_redisplay, true); - + try { + no_track_list_redisplay = true; + track_display.set_model (Glib::RefPtr<ListStore>()); + for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) { boost::shared_ptr<Route> route = (*x); @@ -345,7 +346,7 @@ Mixer_UI::add_strips (RouteList& routes) strip = new MixerStrip (*this, _session, route); strips.push_back (strip); - + Config->get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide; if (strip->width_owner() != strip) { @@ -365,8 +366,13 @@ Mixer_UI::add_strips (RouteList& routes) strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed)); strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip)); } + + } catch (...) { } + no_track_list_redisplay = false; + track_display.set_model (track_model); + sync_order_keys_from_treeview (); redisplay_track_list (); } |