diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-31 13:16:51 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-31 13:16:51 -0400 |
commit | ea1ccb869a152d7344f498d2a062867f5bcf9d0b (patch) | |
tree | ef3b8dc9d60cd7d1da9ba439384336c1b0009ca2 /gtk2_ardour/editor_routes.cc | |
parent | b80ae88154fbc1b23c97fe60192a304280c8542c (diff) | |
parent | f2300164d7a89c5e433d3293dfed4c1ab77f0553 (diff) |
fix merge with master
Diffstat (limited to 'gtk2_ardour/editor_routes.cc')
-rw-r--r-- | gtk2_ardour/editor_routes.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index 673eb62e39..b05e461728 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -599,9 +599,24 @@ EditorRoutes::active_changed (std::string const & path) void EditorRoutes::routes_added (list<RouteTimeAxisView*> routes) { - TreeModel::Row row; PBD::Unwinder<bool> at (_adding_routes, true); + bool from_scratch = (_model->children().size() == 0); + Gtk::TreeModel::Children::iterator insert_iter = _model->children().end(); + + for (Gtk::TreeModel::Children::iterator it = _model->children().begin(); it != _model->children().end(); ++it) { + boost::shared_ptr<Route> r = (*it)[_columns.route]; + + if (r->order_key() == (routes.front()->route()->order_key() + routes.size())) { + insert_iter = it; + break; + } + } + + if(!from_scratch) { + _editor->selection->tracks.clear(); + } + suspend_redisplay (); _display.set_model (Glib::RefPtr<ListStore>()); @@ -610,7 +625,7 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes) boost::shared_ptr<MidiTrack> midi_trk = boost::dynamic_pointer_cast<MidiTrack> ((*x)->route()); - row = *(_model->append ()); + TreeModel::Row row = *(_model->insert (insert_iter)); row[_columns.text] = (*x)->route()->name(); row[_columns.visible] = (*x)->marked_for_display(); @@ -634,6 +649,10 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes) row[_columns.solo_safe_state] = (*x)->route()->solo_safe(); row[_columns.name_editable] = true; + if (!from_scratch) { + _editor->selection->add(*x); + } + boost::weak_ptr<Route> wr ((*x)->route()); (*x)->route()->gui_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::handle_gui_changes, this, _1, _2), gui_context()); |