hide xfades while dragging region(s)
git-svn-id: svn://localhost/ardour2/branches/3.0@12202 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
aa64629dd3
commit
18b18a45a5
@ -87,7 +87,6 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||
Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
|
||||
: RegionView (parent, tv, r, spu, basic_color, recording, visibility)
|
||||
@ -554,6 +553,10 @@ AudioRegionView::reset_fade_in_shape ()
|
||||
void
|
||||
AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
|
||||
{
|
||||
if (dragging()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (audio_region()->fade_in_is_xfade()) {
|
||||
fade_in_handle->hide ();
|
||||
fade_in_shape->hide ();
|
||||
@ -655,6 +658,10 @@ AudioRegionView::reset_fade_out_shape ()
|
||||
void
|
||||
AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
|
||||
{
|
||||
if (dragging()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (audio_region()->fade_out_is_xfade()) {
|
||||
fade_out_handle->hide ();
|
||||
fade_out_shape->hide ();
|
||||
@ -1510,7 +1517,6 @@ void
|
||||
AudioRegionView::thaw_after_trim ()
|
||||
{
|
||||
RegionView::thaw_after_trim ();
|
||||
|
||||
unhide_envelope ();
|
||||
}
|
||||
|
||||
@ -1519,6 +1525,8 @@ AudioRegionView::redraw_start_xfade ()
|
||||
{
|
||||
boost::shared_ptr<AudioRegion> ar (audio_region());
|
||||
|
||||
cerr << ":RSX\n";
|
||||
|
||||
if (!ar->fade_in() || ar->fade_in()->empty()) {
|
||||
return;
|
||||
}
|
||||
@ -1661,3 +1669,40 @@ AudioRegionView::redraw_end_xfade ()
|
||||
|
||||
delete points;
|
||||
}
|
||||
void
|
||||
AudioRegionView::drag_start ()
|
||||
{
|
||||
TimeAxisViewItem::drag_start ();
|
||||
|
||||
if (start_xfade_in) {
|
||||
start_xfade_in->hide();
|
||||
}
|
||||
if (start_xfade_out) {
|
||||
start_xfade_out->hide();
|
||||
}
|
||||
if (end_xfade_in) {
|
||||
end_xfade_in->hide();
|
||||
}
|
||||
if (end_xfade_out) {
|
||||
end_xfade_out->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegionView::drag_end ()
|
||||
{
|
||||
TimeAxisViewItem::drag_end ();
|
||||
|
||||
if (start_xfade_in) {
|
||||
start_xfade_in->show();
|
||||
}
|
||||
if (start_xfade_out) {
|
||||
start_xfade_out->show();
|
||||
}
|
||||
if (end_xfade_in) {
|
||||
end_xfade_in->show();
|
||||
}
|
||||
if (end_xfade_out) {
|
||||
end_xfade_out->show();
|
||||
}
|
||||
}
|
||||
|
@ -117,6 +117,9 @@ class AudioRegionView : public RegionView
|
||||
|
||||
void thaw_after_trim ();
|
||||
|
||||
void drag_start ();
|
||||
void drag_end ();
|
||||
|
||||
protected:
|
||||
|
||||
/* this constructor allows derived types
|
||||
@ -191,7 +194,6 @@ class AudioRegionView : public RegionView
|
||||
void redraw_end_xfade ();
|
||||
|
||||
private:
|
||||
|
||||
void setup_fade_handle_positions ();
|
||||
|
||||
/** A ScopedConnection for each PeaksReady callback (one per channel). Each member
|
||||
|
@ -663,7 +663,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
|
||||
|
||||
if (first_move) {
|
||||
|
||||
rv->get_time_axis_view().hide_dependent_views (*rv);
|
||||
rv->drag_start ();
|
||||
|
||||
/* Absolutely no idea why this is necessary, but it is; without
|
||||
it, the region view disappears after the reparent.
|
||||
@ -1063,7 +1063,7 @@ RegionMoveDrag::finished_no_copy (
|
||||
|
||||
rv->get_canvas_group()->reparent (*dest_rtv->view()->canvas_item());
|
||||
rv->get_canvas_group()->property_y() = i->initial_y;
|
||||
rv->get_time_axis_view().reveal_dependent_views (*rv);
|
||||
rv->drag_end ();
|
||||
|
||||
/* just change the model */
|
||||
|
||||
@ -1277,7 +1277,7 @@ RegionMotionDrag::aborted (bool)
|
||||
assert (rtv);
|
||||
rv->get_canvas_group()->reparent (*rtv->view()->canvas_item());
|
||||
rv->get_canvas_group()->property_y() = 0;
|
||||
rv->get_time_axis_view().reveal_dependent_views (*rv);
|
||||
rv->drag_end ();
|
||||
rv->fake_set_opaque (false);
|
||||
rv->move (-_total_x_delta, 0);
|
||||
rv->set_height (rtv->view()->child_height ());
|
||||
@ -1706,6 +1706,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
|
||||
|
||||
if (arv) {
|
||||
arv->temporarily_hide_envelope ();
|
||||
arv->drag_start ();
|
||||
}
|
||||
|
||||
boost::shared_ptr<Playlist> pl = rv->region()->playlist();
|
||||
|
@ -160,9 +160,6 @@ class TimeAxisView : public virtual AxisView
|
||||
virtual void show_timestretch (framepos_t start, framepos_t end);
|
||||
virtual void hide_timestretch ();
|
||||
|
||||
virtual void hide_dependent_views (TimeAxisViewItem&) {}
|
||||
virtual void reveal_dependent_views (TimeAxisViewItem&) {}
|
||||
|
||||
/* editing operations */
|
||||
|
||||
virtual void cut_copy_clear (Selection&, Editing::CutCopyOp) {}
|
||||
|
@ -103,6 +103,7 @@ TimeAxisViewItem::TimeAxisViewItem(
|
||||
, _height (1.0)
|
||||
, _recregion (recording)
|
||||
, _automation (automation)
|
||||
, _dragging (false)
|
||||
{
|
||||
group = new ArdourCanvas::Group (parent);
|
||||
|
||||
@ -116,6 +117,7 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
|
||||
, trackview (other.trackview)
|
||||
, _recregion (other._recregion)
|
||||
, _automation (other._automation)
|
||||
, _dragging (other._dragging)
|
||||
{
|
||||
|
||||
Gdk::Color c;
|
||||
@ -132,10 +134,8 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
|
||||
|
||||
_selected = other._selected;
|
||||
|
||||
init (
|
||||
other.item_name, other.samples_per_unit, c, other.frame_position,
|
||||
other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name
|
||||
);
|
||||
init (other.item_name, other.samples_per_unit, c, other.frame_position,
|
||||
other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -78,6 +78,10 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
|
||||
|
||||
double get_samples_per_unit();
|
||||
|
||||
virtual void drag_start() { _dragging = true; }
|
||||
virtual void drag_end() { _dragging = false; }
|
||||
bool dragging() const { return _dragging; }
|
||||
|
||||
virtual void raise () { return; }
|
||||
virtual void raise_to_top () { return; }
|
||||
virtual void lower () { return; }
|
||||
@ -240,6 +244,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
|
||||
Visibility visibility;
|
||||
bool _recregion;
|
||||
bool _automation; ///< true if this is an automation region view
|
||||
bool _dragging;
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user