diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 4ee286107b..478cba2bd1 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -5153,7 +5153,7 @@ Editor::get_per_region_note_selection (list region, vector& regions, bool src_comparison) +Editor::get_regionview_corresponding_to (boost::shared_ptr region, vector& regions) { for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { @@ -5162,7 +5162,6 @@ Editor::get_regionviews_corresponding_to (boost::shared_ptr region, vect if ((tatv = dynamic_cast (*i)) != 0) { boost::shared_ptr pl; - vector > results; RegionView* marv; boost::shared_ptr tr; @@ -5171,20 +5170,9 @@ Editor::get_regionviews_corresponding_to (boost::shared_ptr region, vect continue; } - if ((pl = (tr->playlist())) != 0) { - if (src_comparison) { - pl->get_source_equivalent_regions (region, results); - } else { - pl->get_region_list_equivalent_regions (region, results); - } + if ((marv = tatv->view()->find_view (region)) != 0) { + regions.push_back (marv); } - - for (vector >::iterator ir = results.begin(); ir != results.end(); ++ir) { - if ((marv = tatv->view()->find_view (*ir)) != 0) { - regions.push_back (marv); - } - } - } } } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index cfc85ffbb0..95808794ea 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -449,8 +449,6 @@ public: return track_views; } - int get_regionview_count_from_region_list (boost::shared_ptr); - void do_ptimport(std::string path, ARDOUR::SrcQuality quality); void do_import (std::vector paths, @@ -470,7 +468,7 @@ public: samplepos_t& pos, boost::shared_ptr instrument = boost::shared_ptr()); - void get_regionviews_corresponding_to (boost::shared_ptr region, std::vector& regions, bool src_comparison); + void get_regionview_corresponding_to (boost::shared_ptr region, std::vector& regions); void get_regionviews_by_id (PBD::ID const id, RegionSelection & regions) const; void get_per_region_note_selection (std::list > > > >&) const; diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index a39b69f57e..380cf9104f 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -597,44 +597,6 @@ Editor::get_equivalent_regions (RegionSelection & basis, PBD::PropertyID prop) c return equivalent; } -int -Editor::get_regionview_count_from_region_list (boost::shared_ptr region) -{ - int region_count = 0; - - for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) { - - RouteTimeAxisView* tatv; - - if ((tatv = dynamic_cast (*i)) != 0) { - - boost::shared_ptr pl; - vector > results; - RegionView* marv; - boost::shared_ptr tr; - - if ((tr = tatv->track()) == 0) { - /* bus */ - continue; - } - - if ((pl = (tr->playlist())) != 0) { - pl->get_region_list_equivalent_regions (region, results); - } - - for (vector >::iterator ir = results.begin(); ir != results.end(); ++ir) { - if ((marv = tatv->view()->find_view (*ir)) != 0) { - region_count++; - } - } - - } - } - - return region_count; -} - - bool Editor::set_selected_regionview_from_click (bool press, Selection::Operation op) { @@ -995,11 +957,11 @@ Editor::set_selection (std::list s, Selection::Operation op) void Editor::set_selected_regionview_from_region_list (boost::shared_ptr region, Selection::Operation op) { - vector all_equivalent_regions; + vector regionviews; - get_regionviews_corresponding_to (region, all_equivalent_regions, region->whole_file()); + get_regionview_corresponding_to (region, regionviews); - if (all_equivalent_regions.empty()) { + if (regionviews.empty()) { return; } @@ -1008,16 +970,16 @@ Editor::set_selected_regionview_from_region_list (boost::shared_ptr regi switch (op) { case Selection::Toggle: /* XXX this is not correct */ - selection->toggle (all_equivalent_regions); + selection->toggle (regionviews); break; case Selection::Set: - selection->set (all_equivalent_regions); + selection->set (regionviews); break; case Selection::Extend: - selection->add (all_equivalent_regions); + selection->add (regionviews); break; case Selection::Add: - selection->add (all_equivalent_regions); + selection->add (regionviews); break; }