send enter events to EVERY newly entered item (ignore the bool return from the event...
[ardour.git] / gtk2_ardour / region_view.cc
index 2d3221da265b96ed54c598ad9e38e0f8e6248e4f..530d046f5ae8d823cb1471b62a01dc099ec71380 100644 (file)
@@ -196,8 +196,6 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd)
 
        _region->PropertyChanged.connect (*this, invalidator (*this), boost::bind (&RegionView::region_changed, this, _1), gui_context());
 
-       group->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this));
-
        set_colors ();
 
        ColorsChanged.connect (sigc::mem_fun (*this, &RegionView::color_handler));
@@ -222,6 +220,12 @@ RegionView::~RegionView ()
        delete editor;
 }
 
+bool
+RegionView::canvas_group_event (GdkEvent* event)
+{
+       return trackview.editor().canvas_region_view_event (event, group, this);
+}
+
 void
 RegionView::set_silent_frames (const AudioIntervalResult& silences, double /*threshold*/)
 {
@@ -632,11 +636,12 @@ RegionView::region_sync_changed ()
                /* points set below */
 
                sync_mark = new ArdourCanvas::Polygon (group);
+               CANVAS_DEBUG_NAME (sync_mark, string_compose ("sync mark for %1", get_item_name()));
                sync_mark->set_fill_color (RGBA_TO_UINT(0,255,0,255));    // FIXME make a themeable colour
 
                sync_line = new ArdourCanvas::Line (group);
+               CANVAS_DEBUG_NAME (sync_line, string_compose ("sync mark for %1", get_item_name()));
                sync_line->set_outline_color (RGBA_TO_UINT(0,255,0,255)); // FIXME make a themeable colour
-               sync_line->set_outline_width  (1);
        }
 
        /* this has to handle both a genuine change of position, a change of samples_per_pixel
@@ -931,32 +936,12 @@ RegionView::thaw_after_trim ()
 
 
 void
-RegionView::trim_contents (framepos_t frame_delta, bool left_direction, bool swap_direction)
+RegionView::move_contents (frameoffset_t distance)
 {
        if (_region->locked()) {
                return;
        }
-
-       framepos_t new_bound;
-
-       RouteTimeAxisView& rtv = dynamic_cast<RouteTimeAxisView&> (trackview);
-       double const speed = rtv.track()->speed ();
-
-       if (left_direction) {
-               if (swap_direction) {
-                       new_bound = (framepos_t) (_region->position() / speed) + frame_delta;
-               } else {
-                       new_bound = (framepos_t) (_region->position() / speed) - frame_delta;
-               }
-       } else {
-               if (swap_direction) {
-                       new_bound = (framepos_t) (_region->position() / speed) - frame_delta;
-               } else {
-                       new_bound = (framepos_t) (_region->position() / speed) + frame_delta;
-               }
-       }
-
-       _region->trim_start ((framepos_t) (new_bound * speed));
+       _region->move_start (distance);
        region_changed (PropertyChange (ARDOUR::Properties::start));
 }