X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_selection.cc;h=e1c6f4e7ea9b15e959a73a7793af23f79df97df6;hb=e11b3f90c2d02735a071d526d67cfd0de90cbac3;hp=7c36384e3050e8f601164bb19b124b079c0e39af;hpb=997e4b1f9cd7ccfc704b7c035051da7f60d831e7;p=ardour.git diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 7c36384e30..e1c6f4e7ea 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -18,7 +18,7 @@ */ #include -#include +#include #include @@ -202,21 +202,7 @@ Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no break; case Selection::Set: - if (selection->selected (&view) && selection->tracks.size() > 1) { - - /* reset track selection if there is only 1 other track - selected OR if no_remove is not set (its there to - prevent deselecting a multi-track selection - when clicking on an already selected track - for some reason. - */ - - if (selection->tracks.empty()) { - selection->set (&view); - } else if (selection->tracks.size() == 1 || !no_remove) { - selection->set (&view); - } - } + selection->set (&view); break; case Selection::Extend: @@ -249,7 +235,7 @@ Editor::set_selected_control_point_from_click (Selection::Operation op, bool no_ /* select this point and any others that it represents */ double y1, y2; - nframes_t x1, x2; + nframes64_t x1, x2; x1 = pixel_to_frame (clicked_control_point->get_x() - 10); x2 = pixel_to_frame (clicked_control_point->get_x() + 10); @@ -376,6 +362,44 @@ Editor::get_equivalent_regions (RegionView* basis, vector& equivale equivalent_regions.push_back (basis); } +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 ds; + + if ((ds = tatv->get_diskstream()) == 0) { + /* bus */ + continue; + } + + if ((pl = (ds->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, bool no_track_remove) { @@ -463,8 +487,8 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op, } else if (op == Selection::Extend) { list results; - nframes_t last_frame; - nframes_t first_frame; + nframes64_t last_frame; + nframes64_t first_frame; bool same_track = false; /* 1. find the last selected regionview in the track that was clicked in */ @@ -923,7 +947,7 @@ Editor::invert_selection () } bool -Editor::select_all_within (nframes_t start, nframes_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 touched; list::size_type n = 0; @@ -1043,8 +1067,8 @@ Editor::select_all_selectables_using_time_selection () return; } - nframes_t start = selection->time[clicked_selection].start; - nframes_t end = selection->time[clicked_selection].end; + nframes64_t start = selection->time[clicked_selection].start; + nframes64_t end = selection->time[clicked_selection].end; if (end - start < 1) { return; @@ -1136,8 +1160,8 @@ Editor::select_all_selectables_using_loop() void Editor::select_all_selectables_using_cursor (Cursor *cursor, bool after) { - nframes_t start; - nframes_t end; + nframes64_t start; + nframes64_t end; list touched; if (after) { @@ -1176,8 +1200,8 @@ Editor::select_all_selectables_using_cursor (Cursor *cursor, bool after) void Editor::select_all_selectables_using_edit (bool after) { - nframes_t start; - nframes_t end; + nframes64_t start; + nframes64_t end; list touched; if (after) {