Merge branch 'master' into cairocanvas
[ardour.git] / gtk2_ardour / editor.cc
index bbf4ccde49f1bfdfd044b9f68a0390190361d3c3..f3e14f3390c46636c986397ddc35d158a1878988 100644 (file)
@@ -246,9 +246,7 @@ Editor::Editor ()
        , range_mark_label (_("Range Markers"))
        , transport_mark_label (_("Loop/Punch Ranges"))
        , cd_mark_label (_("CD Markers"))
-#ifdef WITH_VIDEOTIMELINE
        , videotl_label (_("Video Timeline"))
-#endif
        , edit_packer (4, 4, true)
 
          /* the values here don't matter: layout widgets
@@ -440,7 +438,6 @@ Editor::Editor ()
        cd_mark_label.hide();
        cd_mark_label.set_no_show_all();
 
-#ifdef WITH_VIDEOTIMELINE
        videotl_bar_height = 4;
        videotl_label.set_name ("EditorRulerLabel");
        videotl_label.set_size_request (-1, (int)timebar_height * videotl_bar_height);
@@ -448,7 +445,6 @@ Editor::Editor ()
        videotl_label.set_padding (5,0);
        videotl_label.hide();
        videotl_label.set_no_show_all();
-#endif
 
        range_mark_label.set_name ("EditorRulerLabel");
        range_mark_label.set_size_request (-1, (int)timebar_height);
@@ -496,7 +492,7 @@ Editor::Editor ()
 
        _cursors = new MouseCursors;
 
-       ArdourCanvas::Canvas* time_pad = new ArdourCanvas::GtkCanvas ();
+       ArdourCanvas::GtkCanvas* time_pad = manage (new ArdourCanvas::GtkCanvas ());
 
        ArdourCanvas::Line* pad_line_1 = new ArdourCanvas::Line (time_pad->root());
        pad_line_1->set (ArdourCanvas::Duple (0.0, 1.0), ArdourCanvas::Duple (100.0, 1.0));
@@ -504,7 +500,7 @@ Editor::Editor ()
        pad_line_1->show();
 
        // CAIROCANVAS
-       //time_pad->show();
+       time_pad->show();
 
        time_canvas_vbox.set_size_request (-1, (int)(timebar_height * visible_timebars) + 2);
        time_canvas_vbox.set_size_request (-1, -1);
@@ -4040,7 +4036,7 @@ Editor::restore_editing_space ()
 
 /**
  *  Make new playlists for a given track and also any others that belong
- *  to the same active route group with the `edit' property.
+ *  to the same active route group with the `select' property.
  *  @param v Track.
  */
 
@@ -4056,7 +4052,7 @@ Editor::new_playlists (TimeAxisView* v)
 
 /**
  *  Use a copy of the current playlist for a given track and also any others that belong
- *  to the same active route group with the `edit' property.
+ *  to the same active route group with the `select' property.
  *  @param v Track.
  */
 
@@ -4071,7 +4067,7 @@ Editor::copy_playlists (TimeAxisView* v)
 }
 
 /** Clear the current playlist for a given track and also any others that belong
- *  to the same active route group with the `edit' property.
+ *  to the same active route group with the `select' property.
  *  @param v Track.
  */
 
@@ -4296,7 +4292,6 @@ Editor::set_frames_per_pixel (double fpp)
        instant_save ();
 }
 
-#ifdef WITH_VIDEOTIMELINE
 void
 Editor::queue_visual_videotimeline_update ()
 {
@@ -4309,7 +4304,6 @@ Editor::queue_visual_videotimeline_update ()
         */
        ensure_visual_change_idle_handler ();
 }
-#endif
 
 void
 Editor::ensure_visual_change_idle_handler ()
@@ -4362,11 +4356,9 @@ Editor::idle_visual_changer ()
                update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end);
        }
 
-#ifdef WITH_VIDEOTIMELINE
        if (p & VisualChange::ZoomLevel) {
                update_video_timeline();
        }
-#endif
 
        if (p & VisualChange::TimeOrigin) {
                set_horizontal_position (pending_visual_change.time_origin / frames_per_pixel);
@@ -4381,11 +4373,10 @@ Editor::idle_visual_changer ()
                update_fixed_rulers ();
                redisplay_tempo (true);
        }
-#ifdef WITH_VIDEOTIMELINE
+
        if (!(p & VisualChange::ZoomLevel)) {
                update_video_timeline();
        }
