summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/audio_region_view.cc170
-rw-r--r--gtk2_ardour/audio_region_view.h4
-rw-r--r--gtk2_ardour/editor_canvas_events.cc5
-rw-r--r--gtk2_ardour/editor_drag.cc101
-rw-r--r--gtk2_ardour/editor_drag.h4
-rw-r--r--gtk2_ardour/editor_mouse.cc10
-rw-r--r--gtk2_ardour/region_view.cc12
-rw-r--r--gtk2_ardour/region_view.h4
-rw-r--r--gtk2_ardour/session_option_editor.cc32
9 files changed, 133 insertions, 209 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index 7e51d28997..b1ffbd7d4b 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -77,7 +77,6 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView
, fade_out_shape(0)
, fade_in_handle(0)
, fade_out_handle(0)
- , fade_position_line(0)
, start_xfade_in (0)
, start_xfade_out (0)
, start_xfade_rect (0)
@@ -100,7 +99,6 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView
, fade_out_shape(0)
, fade_in_handle(0)
, fade_out_handle(0)
- , fade_position_line(0)
, start_xfade_in (0)
, start_xfade_out (0)
, start_xfade_rect (0)
@@ -121,7 +119,6 @@ AudioRegionView::AudioRegionView (const AudioRegionView& other, boost::shared_pt
, fade_out_shape(0)
, fade_in_handle(0)
, fade_out_handle(0)
- , fade_position_line(0)
, start_xfade_in (0)
, start_xfade_out (0)
, start_xfade_rect (0)
@@ -178,13 +175,6 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
fade_out_handle->set_data ("regionview", this);
-
- fade_position_line = new ArdourCanvas::SimpleLine (*group);
- fade_position_line->property_color_rgba() = 0xBBBBBBAA;
- fade_position_line->property_y1() = 7;
- fade_position_line->property_y2() = _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1;
-
- fade_position_line->hide();
}
setup_fade_handle_positions ();
@@ -286,12 +276,6 @@ AudioRegionView::region_changed (const PropertyChange& what_changed)
if (what_changed.contains (ARDOUR::Properties::fade_out_active)) {
fade_out_active_changed ();
}
- if (what_changed.contains (ARDOUR::Properties::fade_in_is_xfade)) {
- fade_in_changed ();
- }
- if (what_changed.contains (ARDOUR::Properties::fade_out_is_xfade)) {
- fade_out_changed ();
- }
if (what_changed.contains (ARDOUR::Properties::envelope_active)) {
envelope_active_changed ();
}
@@ -523,16 +507,6 @@ AudioRegionView::set_height (gdouble height)
(*l).second->property_points() = points;
}
- if (fade_position_line) {
-
- if (height < NAME_HIGHLIGHT_THRESH) {
- fade_position_line->property_y2() = _height - 1;
- }
- else {
- fade_position_line->property_y2() = _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1;
- }
- }
-
if (name_pixbuf) {
name_pixbuf->raise_to_top();
}
@@ -554,25 +528,7 @@ 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()) {
- if (fade_in_handle) {
- fade_in_handle->hide ();
- fade_in_shape->hide ();
- }
- redraw_start_xfade ();
- return;
- } else {
- if (start_xfade_in) {
- start_xfade_in->hide ();
- start_xfade_out->hide ();
- start_xfade_rect->hide ();
- _start_xfade_visible = false;
- }
- }
+ redraw_start_xfade ();
if (fade_in_handle == 0) {
return;
@@ -591,12 +547,6 @@ AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
double h;
- if (_height < 5) {
- fade_in_shape->hide();
- fade_in_handle->hide();
- return;
- }
-
double const handle_center = pwidth;
/* Put the fade in handle so that its left side is at the end-of-fade line */
@@ -620,7 +570,7 @@ AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
if (_height >= NAME_HIGHLIGHT_THRESH) {
h = _height - NAME_HIGHLIGHT_SIZE - 2;
} else {
- h = _height;
+ h = _height - 2;
}
/* points *MUST* be in anti-clockwise order */
@@ -663,26 +613,7 @@ AudioRegionView::reset_fade_out_shape ()
void
AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
{
- if (dragging() && audio_region()->fade_out_is_xfade()) {
- /* we hide xfades while dragging regions */
- return;
- }
-
- if (audio_region()->fade_out_is_xfade()) {
- if (fade_out_handle) {
- fade_out_handle->hide ();
- fade_out_shape->hide ();
- }
- redraw_end_xfade ();
- return;
- } else {
- if (end_xfade_in) {
- end_xfade_in->hide ();
- end_xfade_out->hide ();
- end_xfade_rect->hide ();
- _end_xfade_visible = false;
- }
- }
+ redraw_end_xfade ();
if (fade_out_handle == 0) {
return;
@@ -701,12 +632,6 @@ AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
double h;
- if (_height < 5) {
- fade_out_shape->hide();
- fade_out_handle->hide();
- return;
- }
-
double const handle_center = (_region->length() - width) / samples_per_unit;
/* Put the fade out handle so that its right side is at the end-of-fade line;
@@ -732,7 +657,7 @@ AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
if (_height >= NAME_HIGHLIGHT_THRESH) {
h = _height - NAME_HIGHLIGHT_SIZE - 2;
} else {
- h = _height;
+ h = _height - 2;
}
/* points *MUST* be in anti-clockwise order */
@@ -1346,23 +1271,6 @@ AudioRegionView::show_region_editor ()
editor->show_all();
}
-
-void
-AudioRegionView::show_fade_line (framepos_t pos)
-{
- fade_position_line->property_x1() = trackview.editor().frame_to_pixel (pos);
- fade_position_line->property_x2() = trackview.editor().frame_to_pixel (pos);
- fade_position_line->show ();
- fade_position_line->raise_to_top ();
-}
-
-void
-AudioRegionView::hide_fade_line ()
-{
- fade_position_line->hide ();
-}
-
-
void
AudioRegionView::transients_changed ()
{
@@ -1480,15 +1388,7 @@ AudioRegionView::redraw_start_xfade ()
return;
}
- if (!ar->fade_in_is_xfade()) {
- if (start_xfade_in) {
- start_xfade_in->hide ();
- start_xfade_out->hide ();
- start_xfade_rect->hide ();
- _start_xfade_visible = false;
- }
- return;
- }
+ show_start_xfade();
redraw_start_xfade_to (ar, ar->fade_in()->back()->when);
}
@@ -1511,7 +1411,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
if (!start_xfade_out) {
start_xfade_out = new ArdourCanvas::Line (*group);
start_xfade_out->property_width_pixels() = 1;
- uint32_t col = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 125);
+ uint32_t col = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 255);
start_xfade_out->property_fill_color_rgba() = col;
}
@@ -1527,7 +1427,13 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
Points* points = get_canvas_points ("xfade edit redraw", npoints);
boost::scoped_array<float> vec (new float[npoints]);
- double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1.0;
+
+ double effective_height;
+ if (_height >= NAME_HIGHLIGHT_THRESH) {
+ effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
+ } else {
+ effective_height = _height - 2;
+ }
ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);
@@ -1542,7 +1448,6 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
start_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
start_xfade_rect->property_y2() = effective_height;
start_xfade_rect->show ();
- start_xfade_rect->raise_to_top ();
start_xfade_in->property_points() = *points;
start_xfade_in->show ();
@@ -1575,7 +1480,9 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
start_xfade_out->show ();
start_xfade_out->raise_to_top ();
- _start_xfade_visible = true;
+ start_xfade_rect->raise_to_top (); //this needs to be topmost so the lines don't steal mouse focus
+
+ show_start_xfade();
delete points;
}
@@ -1589,15 +1496,7 @@ AudioRegionView::redraw_end_xfade ()
return;
}
- if (!ar->fade_out_is_xfade()) {
- if (end_xfade_in) {
- end_xfade_in->hide ();
- end_xfade_out->hide ();
- end_xfade_rect->hide ();
- _end_xfade_visible = false;
- }
- return;
- }
+ show_end_xfade();
redraw_end_xfade_to (ar, ar->fade_out()->back()->when);
}
@@ -1620,7 +1519,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
if (!end_xfade_out) {
end_xfade_out = new ArdourCanvas::Line (*group);
end_xfade_out->property_width_pixels() = 1;
- uint32_t col UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 125);
+ uint32_t col UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 255);
end_xfade_out->property_fill_color_rgba() = col;
}
@@ -1640,7 +1539,13 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);
double rend = trackview.editor().frame_to_pixel (_region->length() - len);
- double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1;
+
+ double effective_height;
+ if (_height >= NAME_HIGHLIGHT_THRESH) {
+ effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
+ } else {
+ effective_height = _height - 2;
+ }
for (int i = 0, pci = 0; i < npoints; ++i) {
Gnome::Art::Point &p ((*points)[pci++]);
@@ -1653,7 +1558,6 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
end_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
end_xfade_rect->property_y2() = effective_height;
end_xfade_rect->show ();
- end_xfade_rect->raise_to_top ();
end_xfade_in->property_points() = *points;
end_xfade_in->show ();
@@ -1686,7 +1590,9 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
end_xfade_out->show ();
end_xfade_out->raise_to_top ();
- _end_xfade_visible = true;
+ end_xfade_rect->raise_to_top (); //this needs to be topmost so the lines don't steal mouse focus
+
+ show_end_xfade();
delete points;
}
@@ -1773,15 +1679,8 @@ void
AudioRegionView::drag_start ()
{
TimeAxisViewItem::drag_start ();
- AudioTimeAxisView* atav = dynamic_cast<AudioTimeAxisView*> (&trackview);
- if (atav) {
- AudioStreamView* av = atav->audio_view();
- if (av) {
- /* this will hide our xfades too */
- _hidden_xfades = av->hide_xfades_with (audio_region());
- }
- }
+ //we used to hide xfades here. I don't see the point with the new model, but we can re-implement if needed
}
void
@@ -1789,16 +1688,7 @@ AudioRegionView::drag_end ()
{
TimeAxisViewItem::drag_end ();
- for (list<AudioRegionView*>::iterator i = _hidden_xfades.first.begin(); i != _hidden_xfades.first.end(); ++i) {
- (*i)->show_start_xfade ();
- }
-
- for (list<AudioRegionView*>::iterator i = _hidden_xfades.second.begin(); i != _hidden_xfades.second.end(); ++i) {
- (*i)->show_end_xfade ();
- }
-
- _hidden_xfades.first.clear ();
- _hidden_xfades.second.clear ();
+ //see comment for drag_start
}
void
diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h
index 85a1b1d869..6f6d76d06b 100644
--- a/gtk2_ardour/audio_region_view.h
+++ b/gtk2_ardour/audio_region_view.h
@@ -97,9 +97,6 @@ class AudioRegionView : public RegionView
framepos_t get_fade_in_shape_width ();
framepos_t get_fade_out_shape_width ();
- void show_fade_line(framepos_t pos);
- void hide_fade_line();
-
void set_fade_visibility (bool);
void update_coverage_frames (LayerDisplay);
@@ -159,7 +156,6 @@ class AudioRegionView : public RegionView
ArdourCanvas::Polygon* fade_out_shape;
ArdourCanvas::SimpleRect* fade_in_handle; ///< fade in handle, or 0
ArdourCanvas::SimpleRect* fade_out_handle; ///< fade out handle, or 0
- ArdourCanvas::SimpleLine* fade_position_line;
ArdourCanvas::Line *start_xfade_in;
ArdourCanvas::Line *start_xfade_out;
diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc
index 15bd51b3ba..fffd5fd15e 100644
--- a/gtk2_ardour/editor_canvas_events.cc
+++ b/gtk2_ardour/editor_canvas_events.cc
@@ -383,7 +383,10 @@ Editor::canvas_start_xfade_event (GdkEvent *event, ArdourCanvas::Item* item, Aud
}
- return typed_event (item, event, StartCrossFadeItem);
+ /* In Mixbus, the crossfade area is used to trim the region while leaving the fade anchor intact (see preserve_fade_anchor)*/
+ /* however in A3 this feature is unfinished, and it might be better to do it with a modifier-trim instead, anyway */
+ /* if we return RegionItem here then we avoid the issue until it is resolved later */
+ return typed_event (item, event, RegionItem); // StartCrossFadeItem);
}
bool
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 8f149f24e6..d13b81e916 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -1597,10 +1597,11 @@ NoteResizeDrag::aborted (bool)
}
}
-TrimDrag::TrimDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v)
+TrimDrag::TrimDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v, bool preserve_fade_anchor)
: RegionDrag (e, i, p, v)
{
DEBUG_TRACE (DEBUG::Drags, "New TrimDrag\n");
+ _preserve_fade_anchor = preserve_fade_anchor;
}
void
@@ -1722,13 +1723,43 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
switch (_operation) {
case StartTrim:
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
- i->view->trim_front (i->initial_position + dt, non_overlap_trim);
+ bool changed = i->view->trim_front (i->initial_position + dt, non_overlap_trim);
+ if (changed && _preserve_fade_anchor) {
+ AudioRegionView* arv = dynamic_cast<AudioRegionView*> (i->view);
+ if (arv) {
+ double distance;
+ double new_length;
+ framecnt_t len;
+ boost::shared_ptr<AudioRegion> ar (arv->audio_region());
+ distance = _drags->current_pointer_x() - grab_x();
+ len = ar->fade_in()->back()->when;
+ new_length = len - _editor->unit_to_frame (distance);
+ new_length = ar->verify_xfade_bounds (new_length, true /*START*/ );
+ arv->reset_fade_in_shape_width (new_length); //the grey shape
+ arv->redraw_start_xfade_to (ar, new_length); //the green lines & blue rect
+ }
+ }
}
break;
case EndTrim:
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
- i->view->trim_end (i->initial_end + dt, non_overlap_trim);
+ bool changed = i->view->trim_end (i->initial_end + dt, non_overlap_trim);
+ if (changed && _preserve_fade_anchor) {
+ AudioRegionView* arv = dynamic_cast<AudioRegionView*> (i->view);
+ if (arv) {
+ double distance;
+ double new_length;
+ framecnt_t len;
+ boost::shared_ptr<AudioRegion> ar (arv->audio_region());
+ distance = grab_x() - _drags->current_pointer_x();
+ len = ar->fade_out()->back()->when;
+ new_length = len - _editor->unit_to_frame (distance);
+ new_length = ar->verify_xfade_bounds (new_length, false /*END*/ );
+ arv->reset_fade_out_shape_width (new_length); //the grey shape
+ arv->redraw_end_xfade_to (ar, new_length); //the green lines & blue rect (must do this after)
+ }
+ }
}
break;
@@ -1780,20 +1811,49 @@ TrimDrag::finished (GdkEvent* event, bool movement_occurred)
if (movement_occurred) {
motion (event, false);
- for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
- i->view->drag_end ();
- }
-
- /* This must happen before the region's StatefulDiffCommand is created, as it may
- `correct' (ahem) the region's _start from being negative to being zero. It
- needs to be zero in the undo record.
- */
if (_operation == StartTrim) {
for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
- i->view->trim_front_ending ();
+ {
+ /* This must happen before the region's StatefulDiffCommand is created, as it may
+ `correct' (ahem) the region's _start from being negative to being zero. It
+ needs to be zero in the undo record.
+ */
+ i->view->trim_front_ending ();
+ }
+ if (_preserve_fade_anchor) {
+ AudioRegionView* arv = dynamic_cast<AudioRegionView*> (i->view);
+ if (arv) {
+ double distance;
+ double new_length;
+ framecnt_t len;
+ boost::shared_ptr<AudioRegion> ar (arv->audio_region());
+ distance = _drags->current_pointer_x() - grab_x();
+ len = ar->fade_in()->back()->when;
+ new_length = len - _editor->unit_to_frame (distance);
+ new_length = ar->verify_xfade_bounds (new_length, true /*START*/ );
+ ar->set_fade_in_length(new_length);
+ }
+ }
+ }
+ } else if (_operation == EndTrim) {
+ for (list<DraggingView>::const_iterator i = _views.begin(); i != _views.end(); ++i) {
+ if (_preserve_fade_anchor) {
+ AudioRegionView* arv = dynamic_cast<AudioRegionView*> (i->view);
+ if (arv) {
+ double distance;
+ double new_length;
+ framecnt_t len;
+ boost::shared_ptr<AudioRegion> ar (arv->audio_region());
+ distance = _drags->current_pointer_x() - grab_x();
+ len = ar->fade_out()->back()->when;
+ new_length = len - _editor->unit_to_frame (distance);
+ new_length = ar->verify_xfade_bounds (new_length, false /*END*/ );
+ ar->set_fade_out_length(new_length);
+ }
+ }
}
}
-
+
if (_operation == StartTrim) {
_editor->maybe_locate_with_edit_preroll ( _views.begin()->view->region()->position() );
}
@@ -2254,8 +2314,6 @@ FadeInDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
boost::shared_ptr<AudioRegion> const r = arv->audio_region ();
show_verbose_cursor_duration (r->position(), r->position() + r->fade_in()->back()->when, 32);
-
- arv->show_fade_line((framepos_t) r->fade_in()->back()->when);
}
void
@@ -2292,7 +2350,8 @@ FadeInDrag::motion (GdkEvent* event, bool)
}
tmp->reset_fade_in_shape_width (fade_length);
- tmp->show_fade_line((framecnt_t) fade_length);
+ boost::shared_ptr<AudioRegion> ar (tmp->audio_region());
+ tmp->redraw_start_xfade_to (ar, fade_length);
}
show_verbose_cursor_duration (region->position(), region->position() + fade_length, 32);
@@ -2334,7 +2393,6 @@ FadeInDrag::finished (GdkEvent* event, bool movement_occurred)
tmp->audio_region()->set_fade_in_length (fade_length);
tmp->audio_region()->set_fade_in_active (true);
- tmp->hide_fade_line();
XMLNode &after = alist->get_state();
_editor->session()->add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &after));
@@ -2354,7 +2412,6 @@ FadeInDrag::aborted (bool)
}
tmp->reset_fade_in_shape_width (tmp->audio_region()->fade_in()->back()->when);
- tmp->hide_fade_line();
}
}
@@ -2373,8 +2430,6 @@ FadeOutDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
boost::shared_ptr<AudioRegion> r = arv->audio_region ();
show_verbose_cursor_duration (r->last_frame() - r->fade_out()->back()->when, r->last_frame());
-
- arv->show_fade_line(r->length() - r->fade_out()->back()->when);
}
void
@@ -2413,7 +2468,8 @@ FadeOutDrag::motion (GdkEvent* event, bool)
}
tmp->reset_fade_out_shape_width (fade_length);
- tmp->show_fade_line(region->length() - fade_length);
+ boost::shared_ptr<AudioRegion> ar (tmp->audio_region());
+ tmp->redraw_end_xfade_to (ar, fade_length);
}
show_verbose_cursor_duration (region->last_frame() - fade_length, region->last_frame());
@@ -2457,7 +2513,6 @@ FadeOutDrag::finished (GdkEvent* event, bool movement_occurred)
tmp->audio_region()->set_fade_out_length (fade_length);
tmp->audio_region()->set_fade_out_active (true);
- tmp->hide_fade_line();
XMLNode &after = alist->get_state();
_editor->session()->add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &after));
@@ -2477,7 +2532,6 @@ FadeOutDrag::aborted (bool)
}
tmp->reset_fade_out_shape_width (tmp->audio_region()->fade_out()->back()->when);
- tmp->hide_fade_line();
}
}
@@ -4583,6 +4637,7 @@ CrossfadeEdgeDrag::CrossfadeEdgeDrag (Editor* e, AudioRegionView* rv, ArdourCanv
, arv (rv)
, start (start_yn)
{
+ std::cout << ("CrossfadeEdgeDrag is DEPRECATED. See TrimDrag::preserve_fade_anchor") << endl;
}
void
diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h
index 2177555856..f18a40a9e2 100644
--- a/gtk2_ardour/editor_drag.h
+++ b/gtk2_ardour/editor_drag.h
@@ -515,7 +515,7 @@ public:
ContentsTrim,
};
- TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &);
+ TrimDrag (Editor *, ArdourCanvas::Item *, RegionView*, std::list<RegionView*> const &, bool preserve_fade_anchor = false);
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
void motion (GdkEvent *, bool);
@@ -531,6 +531,8 @@ public:
private:
Operation _operation;
+
+ bool _preserve_fade_anchor;
};
/** Meter marker drag */
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 97cbc4a9ff..cce09f8baf 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -922,11 +922,13 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
}
case StartCrossFadeItem:
- _drags->set (new CrossfadeEdgeDrag (this, reinterpret_cast<AudioRegionView*>(item->get_data("regionview")), item, true), event, 0);
- break;
-
case EndCrossFadeItem:
- _drags->set (new CrossfadeEdgeDrag (this, reinterpret_cast<AudioRegionView*>(item->get_data("regionview")), item, false), event, 0);
+ /* we might allow user to grab inside the fade to trim a region with preserve_fade_anchor. for not this is not fully implemented */
+// if (!clicked_regionview->region()->locked()) {
+// RegionSelection s = get_equivalent_regions (selection->regions, Properties::edit.property_id);
+// _drags->set (new TrimDrag (this, item, clicked_regionview, s.by_layer(), true), event);
+// return true;
+// }
break;
case FeatureLineItem:
diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc
index 312666c18a..8ea84409cc 100644
--- a/gtk2_ardour/region_view.cc
+++ b/gtk2_ardour/region_view.cc
@@ -834,11 +834,11 @@ RegionView::update_coverage_frames (LayerDisplay d)
}
}
-void
+bool
RegionView::trim_front (framepos_t new_bound, bool no_overlap)
{
if (_region->locked()) {
- return;
+ return false;
}
RouteTimeAxisView& rtv = dynamic_cast<RouteTimeAxisView&> (trackview);
@@ -866,13 +866,15 @@ RegionView::trim_front (framepos_t new_bound, bool no_overlap)
}
region_changed (ARDOUR::bounds_change);
+
+ return (pre_trim_first_frame != _region->first_frame()); //return true if we actually changed something
}
-void
+bool
RegionView::trim_end (framepos_t new_bound, bool no_overlap)
{
if (_region->locked()) {
- return;
+ return false;
}
RouteTimeAxisView& rtv = dynamic_cast<RouteTimeAxisView&> (trackview);
@@ -903,6 +905,8 @@ RegionView::trim_end (framepos_t new_bound, bool no_overlap)
} else {
region_changed (PropertyChange (ARDOUR::Properties::length));
}
+
+ return (pre_trim_last_frame != _region->last_frame()); //return true if we actually changed something
}
diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h
index 901e2a8596..1eda8fd360 100644
--- a/gtk2_ardour/region_view.h
+++ b/gtk2_ardour/region_view.h
@@ -107,12 +107,12 @@ class RegionView : public TimeAxisViewItem
/** Called when a front trim is about to begin */
virtual void trim_front_starting () {}
- void trim_front (framepos_t, bool);
+ bool trim_front (framepos_t, bool);
/** Called when a start trim has finished */
virtual void trim_front_ending () {}
- void trim_end (framepos_t, bool);
+ bool trim_end (framepos_t, bool);
void trim_contents (framepos_t, bool, bool);
virtual void thaw_after_trim ();
diff --git a/gtk2_ardour/session_option_editor.cc b/gtk2_ardour/session_option_editor.cc
index b0a353e5e8..aa2a7c9ccd 100644
--- a/gtk2_ardour/session_option_editor.cc
+++ b/gtk2_ardour/session_option_editor.cc
@@ -131,21 +131,9 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
/* FADES */
- ComboOption<CrossfadeModel>* cfm = new ComboOption<CrossfadeModel> (
- "xfade-model",
- _("Crossfades are created"),
- sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfade_model),
- sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfade_model)
- );
-
- cfm->add (FullCrossfade, _("to span entire overlap"));
- cfm->add (ShortCrossfade, _("short"));
-
- add_option (_("Fades"), cfm);
-
ComboOption<CrossfadeChoice>* cfc = new ComboOption<CrossfadeChoice> (
"xfade-choice",
- _("Crossfade type"),
+ _("Default crossfade type"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_xfade_choice),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfade_choice)
);
@@ -157,15 +145,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
add_option (_("Fades"), cfc);
add_option (_("Fades"), new SpinOption<float> (
- _("short-xfade-seconds"),
- _("Short crossfade length"),
- sigc::mem_fun (*_session_config, &SessionConfiguration::get_short_xfade_seconds),
- sigc::mem_fun (*_session_config, &SessionConfiguration::set_short_xfade_seconds),
- 0, 1000, 1, 10,
- _("ms"), 0.001
- ));
-
- add_option (_("Fades"), new SpinOption<float> (
_("destructive-xfade-seconds"),
_("Destructive crossfade length"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_destructive_xfade_msecs),
@@ -175,13 +154,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
));
add_option (_("Fades"), new BoolOption (
- "auto-xfade",
- _("Create crossfades automatically"),
- sigc::mem_fun (*_session_config, &SessionConfiguration::get_auto_xfade),
- sigc::mem_fun (*_session_config, &SessionConfiguration::set_auto_xfade)
- ));
-
- add_option (_("Fades"), new BoolOption (
"use-region-fades",
_("Region fades active"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_use_region_fades),
@@ -243,7 +215,7 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
add_option (_("Monitoring"), new BoolOption (
"auto-input",
- _("Monitoring automatically follows transport state (\"auto-input\")"),
+ _("Track Input Monitoring automatically follows transport state (\"auto-input\")"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_auto_input),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_auto_input)
));