summaryrefslogtreecommitdiff
path: root/libs/ardour/route.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-12-02 17:34:05 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-12-02 17:34:05 +0000
commit6e3190e17c83b468abf262618e7341b778819d85 (patch)
treec1f589f06a89a1b211f7fad86ac0a86749aac0ba /libs/ardour/route.cc
parent4fc93e9381c44e4a7f1be787727a65caacae50aa (diff)
define ARCH_X86 even on x86_64 (untested!); giso's patch for control surface track indexing; carl's patches for insert-time and double-click on redirect boxes
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4279 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r--libs/ardour/route.cc45
1 files changed, 45 insertions, 0 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc
index 41ba51b0d1..edfcaa7962 100644
--- a/libs/ardour/route.cc
+++ b/libs/ardour/route.cc
@@ -25,6 +25,7 @@
#include <pbd/xml++.h>
#include <pbd/enumwriter.h>
#include <pbd/stacktrace.h>
+#include <pbd/memento_command.h>
#include <ardour/timestamps.h>
#include <ardour/buffer.h>
@@ -2614,3 +2615,47 @@ Route::set_pending_declick (int declick)
}
}
+
+/** Shift automation forwards from a particular place, thereby inserting time.
+ * Adds undo commands for any shifts that are performed.
+ *
+ * @param pos Position to start shifting from.
+ * @param frames Amount to shift forwards by.
+ */
+
+void
+Route::shift (nframes64_t pos, nframes64_t frames)
+{
+ /* gain automation */
+ XMLNode &before = _gain_automation_curve.get_state ();
+ _gain_automation_curve.shift (pos, frames);
+ XMLNode &after = _gain_automation_curve.get_state ();
+ _session.add_command (new MementoCommand<AutomationList> (_gain_automation_curve, &before, &after));
+
+ /* pan automation */
+ for (std::vector<StreamPanner*>::iterator i = _panner->begin (); i != _panner->end (); ++i) {
+ Curve & c = (*i)->automation ();
+ XMLNode &before = c.get_state ();
+ c.shift (pos, frames);
+ XMLNode &after = c.get_state ();
+ _session.add_command (new MementoCommand<AutomationList> (c, &before, &after));
+ }
+
+ /* redirect automation */
+ {
+ Glib::RWLock::ReaderLock lm (redirect_lock);
+ for (RedirectList::iterator i = _redirects.begin (); i != _redirects.end (); ++i) {
+
+ set<uint32_t> a;
+ (*i)->what_has_automation (a);
+
+ for (set<uint32_t>::const_iterator j = a.begin (); j != a.end (); ++j) {
+ AutomationList & al = (*i)->automation_list (*j);
+ XMLNode &before = al.get_state ();
+ al.shift (pos, frames);
+ XMLNode &after = al.get_state ();
+ _session.add_command (new MementoCommand<AutomationList> (al, &before, &after));
+ }
+ }
+ }
+}