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,
|
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
|
||||||
Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
|
Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
|
||||||
: RegionView (parent, tv, r, spu, basic_color, recording, visibility)
|
: RegionView (parent, tv, r, spu, basic_color, recording, visibility)
|
||||||
|
@ -554,6 +553,10 @@ AudioRegionView::reset_fade_in_shape ()
|
||||||
void
|
void
|
||||||
AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
|
AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
|
||||||
{
|
{
|
||||||
|
if (dragging()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (audio_region()->fade_in_is_xfade()) {
|
if (audio_region()->fade_in_is_xfade()) {
|
||||||
fade_in_handle->hide ();
|
fade_in_handle->hide ();
|
||||||
fade_in_shape->hide ();
|
fade_in_shape->hide ();
|
||||||
|
@ -655,6 +658,10 @@ AudioRegionView::reset_fade_out_shape ()
|
||||||
void
|
void
|
||||||
AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
|
AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
|
||||||
{
|
{
|
||||||
|
if (dragging()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (audio_region()->fade_out_is_xfade()) {
|
if (audio_region()->fade_out_is_xfade()) {
|
||||||
fade_out_handle->hide ();
|
fade_out_handle->hide ();
|
||||||
fade_out_shape->hide ();
|
fade_out_shape->hide ();
|
||||||
|
@ -1510,7 +1517,6 @@ void
|
||||||
AudioRegionView::thaw_after_trim ()
|
AudioRegionView::thaw_after_trim ()
|
||||||
{
|
{
|
||||||
RegionView::thaw_after_trim ();
|
RegionView::thaw_after_trim ();
|
||||||
|
|
||||||
unhide_envelope ();
|
unhide_envelope ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1518,6 +1524,8 @@ void
|
||||||
AudioRegionView::redraw_start_xfade ()
|
AudioRegionView::redraw_start_xfade ()
|
||||||
{
|
{
|
||||||
boost::shared_ptr<AudioRegion> ar (audio_region());
|
boost::shared_ptr<AudioRegion> ar (audio_region());
|
||||||
|
|
||||||
|
cerr << ":RSX\n";
|
||||||
|
|
||||||
if (!ar->fade_in() || ar->fade_in()->empty()) {
|
if (!ar->fade_in() || ar->fade_in()->empty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1661,3 +1669,40 @@ AudioRegionView::redraw_end_xfade ()
|
||||||
|
|
||||||
delete points;
|
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 thaw_after_trim ();
|
||||||
|
|
||||||
|
void drag_start ();
|
||||||
|
void drag_end ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/* this constructor allows derived types
|
/* this constructor allows derived types
|
||||||
|
@ -191,7 +194,6 @@ class AudioRegionView : public RegionView
|
||||||
void redraw_end_xfade ();
|
void redraw_end_xfade ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void setup_fade_handle_positions ();
|
void setup_fade_handle_positions ();
|
||||||
|
|
||||||
/** A ScopedConnection for each PeaksReady callback (one per channel). Each member
|
/** 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) {
|
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
|
/* Absolutely no idea why this is necessary, but it is; without
|
||||||
it, the region view disappears after the reparent.
|
it, the region view disappears after the reparent.
|
||||||
|
@ -698,15 +698,15 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
|
||||||
if (tv->view()->layer_display() == Stacked) {
|
if (tv->view()->layer_display() == Stacked) {
|
||||||
tv->view()->set_layer_display (Expanded);
|
tv->view()->set_layer_display (Expanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We're only allowed to go -ve in layer on Expanded views */
|
/* We're only allowed to go -ve in layer on Expanded views */
|
||||||
if (tv->view()->layer_display() != Expanded && (i->layer + this_delta_layer) < 0) {
|
if (tv->view()->layer_display() != Expanded && (i->layer + this_delta_layer) < 0) {
|
||||||
this_delta_layer = - i->layer;
|
this_delta_layer = - i->layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set height */
|
/* Set height */
|
||||||
rv->set_height (tv->view()->child_height ());
|
rv->set_height (tv->view()->child_height ());
|
||||||
|
|
||||||
/* Update show/hidden status as the region view may have come from a hidden track,
|
/* Update show/hidden status as the region view may have come from a hidden track,
|
||||||
or have moved to one.
|
or have moved to one.
|
||||||
*/
|
*/
|
||||||
|
@ -1063,7 +1063,7 @@ RegionMoveDrag::finished_no_copy (
|
||||||
|
|
||||||
rv->get_canvas_group()->reparent (*dest_rtv->view()->canvas_item());
|
rv->get_canvas_group()->reparent (*dest_rtv->view()->canvas_item());
|
||||||
rv->get_canvas_group()->property_y() = i->initial_y;
|
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 */
|
/* just change the model */
|
||||||
|
|
||||||
|
@ -1277,7 +1277,7 @@ RegionMotionDrag::aborted (bool)
|
||||||
assert (rtv);
|
assert (rtv);
|
||||||
rv->get_canvas_group()->reparent (*rtv->view()->canvas_item());
|
rv->get_canvas_group()->reparent (*rtv->view()->canvas_item());
|
||||||
rv->get_canvas_group()->property_y() = 0;
|
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->fake_set_opaque (false);
|
||||||
rv->move (-_total_x_delta, 0);
|
rv->move (-_total_x_delta, 0);
|
||||||
rv->set_height (rtv->view()->child_height ());
|
rv->set_height (rtv->view()->child_height ());
|
||||||
|
@ -1706,6 +1706,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
|
||||||
|
|
||||||
if (arv) {
|
if (arv) {
|
||||||
arv->temporarily_hide_envelope ();
|
arv->temporarily_hide_envelope ();
|
||||||
|
arv->drag_start ();
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<Playlist> pl = rv->region()->playlist();
|
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 show_timestretch (framepos_t start, framepos_t end);
|
||||||
virtual void hide_timestretch ();
|
virtual void hide_timestretch ();
|
||||||
|
|
||||||
virtual void hide_dependent_views (TimeAxisViewItem&) {}
|
|
||||||
virtual void reveal_dependent_views (TimeAxisViewItem&) {}
|
|
||||||
|
|
||||||
/* editing operations */
|
/* editing operations */
|
||||||
|
|
||||||
virtual void cut_copy_clear (Selection&, Editing::CutCopyOp) {}
|
virtual void cut_copy_clear (Selection&, Editing::CutCopyOp) {}
|
||||||
|
|
|
@ -103,6 +103,7 @@ TimeAxisViewItem::TimeAxisViewItem(
|
||||||
, _height (1.0)
|
, _height (1.0)
|
||||||
, _recregion (recording)
|
, _recregion (recording)
|
||||||
, _automation (automation)
|
, _automation (automation)
|
||||||
|
, _dragging (false)
|
||||||
{
|
{
|
||||||
group = new ArdourCanvas::Group (parent);
|
group = new ArdourCanvas::Group (parent);
|
||||||
|
|
||||||
|
@ -116,6 +117,7 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
|
||||||
, trackview (other.trackview)
|
, trackview (other.trackview)
|
||||||
, _recregion (other._recregion)
|
, _recregion (other._recregion)
|
||||||
, _automation (other._automation)
|
, _automation (other._automation)
|
||||||
|
, _dragging (other._dragging)
|
||||||
{
|
{
|
||||||
|
|
||||||
Gdk::Color c;
|
Gdk::Color c;
|
||||||
|
@ -132,10 +134,8 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
|
||||||
|
|
||||||
_selected = other._selected;
|
_selected = other._selected;
|
||||||
|
|
||||||
init (
|
init (other.item_name, other.samples_per_unit, c, other.frame_position,
|
||||||
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);
|
||||||
other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -78,6 +78,10 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
|
||||||
|
|
||||||
double get_samples_per_unit();
|
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 () { return; }
|
||||||
virtual void raise_to_top () { return; }
|
virtual void raise_to_top () { return; }
|
||||||
virtual void lower () { return; }
|
virtual void lower () { return; }
|
||||||
|
@ -240,6 +244,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
|
||||||
Visibility visibility;
|
Visibility visibility;
|
||||||
bool _recregion;
|
bool _recregion;
|
||||||
bool _automation; ///< true if this is an automation region view
|
bool _automation; ///< true if this is an automation region view
|
||||||
|
bool _dragging;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user