Remove redundant view <-> model value mapping stuff from AudioRegionGainLine.
[ardour.git] / gtk2_ardour / editor_selection.cc
index d1ba1dcf8ee53b24357f00728fa01d1e7dfd874a..41b6d32a0bb0a2cbd6de8b6ea85817012e0fbd84 100644 (file)
@@ -29,6 +29,7 @@
 #include "audio_region_view.h"
 #include "audio_streamview.h"
 #include "automation_line.h"
+#include "control_point.h"
 
 #include "i18n.h"
 
@@ -582,43 +583,6 @@ Editor::set_selected_regionview_from_region_list (boost::shared_ptr<Region> regi
        commit_reversible_command () ;
 }
 
-bool
-Editor::set_selected_regionview_from_map_event (GdkEventAny* ev, StreamView* sv, boost::weak_ptr<Region> weak_r)
-{
-       RegionView* rv;
-       boost::shared_ptr<Region> r (weak_r.lock());
-
-       if (!r) {
-               return true;
-       }
-
-       boost::shared_ptr<AudioRegion> ar;
-
-       if ((ar = boost::dynamic_pointer_cast<AudioRegion> (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 +649,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<Selectable *> 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 +706,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<Selectable *> 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);
 }