diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc index 382f6afd09..43a1c741df 100644 --- a/gtk2_ardour/crossfade_edit.cc +++ b/gtk2_ardour/crossfade_edit.cc @@ -27,6 +27,7 @@ #include +#include "pbd/memento_command.h" #include "ardour/automation_list.h" #include "evoral/Curve.hpp" #include "ardour/crossfade.h" @@ -783,7 +784,14 @@ CrossfadeEditor::apply_preset (Preset *preset) void CrossfadeEditor::apply () { + _session->begin_reversible_command (_("Edit crossfade")); + + XMLNode& before = xfade->get_state (); + _apply_to (xfade); + + _session->add_command (new MementoCommand (*xfade.get(), &before, &xfade->get_state())); + _session->commit_reversible_command (); } void diff --git a/gtk2_ardour/crossfade_view.cc b/gtk2_ardour/crossfade_view.cc index 4743c87ce4..f77f8db442 100644 --- a/gtk2_ardour/crossfade_view.cc +++ b/gtk2_ardour/crossfade_view.cc @@ -84,6 +84,7 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent, crossfade_changed (all_crossfade_properties); crossfade->PropertyChanged.connect (*this, invalidator (*this), ui_bind (&CrossfadeView::crossfade_changed, this, _1), gui_context()); + crossfade->FadesChanged.connect (*this, invalidator (*this), ui_bind (&CrossfadeView::crossfade_fades_changed, this), gui_context()); ColorsChanged.connect (sigc::mem_fun (*this, &CrossfadeView::color_handler)); } @@ -261,3 +262,9 @@ CrossfadeView::fake_hide () { group->hide(); } + +void +CrossfadeView::crossfade_fades_changed () +{ + redraw_curves (); +} diff --git a/gtk2_ardour/crossfade_view.h b/gtk2_ardour/crossfade_view.h index 6bda06999d..db1d33fdf8 100644 --- a/gtk2_ardour/crossfade_view.h +++ b/gtk2_ardour/crossfade_view.h @@ -72,6 +72,7 @@ struct CrossfadeView : public TimeAxisViewItem ArdourCanvas::Item *active_button; void crossfade_changed (const PBD::PropertyChange&); + void crossfade_fades_changed (); void active_changed (); void redraw_curves (); void color_handler (); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 3181ea0728..8f1d259df4 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1646,7 +1646,7 @@ Editor::add_crossfade_context_items (AudioStreamView* /*view*/, boost::shared_pt } items.push_back (MenuElem (str, sigc::bind (sigc::mem_fun(*this, &Editor::toggle_xfade_active), boost::weak_ptr (xfade)))); - items.push_back (MenuElem (_("Edit"), sigc::bind (sigc::mem_fun(*this, &Editor::edit_xfade), boost::weak_ptr (xfade)))); + items.push_back (MenuElem (_("Edit..."), sigc::bind (sigc::mem_fun(*this, &Editor::edit_xfade), boost::weak_ptr (xfade)))); if (xfade->can_follow_overlap()) { diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h index 7b5ac28379..4c75a0226b 100644 --- a/libs/ardour/ardour/crossfade.h +++ b/libs/ardour/ardour/crossfade.h @@ -142,6 +142,9 @@ class Crossfade : public ARDOUR::AudioRegion static framecnt_t short_xfade_length() { return _short_xfade_length; } static void set_short_xfade_length (framecnt_t n); + /** emitted when the actual fade curves change, as opposed to one of the Stateful properties */ + PBD::Signal0 FadesChanged; + private: friend struct CrossfadeComparePtr; friend class AudioPlaylist; diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index 276a42f77b..40857bd56a 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -865,6 +865,7 @@ Crossfade::set_state (const XMLNode& node, int /*version*/) _fade_out.thaw (); PropertyChanged (what_changed); /* EMIT SIGNAL */ + FadesChanged (); /* EMIT SIGNAL */ return 0; }