-#endif
 
        _summary->set_overlays_dirty ();
 
@@ -4592,32 +4583,16 @@ Editor::get_regions_after (RegionSelection& rs, framepos_t where, const TrackVie
        }
 }
 
-/** Start with regions that are selected.  Then add equivalent regions
- *  on tracks in the same active edit-enabled route group as any of
- *  the regions that we started with.
- */
-
-RegionSelection
-Editor::get_regions_from_selection ()
-{
-       return get_equivalent_regions (selection->regions, ARDOUR::Properties::select.property_id);
-}
-
 /** Get regions using the following method:
  *
- *  Make an initial region list using the selected regions, unless
+ *  Make a region list using the selected regions, unless
  *  the edit point is `mouse' and the mouse is over an unselected
- *  region.  In this case, start with just that region.
- *
- *  Then, add equivalent regions in active edit groups to the region list.
- *
- *  Then, search the list of selected tracks to find any selected tracks which
- *  do not contain regions already in the region list. If there are no selected
- *  tracks and 'No Selection = All Tracks' is active, search all tracks rather
- *  than just the selected.
+ *  region.  In this case, use just that region.
  *
- *  Add any regions that are under the edit point on these tracks to get the
- *  returned region list.
+ *  If the edit point is not 'mouse', and there are no regions selected,
+ *  search the list of selected tracks and return regions that are under
+ *  the edit point on these tracks. If there are no selected tracks and
+ *  'No Selection = All Tracks' is active, search all tracks,
  *
  *  The rationale here is that the mouse edit point is special in that
  *  its position describes both a time and a track; the other edit
@@ -4639,48 +4614,25 @@ Editor::get_regions_from_selection_and_edit_point ()
                regions = selection->regions;
        }
 
-       TrackViewList tracks;
 
-       if (_edit_point != EditAtMouse) {
-               tracks = selection->tracks;
-       }
+       if (regions.empty() && _edit_point != EditAtMouse) {
+               TrackViewList tracks = selection->tracks;
 
-       /* Add any other regions that are in the same
-          edit-activated route group as one of our regions.
-        */
-       regions = get_equivalent_regions (regions, ARDOUR::Properties::select.property_id);
-       framepos_t const where = get_preferred_edit_position ();
-
-       if (_route_groups->all_group_active_button().get_active() && tracks.empty()) {
-               /* tracks is empty (no track selected), and 'No Selection = All Tracks'
-                * is enabled, so consider all tracks
-                */
-               tracks = track_views; 
-       }
-
-       if (!tracks.empty()) {
-               /* now search the selected tracks for tracks which don't
-                  already contain regions to be acted upon, and get regions at
-                  the edit point on those tracks too.
-                */
-               TrackViewList tracks_without_relevant_regions;
-
-               for (TrackViewList::iterator t = tracks.begin (); t != tracks.end (); ++t) {
-                       if (!regions.involves (**t)) {
-                               /* there are no equivalent regions on this track */
-                               tracks_without_relevant_regions.push_back (*t);
-                       }
+               if (_route_groups->all_group_active_button().get_active() && tracks.empty()) {
+                       /* tracks is empty (no track selected), and 'No Selection = All Tracks'
+                        * is enabled, so consider all tracks
+                        */
+                       tracks = track_views; 
                }
 
-               if (!tracks_without_relevant_regions.empty()) {
-                       /* there are some selected tracks with neither selected
-                        * regions or their equivalents: act upon all regions in
-                        * those tracks
-                        */
-                       get_regions_at (regions, where, tracks_without_relevant_regions);
+               if (!tracks.empty()) {
+                       /* no region selected or entered, but some selected tracks:
+                        * act on all regions on the selected tracks at the edit point
+                        *
+                       framepos_t const where = get_preferred_edit_position ();
+                       get_regions_at(regions, where, tracks);
                }
        }
-
        return regions;
 }
 
@@ -4698,7 +4650,7 @@ Editor::get_regions_from_selection_and_entered ()
                regions.add (entered_regionview);
        }
 
-       return get_equivalent_regions (regions, ARDOUR::Properties::select.property_id);
+       return regions;
 }
 
 void
@@ -4910,7 +4862,7 @@ Editor::add_routes (RouteList& routes)
        for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) {
                boost::shared_ptr<Route> route = (*x);
 
-               if (route->is_hidden() || route->is_monitor()) {
+               if (route->is_auditioner() || route->is_monitor()) {
                        continue;
                }