summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-06-28 02:40:09 +0000
committerCarl Hetherington <carl@carlh.net>2010-06-28 02:40:09 +0000
commited19559ece9c2420a2d590f1e9c3c6c9c62e90ab (patch)
tree397f797024fa4cd6dfa24e7242dd5c13878643a2 /gtk2_ardour
parentc8e07653daab1b8d5e77aada9ed9a351907c71f1 (diff)
Generate undo record for crossfade edits, and provide signalling to update the view when such things are undone. Partially fixes #3257.
git-svn-id: svn://localhost/ardour2/branches/3.0@7309 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/crossfade_edit.cc8
-rw-r--r--gtk2_ardour/crossfade_view.cc7
-rw-r--r--gtk2_ardour/crossfade_view.h1
-rw-r--r--gtk2_ardour/editor.cc2
4 files changed, 17 insertions, 1 deletions
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 <libgnomecanvasmm/line.h>
+#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<Crossfade> (*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<Crossfade> (xfade))));
- items.push_back (MenuElem (_("Edit"), sigc::bind (sigc::mem_fun(*this, &Editor::edit_xfade), boost::weak_ptr<Crossfade> (xfade))));
+ items.push_back (MenuElem (_("Edit..."), sigc::bind (sigc::mem_fun(*this, &Editor::edit_xfade), boost::weak_ptr<Crossfade> (xfade))));
if (xfade->can_follow_overlap()) {