summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-06-08 23:24:14 +0000
committerCarl Hetherington <carl@carlh.net>2009-06-08 23:24:14 +0000
commit41c5bff44265579da83f05bab6a72651e4f84de9 (patch)
tree78dada08b3828cd798ed9345535e1399c827d082 /libs
parentbf5111c90de3bac2e73a930a1b4c77b719e5c740 (diff)
Allow Insert Time option to move tempos and time sig changes, as per #1951.
git-svn-id: svn://localhost/ardour2/branches/3.0@5132 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/tempo.h2
-rw-r--r--libs/ardour/tempo.cc14
2 files changed, 16 insertions, 0 deletions
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index d88c5366d2..fcda463fe1 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -246,6 +246,8 @@ class TempoMap : public PBD::StatefulDestructible
void change_existing_tempo_at (nframes_t, double bpm, double note_type);
void change_initial_tempo (double bpm, double note_type);
+ void insert_time (nframes_t, nframes_t);
+
int n_tempos () const;
int n_meters () const;
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index 00c187a5bd..3056016752 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -1536,3 +1536,17 @@ TempoMap::n_meters() const
return cnt;
}
+
+void
+TempoMap::insert_time (nframes_t where, nframes_t amount)
+{
+ for (Metrics::iterator i = metrics->begin(); i != metrics->end(); ++i) {
+ if ((*i)->frame() >= where) {
+ (*i)->set_frame ((*i)->frame() + amount);
+ }
+ }
+
+ timestamp_metrics (false);
+
+ StateChanged (Change (0));
+}