more solo model work, including a GUI fix for mute button state when the route is...
[ardour.git] / gtk2_ardour / editor_selection.cc
index 3e5b412c85909f6f266cb0304dbccc2068ce5f20..fda5155e03d1fe6ed69505ab4f2bf8c253b8383a 100644 (file)
@@ -23,7 +23,6 @@
 #include "pbd/stacktrace.h"
 
 #include "ardour/session.h"
-#include "ardour/diskstream.h"
 #include "ardour/playlist.h"
 #include "ardour/route_group.h"
 #include "ardour/profile.h"
@@ -329,9 +328,9 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t, RegionVi
        boost::shared_ptr<Playlist> pl;
        vector<boost::shared_ptr<Region> > results;
        RegionView* marv;
-       boost::shared_ptr<Diskstream> ds;
+       boost::shared_ptr<Track> tr;
 
-       if ((ds = tv.get_diskstream()) == 0) {
+       if ((tr = tv.track()) == 0) {
                /* bus */
                return;
        }
@@ -341,7 +340,7 @@ Editor::mapped_get_equivalent_regions (RouteTimeAxisView& tv, uint32_t, RegionVi
                return;
        }
 
-       if ((pl = ds->playlist()) != 0) {
+       if ((pl = tr->playlist()) != 0) {
                pl->get_equivalent_regions (basis->region(), results);
        }
 
@@ -401,14 +400,14 @@ Editor::get_regionview_count_from_region_list (boost::shared_ptr<Region> region)
                        boost::shared_ptr<Playlist> pl;
                        vector<boost::shared_ptr<Region> > results;
                        RegionView* marv;
-                       boost::shared_ptr<Diskstream> ds;
+                       boost::shared_ptr<Track> tr;
 
-                       if ((ds = tatv->get_diskstream()) == 0) {
+                       if ((tr = tatv->track()) == 0) {
                                /* bus */
                                continue;
                        }
 
-                       if ((pl = (ds->playlist())) != 0) {
+                       if ((pl = (tr->playlist())) != 0) {
                                pl->get_region_list_equivalent_regions (region, results);
                        }
 
@@ -476,7 +475,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
                                if (press) {
 
                                        if (selection->selected (clicked_routeview)) {
-                                               get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::select.id);
+                                               get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::select.property_id);
                                        } else {
                                                all_equivalent_regions.push_back (clicked_regionview);
                                        }
@@ -494,7 +493,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op,
 
                case Selection::Set:
                        if (!selection->selected (clicked_regionview)) {
-                               get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::select.id);
+                               get_equivalent_regions (clicked_regionview, all_equivalent_regions, ARDOUR::Properties::select.property_id);
                                selection->set (all_equivalent_regions);
                                commit = true;
                        } else {
@@ -979,12 +978,9 @@ Editor::invert_selection ()
  *  @param bottom Bottom (higher) y limit in trackview coordinates.
  */
 bool
-Editor::select_all_within (
-       nframes64_t start, nframes64_t end, double top, double bot, const TrackViewList& tracklist, Selection::Operation op
-       )
+Editor::select_all_within (nframes64_t start, nframes64_t end, double top, double bot, const TrackViewList& tracklist, Selection::Operation op)
 {
        list<Selectable*> found;
-       TrackViewList tracks;
 
        for (TrackViewList::const_iterator iter = tracklist.begin(); iter != tracklist.end(); ++iter) {
                
@@ -992,37 +988,13 @@ Editor::select_all_within (
                        continue;
                }
 
-               list<Selectable*>::size_type const n = found.size ();
-
                (*iter)->get_selectables (start, end, top, bot, found);
-
-               if (n != found.size()) {
-                       tracks.push_back (*iter);
-               }
        }
        
        if (found.empty()) {
                return false;
        }
 
-       if (!tracks.empty()) {
-
-               switch (op) {
-               case Selection::Add:
-                       selection->add (tracks);
-                       break;
-               case Selection::Toggle:
-                       selection->toggle (tracks);
-                       break;
-               case Selection::Set:
-                       selection->set (tracks);
-                       break;
-               case Selection::Extend:
-                       /* not defined yet */
-                       break;
-               }
-       }
-
        begin_reversible_command (_("select all within"));
        switch (op) {
        case Selection::Add: