diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index d1a92ee6a5..0669f0c389 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -1920,7 +1920,7 @@ AudioRegionView::show_xfades () void AudioRegionView::drag_start () { - TimeAxisViewItem::drag_start (); + RegionView::drag_start (); //we used to hide xfades here. I don't see the point with the new model, but we can re-implement if needed } diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 37a2c6f90e..26c0b72193 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2795,11 +2795,12 @@ TrimDrag::motion (GdkEvent* event, bool first_move) rv->trim_front_starting (); } + rv->drag_start (); + AudioRegionView* const arv = dynamic_cast (rv); if (arv) { arv->temporarily_hide_envelope (); - arv->drag_start (); } std::shared_ptr pl = rv->region ()->playlist (); @@ -2875,10 +2876,13 @@ TrimDrag::motion (GdkEvent* event, bool first_move) } } + bool changed = false; + switch (_operation) { case StartTrim: for (list::iterator i = _views.begin (); i != _views.end (); ++i) { - bool changed = i->view->trim_front (timepos_t (i->initial_position) + dt, non_overlap_trim); + changed = i->view->trim_front (timepos_t (i->initial_position) + dt, non_overlap_trim); + if (changed && _preserve_fade_anchor) { AudioRegionView* arv = dynamic_cast (i->view); @@ -2899,7 +2903,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move) case EndTrim: for (list::iterator i = _views.begin (); i != _views.end (); ++i) { - bool changed = i->view->trim_end (timepos_t (i->initial_end) + dt, non_overlap_trim); + changed = i->view->trim_end (timepos_t (i->initial_end) + dt, non_overlap_trim); if (changed && _preserve_fade_anchor) { AudioRegionView* arv = dynamic_cast (i->view); @@ -2917,6 +2921,13 @@ TrimDrag::motion (GdkEvent* event, bool first_move) break; } + if (changed) { + for (list::const_iterator i = _views.begin (); i != _views.end (); ++i) { + StreamView* sv = i->view->get_time_axis_view ().view (); + sv->update_coverage_frame (); + } + } + switch (_operation) { case StartTrim: show_verbose_cursor_time (rv->region ()->position ()); diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 7ce3fea02c..76f06391d7 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -963,17 +963,22 @@ RegionView::set_height (double h) } } +void +RegionView::clear_coverage_frame () +{ + for (auto& i : _coverage_frame) { + delete i; + } + _coverage_frame.clear (); +} + /** Remove old coverage frame and make new ones, if we're in a LayerDisplay mode * which uses them. */ void RegionView::update_coverage_frame (LayerDisplay d) { /* remove old coverage frame */ - for (auto& i : _coverage_frame) { - delete i; - } - - _coverage_frame.clear (); + clear_coverage_frame (); if (d != Stacked) { /* don't do coverage frame unless we're in stacked mode */ diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h index d4b73cff29..057c2810fa 100644 --- a/gtk2_ardour/region_view.h +++ b/gtk2_ardour/region_view.h @@ -238,6 +238,8 @@ private: void update_cue_markers (); + void clear_coverage_frame (); + struct ViewCueMarker { ArdourMarker* view_marker; ARDOUR::CueMarker model_marker; diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h index 5584dd00c6..024551f96c 100644 --- a/gtk2_ardour/streamview.h +++ b/gtk2_ardour/streamview.h @@ -126,6 +126,7 @@ public: void check_record_layers (std::shared_ptr, ARDOUR::samplepos_t); virtual void playlist_layered (std::weak_ptr); + void update_coverage_frame (); sigc::signal RegionViewAdded; sigc::signal RegionViewRemoved; @@ -193,9 +194,6 @@ protected: */ samplepos_t _new_rec_layer_time; void setup_new_rec_layer_time (std::shared_ptr); - -private: - void update_coverage_frame (); }; #endif /* __ardour_streamview_h__ */