X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_selection.cc;h=3f3edfe65b005bc3b527b580f7e042a89cc3deda;hb=aa3bb18b173fdd8bc7f9611f3dbe52e36cfe6215;hp=417d28f8dae3abc85d840bad75602332e6018db0;hpb=959a7909c1adca430a63f783fd16687242a7be3d;p=ardour.git diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 417d28f8da..3f3edfe65b 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -245,7 +245,7 @@ Editor::set_selected_control_point_from_click (Selection::Operation op, bool no_ y1 = clicked_control_point->get_x() - 10; y2 = clicked_control_point->get_y() + 10; - return select_all_within (x1, x2, y1, y2, op); + return select_all_within (x1, x2, y1, y2, selection->tracks, op); } void @@ -582,43 +582,6 @@ Editor::set_selected_regionview_from_region_list (boost::shared_ptr regi commit_reversible_command () ; } -bool -Editor::set_selected_regionview_from_map_event (GdkEventAny* ev, StreamView* sv, boost::weak_ptr weak_r) -{ - RegionView* rv; - boost::shared_ptr r (weak_r.lock()); - - if (!r) { - return true; - } - - boost::shared_ptr ar; - - if ((ar = boost::dynamic_pointer_cast (r)) == 0) { - return true; - } - - if ((rv = sv->find_view (ar)) == 0) { - return true; - } - - /* don't reset the selection if its something other than - a single other region. - */ - - if (selection->regions.size() > 1) { - return true; - } - - begin_reversible_command (_("set selected regions")); - - selection->set (rv); - - commit_reversible_command () ; - - return true; -} - void Editor::track_selection_changed () { @@ -685,16 +648,17 @@ Editor::point_selection_changed () } } +/** Select everything in the selected tracks + * @param Selection operation to apply. + */ void -Editor::select_all_in_track (Selection::Operation op) +Editor::select_all_in_selected_tracks (Selection::Operation op) { list touched; - if (!clicked_routeview) { - return; + for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { + (*i)->get_selectables (0, max_frames, 0, DBL_MAX, touched); } - - clicked_routeview->get_selectables (0, max_frames, 0, DBL_MAX, touched); switch (op) { case Selection::Toggle: @@ -741,16 +705,16 @@ Editor::select_all (Selection::Operation op) commit_reversible_command (); } +/** Invert the selection in the selected tracks */ void -Editor::invert_selection_in_track () +Editor::invert_selection_in_selected_tracks () { list touched; - if (!clicked_routeview) { - return; + for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) { + (*i)->get_inverted_selectables (*selection, touched); } - clicked_routeview->get_inverted_selectables (*selection, touched); selection->set (touched); } @@ -770,13 +734,13 @@ Editor::invert_selection () } bool -Editor::select_all_within (nframes_t start, nframes_t end, double top, double bot, Selection::Operation op) +Editor::select_all_within (nframes_t start, nframes_t end, double top, double bot, const TrackViewList& tracklist, Selection::Operation op) { list touched; list::size_type n = 0; TrackViewList touched_tracks; - for (TrackViewList::iterator iter = selection->tracks.begin(); iter != selection->tracks.end(); ++iter) { + for (TrackViewList::const_iterator iter = tracklist.begin(); iter != tracklist.end(); ++iter) { if ((*iter)->hidden()) { continue; }